本文整理汇总了Java中nl.tue.buildingsmart.schema.EntityDefinition.isDerived方法的典型用法代码示例。如果您正苦于以下问题:Java EntityDefinition.isDerived方法的具体用法?Java EntityDefinition.isDerived怎么用?Java EntityDefinition.isDerived使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nl.tue.buildingsmart.schema.EntityDefinition
的用法示例。
在下文中一共展示了EntityDefinition.isDerived方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeEClass
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void writeEClass(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
Object referencedObject = object.eGet(feature);
if (referencedObject instanceof IdEObject && ((IdEObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
writeWrappedValue(object, feature, ((EObject)referencedObject).eClass());
} else {
if (referencedObject instanceof EObject && model.contains((IdEObject) referencedObject)) {
print(DASH);
print(String.valueOf(getExpressId((IdEObject) referencedObject)));
} else {
EntityDefinition entityBN = getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName());
if (entityBN != null && entityBN.isDerived(feature.getName())) {
print(ASTERISK);
} else if (feature.isMany()) {
writeList(object, feature);
} else {
writeObject(object, feature);
}
}
}
}
示例2: writeEClass
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void writeEClass(HashMapVirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
Object referencedObject = object.eGet(feature);
if (referencedObject instanceof AbstractHashMapVirtualObject && ((AbstractHashMapVirtualObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
writeWrappedValue(object, feature, ((AbstractHashMapVirtualObject)referencedObject).eClass());
} else {
if (referencedObject instanceof Long) {
if (object.useFeatureForSerialization(feature)) {
print(DASH);
print(String.valueOf(getExpressId((Long) referencedObject)));
} else {
print(DOLLAR);
}
} else {
EntityDefinition entityBN = getSchemaDefinition().getEntityBN(object.eClass().getName());
if (entityBN != null && entityBN.isDerived(feature.getName())) {
print(ASTERISK);
} else if (feature.isMany()) {
writeList(object, feature);
} else {
writeObject(object, feature);
}
}
}
}
示例3: writeEDataType
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void writeEDataType(VirtualObject object, EntityDefinition entityBN, EStructuralFeature feature)
throws SerializerException, IOException {
if (entityBN != null && entityBN.isDerived(feature.getName())) {
print(ASTERISK);
} else if (feature.isMany()) {
writeList(object, feature);
} else {
writeObject(object, feature);
}
}
示例4: writeEClass
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void writeEClass(VirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
Object referencedObject = object.eGet(feature);
if (referencedObject instanceof VirtualObject) {
EClass referencedObjectEClass = ((VirtualObject) referencedObject).eClass();
if (referencedObjectEClass.getEAnnotation("wrapped") != null) {
writeWrappedValue(object, feature, referencedObjectEClass);
}
} else {
if (referencedObject instanceof Long) {
if (object.useFeatureForSerialization(feature)) {
print(DASH);
print(String.valueOf(getExpressId((Long) referencedObject)));
} else {
print(DOLLAR);
}
} else {
EClass objectEClass = platformService.getEClassForCid(object.getEClassId());
EntityDefinition entityBN = getSchemaDefinition().getEntityBN(objectEClass.getName());
if (entityBN != null && entityBN.isDerived(feature.getName())) {
print(ASTERISK);
} else if (feature.isMany()) {
writeList(object, feature);
} else {
writeObject(object, feature);
}
}
}
}
示例5: buildUseForSerializationSet
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void buildUseForSerializationSet(EClass eClass) {
if (this.getSchemaDefinition() != null) {
if (!useForSerialization.containsKey(eClass)) {
HashSet<EStructuralFeature> set = new HashSet<>();
for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
EntityDefinition entityBN = this.getSchemaDefinition().getEntityBN(eClass.getName());
// if (eStructuralFeature.getEAnnotation("hidden") != null) {
// if (eStructuralFeature.getEAnnotation("asstring") == null) {
// } else {
// if (entityBN.isDerived(eStructuralFeature.getName().substring(0, eStructuralFeature.getName().length() - 8))) {
// } else {
// set.add(eStructuralFeature);
// }
// }
// }
if (entityBN != null) {
Attribute attribute = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName());
if (attribute != null && attribute instanceof ExplicitAttribute) {
if (!entityBN.isDerived(eStructuralFeature.getName()) || entityBN.isDerivedOverride(eStructuralFeature.getName())) {
set.add(eStructuralFeature);
}
}
}
}
useForSerialization.put(eClass, set);
}
}
}
示例6: buildUseForDatabaseStorage
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void buildUseForDatabaseStorage(EClass eClass) {
if (this.getSchemaDefinition() != null) {
HashSet<EStructuralFeature> set = new HashSet<>();
for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
EntityDefinition entityBN = this.getSchemaDefinition().getEntityBN(eClass.getName());
if (entityBN == null) {
set.add(eStructuralFeature);
} else {
if (!entityBN.isDerived(eStructuralFeature.getName())) {
boolean derived = false;
if (eStructuralFeature.getEAnnotation("hidden") != null) {
if (eStructuralFeature.getEAnnotation("asstring") == null) {
} else {
if (entityBN.isDerived(eStructuralFeature.getName().substring(0, eStructuralFeature.getName().length() - 8))) {
derived = true;
} else {
set.add(eStructuralFeature);
}
}
}
Attribute attribute = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName());
if (attribute == null) {
// geometry, *AsString
if (!derived) {
set.add(eStructuralFeature);
}
} else {
if (attribute instanceof ExplicitAttribute || attribute instanceof InverseAttribute) {
if (!entityBN.isDerived(attribute.getName())) {
set.add(eStructuralFeature);
}
}
}
}
}
}
useForDatabaseStorage.put(eClass, set);
}
}
示例7: writeEDataType
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void writeEDataType(IdEObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
if (entityBN != null && entityBN.isDerived(feature.getName())) {
print(ASTERISK);
} else if (feature.isMany()) {
writeList(object, feature);
} else {
writeObject(object, feature);
}
}
示例8: writeEDataType
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void writeEDataType(HashMapVirtualObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
if (entityBN != null && entityBN.isDerived(feature.getName())) {
print(ASTERISK);
} else if (feature.isMany()) {
writeList(object, feature);
} else {
writeObject(object, feature);
}
}
示例9: write
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void write(VirtualObject object) throws SerializerException, IOException {
if (object.eClass().getEAnnotation("hidden") != null) {
return;
}
print(DASH);
int convertedKey = getExpressId(object);
if (convertedKey == -1) {
throw new SerializerException("Going to serialize an object with id -1 (" + object.eClass().getName() + ")");
}
print(String.valueOf(convertedKey));
print("= ");
String upperCase = packageMetaData.getUpperCase(object.eClass());
if (upperCase == null) {
throw new SerializerException("Type not found: " + object.eClass().getName());
}
print(upperCase);
print(OPEN_PAREN);
boolean isFirst = true;
EntityDefinition entityBN = getSchemaDefinition().getEntityBN(object.eClass().getName());
for (EStructuralFeature feature : object.eClass().getEAllStructuralFeatures()) {
if (feature.getEAnnotation("hidden") == null && (entityBN != null
&& (!entityBN.isDerived(feature.getName()) || entityBN.isDerivedOverride(feature.getName())))) {
EClassifier type = feature.getEType();
if (type instanceof EEnum) {
if (!isFirst) {
print(COMMA);
}
writeEnum(object, feature);
isFirst = false;
} else if (type instanceof EClass) {
EReference eReference = (EReference) feature;
if (!packageMetaData.isInverse(eReference)) {
if (!isFirst) {
print(COMMA);
}
writeEClass(object, feature);
isFirst = false;
}
} else if (type instanceof EDataType) {
if (!isFirst) {
print(COMMA);
}
writeEDataType(object, entityBN, feature);
isFirst = false;
}
}
}
println(PAREN_CLOSE_SEMICOLON);
}
示例10: write
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void write(IdEObject object) throws SerializerException, IOException {
EClass eClass = object.eClass();
if (eClass.getEAnnotation("hidden") != null) {
return;
}
print(DASH);
int convertedKey = getExpressId(object);
if (convertedKey == -1) {
throw new SerializerException("Going to serialize an object with id -1 (" + object.eClass().getName() + ")");
}
print(String.valueOf(convertedKey));
print("= ");
String upperCase = getPackageMetaData().getUpperCase(eClass);
if (upperCase == null) {
throw new SerializerException("Type not found: " + eClass.getName());
}
print(upperCase);
print(OPEN_PAREN);
boolean isFirst = true;
EntityDefinition entityBN = getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName());
for (EStructuralFeature feature : eClass.getEAllStructuralFeatures()) {
if (feature.getEAnnotation("hidden") == null && (entityBN != null && (!entityBN.isDerived(feature.getName()) || entityBN.isDerivedOverride(feature.getName())))) {
EClassifier type = feature.getEType();
if (type instanceof EEnum) {
if (!isFirst) {
print(COMMA);
}
writeEnum(object, feature);
isFirst = false;
} else if (type instanceof EClass) {
EReference eReference = (EReference)feature;
if (!getPackageMetaData().isInverse(eReference)) {
if (!isFirst) {
print(COMMA);
}
writeEClass(object, feature);
isFirst = false;
}
} else if (type instanceof EDataType) {
if (!isFirst) {
print(COMMA);
}
writeEDataType(object, entityBN, feature);
isFirst = false;
}
}
}
println(PAREN_CLOSE_SEMICOLON);
}
示例11: write
import nl.tue.buildingsmart.schema.EntityDefinition; //导入方法依赖的package包/类
private void write(HashMapVirtualObject object) throws SerializerException, IOException {
// throw new SerializerException("test");
EClass eClass = object.eClass();
if (eClass.getEAnnotation("hidden") != null) {
return;
}
print(DASH);
int convertedKey = getExpressId(object);
if (convertedKey == -1) {
throw new SerializerException("Going to serialize an object with id -1 (" + object.eClass().getName() + ")");
}
print(String.valueOf(convertedKey));
print("= ");
String upperCase = packageMetaData.getUpperCase(eClass);
if (upperCase == null) {
throw new SerializerException("Type not found: " + eClass.getName());
}
print(upperCase);
print(OPEN_PAREN);
boolean isFirst = true;
EntityDefinition entityBN = getSchemaDefinition().getEntityBN(object.eClass().getName());
for (EStructuralFeature feature : eClass.getEAllStructuralFeatures()) {
if (feature.getEAnnotation("hidden") == null && (entityBN != null && (!entityBN.isDerived(feature.getName()) || entityBN.isDerivedOverride(feature.getName())))) {
EClassifier type = feature.getEType();
if (type instanceof EEnum) {
if (!isFirst) {
print(COMMA);
}
writeEnum(object, feature);
isFirst = false;
} else if (type instanceof EClass) {
EReference eReference = (EReference)feature;
if (!packageMetaData.isInverse(eReference)) {
if (!isFirst) {
print(COMMA);
}
writeEClass(object, feature);
isFirst = false;
}
} else if (type instanceof EDataType) {
if (!isFirst) {
print(COMMA);
}
writeEDataType(object, entityBN, feature);
isFirst = false;
}
}
}
println(PAREN_CLOSE_SEMICOLON);
}