jsdai.lang
Class CEntityDefinition

java.lang.Object
  extended byjsdai.lang.SdaiCommon
      extended byjsdai.lang.InverseEntity
          extended byjsdai.lang.CEntity
              extended byjsdai.lang.DataType
                  extended byjsdai.lang.CEntityDefinition
All Implemented Interfaces:
jsdai.dictionary.EData_type, EEntity, jsdai.dictionary.EEntity_definition, jsdai.dictionary.EEntity_or_view_definition, jsdai.dictionary.ENamed_type, EntityDefinition, SdaiEventSource

public abstract class CEntityDefinition
extends DataType
implements jsdai.dictionary.EEntity_definition

It is a supertype of the class CEntity_definition contained in the jsdai.dictionary package. This class is designed primarily to hold some non-public data fields and a number of non-public methods mainly used for processing of values of these fields and for creation of the data dictionary during opening of the session. Also, the public methods isSubtypeOf and isDomainEquivalentWith defined in "ISO 10303-22: Product data representation and exchange: Standard data access interface" and additional public methods getExplicit_attributes and testExplicit_attributes, which are not a part of the standard, are implemented here.


Field Summary
 
Fields inherited from interface jsdai.lang.EEntity
MANDATORY_ATTRIBUTES_SET, MOST_SPECIFC_ENTITY, NO_RESTRICTIONS
 
Method Summary
 jsdai.dictionary.AExplicit_attribute getExplicit_attributes(jsdai.dictionary.EEntity_definition type)
          Returns a read-only aggregate containing all explicit attributes of the specified entity data type (but not of its subtypes).
 boolean isDomainEquivalentWith(jsdai.dictionary.EEntity_definition compType)
          Checks if the entity data type, specified by this entity definition, is domain equivalent with another entity type.
 boolean isSubtypeOf(jsdai.dictionary.EEntity_definition compType)
          Checks if the entity data type, specified by this entity definition, is a subtype of another entity type.
 boolean isValidFor(java.lang.Class schema)
          Checks if the entity data type, specified by this entity definition, is within the context of the specified schema.
 boolean isValidFor(jsdai.dictionary.ESchema_definition schema)
          Checks if the entity data type, specified by this entity definition, is within the context of the specified schema.
 boolean testExplicit_attributes(jsdai.dictionary.EEntity_definition type)
          Returns true for each available entity data type.
 
Methods inherited from class jsdai.lang.CEntity
addSdaiListener, buildMappedInstance, compareValuesBoolean, compareValuesLogical, copyApplicationInstance, copyValuesFrom, createAggregate, createExternalData, deleteApplicationInstance, findEntityInstanceSdaiModel, findEntityInstanceUsedin, findEntityInstanceUsers, findEntityMappings, findEntityMappings, findInstanceDataTypes, findInstanceRoles, findLinkedMappedInstance, findMappedUsers, findMostSpecificMappings, get_boolean, get_double, get_int, get_inverse, get_object, get, getAllReferences, getAttributeDefinition, getAttributeValueBound, getDescription, getExternalData, getMappedAttribute, getMappedAttribute, getPersistentLabel, getTemp, getTemp, hasMappedAttribute, isInstanceOf, isInstanceOf, isKindOf, isKindOf, isValid, makeUsedin, moveUsersFrom, removeExternalData, removeSdaiListener, set, set, set, set, set, setTemp, setTemp, testAttribute, testAttributeFast, testExternalData, testMappedAttribute, testMappedAttribute, testMappedEntity, testMappedEntity, typeOf, toString, toValue, unsetAttributeValue, validateAggregatesSize, validateAggregatesUniqueness, validateArrayNotOptional, validateBinaryWidth, validateExplicitAttributesReferences, validateInverseAttributes, validateInverseAttributes, validateRealPrecision, validateRequiredExplicitAttributesAssigned, validateStringWidth, validateWhereRule, validateWhereRule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jsdai.dictionary.EEntity_definition
getAbstract_entity, getAttributes, getComplex, getConnotational_subtype, getGlobal_rules, getIndependent, getInstantiable, getSupertypes, getUniqueness_rules, setAbstract_entity, setComplex, setConnotational_subtype, setIndependent, setInstantiable, testAbstract_entity, testComplex, testConnotational_subtype, testIndependent, testInstantiable, testSupertypes, unsetAbstract_entity, unsetComplex, unsetConnotational_subtype, unsetIndependent, unsetInstantiable
 
Methods inherited from interface jsdai.dictionary.EEntity_or_view_definition
createGeneric_supertypes, getGeneric_supertypes, testGeneric_supertypes, unsetGeneric_supertypes
 
Methods inherited from interface jsdai.dictionary.ENamed_type
getShort_name, getWhere_rules, setShort_name, testShort_name, unsetShort_name
 
Methods inherited from interface jsdai.dictionary.EData_type
getName, setName, testName, unsetName
 
Methods inherited from interface jsdai.lang.EEntity
buildMappedInstance, compareValuesBoolean, compareValuesLogical, copyApplicationInstance, copyValuesFrom, createAggregate, createExternalData, deleteApplicationInstance, findEntityInstanceSdaiModel, findEntityInstanceUsedin, findEntityInstanceUsers, findEntityMappings, findEntityMappings, findInstanceDataTypes, findInstanceRoles, findLinkedMappedInstance, findMappedUsers, findMostSpecificMappings, get_boolean, get_double, get_int, get_inverse, get_object, get, getAllReferences, getAttributeDefinition, getAttributeValueBound, getDescription, getExternalData, getInstanceType, getMappedAttribute, getMappedAttribute, getPersistentLabel, getTemp, getTemp, hasMappedAttribute, isInstanceOf, isInstanceOf, isKindOf, isKindOf, isValid, moveUsersFrom, removeExternalData, set, set, set, set, set, setTemp, setTemp, testAttribute, testExternalData, testMappedAttribute, testMappedAttribute, testMappedEntity, testMappedEntity, typeOf, toString, unsetAttributeValue, validateAggregatesSize, validateAggregatesUniqueness, validateArrayNotOptional, validateBinaryWidth, validateExplicitAttributesReferences, validateInverseAttributes, validateInverseAttributes, validateRealPrecision, validateRequiredExplicitAttributesAssigned, validateStringWidth, validateWhereRule, validateWhereRule
 
Methods inherited from interface jsdai.lang.SdaiEventSource
addSdaiListener, removeSdaiListener
 

Method Detail

isSubtypeOf

public boolean isSubtypeOf(jsdai.dictionary.EEntity_definition compType)
                    throws SdaiException
Description copied from interface: EntityDefinition
Checks if the entity data type, specified by this entity definition, is a subtype of another entity type. The latter is submitted through the method's parameter. The answer is obtained solely on the basis of "SDAI_dictionary_schema" information. If null is passed to the method's parameter, then SdaiException ED_NDEF is thrown.

Example:

    EVector vect = ...;
    ERepresentation_item item = ...;
    EEntity_definition def_vect = vect.getInstanceType();
    EEntity_definition def_item = item.getInstanceType();
    boolean is_vect_subtype_of_item = def_vect.isSubtypeOf(def_item);

Specified by:
isSubtypeOf in interface EntityDefinition
Parameters:
compType - the given type (instance of EEntity_definition).
Returns:
true if this entity data type is a subtype of the given type; false, otherwise.
Throws:
SdaiException - SY_ERR, underlying system error.
See Also:
"ISO 10303-22::10.9.2 Is subtype of"

isDomainEquivalentWith

public boolean isDomainEquivalentWith(jsdai.dictionary.EEntity_definition compType)
                               throws SdaiException
Description copied from interface: EntityDefinition
Checks if the entity data type, specified by this entity definition, is domain equivalent with another entity type. This method is not implemented in current JSDAI version.

SdaiException FN_NAVL will be thrown if this method is invoked.

Specified by:
isDomainEquivalentWith in interface EntityDefinition
Parameters:
compType - the given type (instance of EEntity_definition).
Returns:
true if this entity data type is domain equivalent with the given type; false, otherwise.
Throws:
SdaiException - FN_NAVL, function not available.
See Also:
"ISO 10303-22::10.9.4 Is domain equivalent with"

getExplicit_attributes

public final jsdai.dictionary.AExplicit_attribute getExplicit_attributes(jsdai.dictionary.EEntity_definition type)
                                                                  throws SdaiException
Description copied from interface: EntityDefinition
Returns a read-only aggregate containing all explicit attributes of the specified entity data type (but not of its subtypes). Redeclaring explicit attributes are also included.

Example:

    EVector vect = ...;
    EEntity_definition def_vect = vect.getInstanceType();
    AExplicit_attribute attributes = def_vect.getExplicit_attributes(null);

Specified by:
getExplicit_attributes in interface EntityDefinition
Parameters:
type - definition of the entity of which explicit attributes are required.
Returns:
aggregate containing all explicit attributes of the specified entity data type.
Throws:
SdaiException - SY_ERR, underlying system error.

testExplicit_attributes

public final boolean testExplicit_attributes(jsdai.dictionary.EEntity_definition type)
                                      throws SdaiException
Description copied from interface: EntityDefinition
Returns true for each available entity data type. This method is included just to keep compatibility of applications written for an older version of JSDAI, in which this method was assigned to EEntity_definition class of jsdai.dictionary package.

Specified by:
testExplicit_attributes in interface EntityDefinition
Parameters:
type - definition the aggregate of explicit attributes of which is tested.
Returns:
true value always.
Throws:
SdaiException

isValidFor

public boolean isValidFor(jsdai.dictionary.ESchema_definition schema)
                   throws SdaiException
Description copied from interface: EntityDefinition
Checks if the entity data type, specified by this entity definition, is within the context of the specified schema. Definition of the latter is submitted through the method's parameter. If the answer is positive, then instances of the checked entity data type are allowed to be created in SdaiModels whose underlying schema is the schema for which this method has been executed. If the answer is negative, then creation of such instances in such SdaiModels will result in throwing SdaiException ED_NVLD.

Example:

    	SdaiModel mod_xim = repo.createSdaiModel("mod_xim", 
    SAp210_electronic_assembly_interconnect_and_packaging_design_xim.class);
    SdaiModel mod_kin = repo.createSdaiModel("mod_kin", SKinematic_structure_schema.class);
    EEntity_definition edef = mod_kin.getUnderlyingSchema().getEntityDefinition("gear_pair");
    boolean valid = edef.isValidFor(mod_xim.getUnderlyingSchema());

Specified by:
isValidFor in interface EntityDefinition
Parameters:
schema - the given schema definition.
Returns:
true if this entity data type is within the context of the schema; false, otherwise.
Throws:
SdaiException - SY_ERR, underlying system error.
Since:
4.0.0
See Also:
isValidFor(Class)

isValidFor

public boolean isValidFor(java.lang.Class schema)
                   throws SdaiException
Description copied from interface: EntityDefinition
Checks if the entity data type, specified by this entity definition, is within the context of the specified schema. Java class of the latter is submitted through the method's parameter. If the answer is positive, then instances of the checked entity data type are allowed to be created in SdaiModels whose underlying schema is the schema for which this method has been executed. If the answer is negative, then creation of such instances in such SdaiModels will result in throwing SdaiException ED_NVLD.

Example:

    	SdaiModel mod_kin = repo.createSdaiModel("mod_kin", SKinematic_structure_schema.class);
    EEntity_definition edef = mod_kin.getUnderlyingSchema().getEntityDefinition("gear_pair");
    boolean valid = edef.isValidFor(SAp210_electronic_assembly_interconnect_and_packaging_design_xim.class);

Specified by:
isValidFor in interface EntityDefinition
Parameters:
schema - the given schema.
Returns:
true if this entity data type is within the context of the schema; false, otherwise.
Throws:
SdaiException - SY_ERR, underlying system error.
Since:
4.0.0
See Also:
isValidFor(ESchema_definition)

Copyright © LKSoftWare GmbH, 1999-2008