Package eu.dnetlib.dhp.schema.common
Class ModelSupport
java.lang.Object
eu.dnetlib.dhp.schema.common.ModelSupport
Oaf model utility methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Map<EntityType,Class> Defines the mapping between the actual entity types and the relative classes implementing themstatic final Map<String,RelationInverse> -
Method Summary
Modifier and TypeMethodDescriptionstatic RelationInversefindInverse(String encoding) Helper method: lookup relation inverse, given the direct relation encoding (case insensitive)static RelationInversefindRelation(String relationName) Helper method: fina a relation filtering by a relation namestatic StringgenerateIdentifier(String originalId, String nsPrefix) static <E> StringgetIdPrefix(Class<E> clazz) static StringgetMainType(EntityType type) Lists all the OAF model classesstatic StringidFn()static booleanisResult(EntityType type) isSubClass(Class<X> subClazz, Class<Y> superClazz) Checks subclass-superclass relationship.isSubClass(X subClazzObject, Class<Y> superClazz) Checks subclass-superclass relationship.isSubClass(X subClazzObject, Y superClazzObject) Checks subclass-superclass relationship.static Stringstatic Stringstatic StringHelper method: combines the relation attributestableIdentifier(String dbName, Class<T> clazz) tableIdentifier(String dbName, String tableName)
-
Field Details
-
entityTypes
Defines the mapping between the actual entity types and the relative classes implementing them -
oafTypes
-
idPrefixMap
-
entityIdPrefix
-
idPrefixEntity
-
relationInverseMap
-
DATE_FORMAT
- See Also:
-
-
Method Details
-
findInverse
Helper method: lookup relation inverse, given the direct relation encoding (case insensitive)- Parameters:
encoding-- Returns:
- the relation inverse descriptor, throws @IllegalArgumentException when not found.
-
findRelation
Helper method: fina a relation filtering by a relation name- Parameters:
relationName-- Returns:
-
rel
Helper method: combines the relation attributes- Parameters:
relType-subRelType-relClass-- Returns:
-
getIdPrefix
-
isSubClass
public static <X extends Oaf,Y extends Oaf> Boolean isSubClass(X subClazzObject, Y superClazzObject) Checks subclass-superclass relationship.- Type Parameters:
X- Subclass typeY- Superclass type- Parameters:
subClazzObject- Subclass object instancesuperClazzObject- Superclass object instance- Returns:
- True if X is a subclass of Y
-
isSubClass
public static <X extends Oaf,Y extends Oaf> Boolean isSubClass(X subClazzObject, Class<Y> superClazz) Checks subclass-superclass relationship.- Type Parameters:
X- Subclass typeY- Superclass type- Parameters:
subClazzObject- Subclass object instancesuperClazz- Superclass class- Returns:
- True if X is a subclass of Y
-
isSubClass
public static <X extends Oaf,Y extends Oaf> Boolean isSubClass(Class<X> subClazz, Class<Y> superClazz) Checks subclass-superclass relationship.- Type Parameters:
X- Subclass typeY- Superclass type- Parameters:
subClazz- Subclass classsuperClazz- Superclass class- Returns:
- True if X is a subclass of Y
-
getOafModelClasses
Lists all the OAF model classes- Type Parameters:
T-- Returns:
-
getMainType
-
isResult
-
getScheme
-
tableIdentifier
-
tableIdentifier
-
idFn
-
md5
-
generateIdentifier
-
oldest
- Throws:
ParseException
-