jsdai.lang
Interface EntityDefinition

All Superinterfaces:
jsdai.dictionary.EData_type, EEntity, jsdai.dictionary.ENamed_type, SdaiEventSource

public interface EntityDefinition
extends jsdai.dictionary.ENamed_type

This interface is for internal JSDAI use only. Applications shall not use it.


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 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
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);

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 - ED_NDEF, entity definition not defined.
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
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.

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 jsdai.dictionary.AExplicit_attribute getExplicit_attributes(jsdai.dictionary.EEntity_definition type)
                                                            throws SdaiException
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);

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 boolean testExplicit_attributes(jsdai.dictionary.EEntity_definition type)
                                throws SdaiException
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.

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
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());

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

isValidFor

public boolean isValidFor(java.lang.Class schema)
                   throws SdaiException
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);

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

Copyright © LKSoftWare GmbH, 1999-2008