Class ClassInformation
- java.lang.Object
-
- org.gcube.informationsystem.discovery.knowledge.ClassInformation
-
- All Implemented Interfaces:
NodeInformation<Class<Element>>,TypeInformation<Class<Element>>
public class ClassInformation extends Object implements TypeInformation<Class<Element>>
An implementation ofTypeInformationforClass<Element>objects.This class provides methods to extract type information, such as identifiers and parent-child relationships, from Java
Classobjects representing Information System elements.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Constructor Description ClassInformation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessTypegetAccessType(Class<Element> clz)Returns theAccessTypeof the given element.StringgetIdentifier(Class<Element> clz)Returns a unique identifier for the given element.List<String>getParentIdentifiers(Class<Element> root, Class<Element> clz)Returns the identifiers of the parents of the given element, in the order that decides precedence among them.Class<Element>getRoot(AccessType accessType)Returns the root element for a givenAccessType.
-
-
-
Method Detail
-
getIdentifier
public String getIdentifier(Class<Element> clz)
Returns a unique identifier for the given element.- Specified by:
getIdentifierin interfaceNodeInformation<Class<Element>>- Parameters:
clz- The element.- Returns:
- The unique identifier.
-
getParentIdentifiers
public List<String> getParentIdentifiers(Class<Element> root, Class<Element> clz)
Returns the identifiers of the parents of the given element, in the order that decides precedence among them.A
Listbecause the order is read:Dag.addNode(Object)takes the first parent when the DAG does not allow multiple inheritance, so which one comes first decides where the node is attached. ASetwould leave that to the implementation's choice of collection.- Specified by:
getParentIdentifiersin interfaceNodeInformation<Class<Element>>- Parameters:
root- The root element of the DAG.clz- The element.- Returns:
- The parent identifiers, most significant first.
-
getAccessType
public AccessType getAccessType(Class<Element> clz)
Returns theAccessTypeof the given element.- Specified by:
getAccessTypein interfaceTypeInformation<Class<Element>>- Parameters:
clz- The element.- Returns:
- The access type.
-
getRoot
public Class<Element> getRoot(AccessType accessType)
Returns the root element for a givenAccessType.- Specified by:
getRootin interfaceTypeInformation<Class<Element>>- Parameters:
accessType- The access type.- Returns:
- The root element.
-
-