Class MetaClass
- java.lang.Object
-
- es.bsc.dataclay.util.MgrObject<MetaClassID>
-
- es.bsc.dataclay.util.management.classmgr.MetaClass
-
public final class MetaClass extends MgrObject<MetaClassID>
This class represents a Metaclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLanguageDepInfo(LanguageDependantClassInfo langClassInfo)Add language dependant class informationbooleanaddOperation(Operation newoperation)Add a new operation to the list of operationsbooleanaddProperty(Property newproperty, int position)Add a new property to the list of propertiesbooleanaddPropertyAsEnrichment(Property newproperty)Add a new property to the list of propertiesbooleanequals(Object object)booleanexistsOperationInClass(OperationID operationID)This operation verifies if a Operation identified by operationID existsbooleanexistsPropertyInClass(PropertyID propertyID)This operation verifies if a Property identified by propertyID existsbooleanexistsPropertyInClass(String propertyName)This operation verifies if a Property with the name provided existsList<ECA>getEcas()ImplementationgetImplementation(ImplementationID implID)Get Implementation identified by id providedTuple<Operation,Implementation>getImplementationAndOperation(ImplementationID implementationID)Get the implementation with ID provided and the associated operation or NULL if not found.booleangetIsAbstract()Get the MetaClass::isAbstractJavaClassInfogetJavaClassInfo()Get Java language-dependant information of the classMap<CommonMessages.Langs,LanguageDependantClassInfo>getLanguageDepInfos()Get the MetaClass::languageDepInfosStringgetName()Get the MetaClass::nameStringgetNamespace()Get the MetaClass::namespaceNamespaceIDgetNamespaceID()Get the MetaClass::namespaceIDOperationgetOperation(OperationID operationID)Get operation identified by id providedOperationgetOperation(String opNameAndDescriptor)Get operation with method name and descriptor providedList<Operation>getOperations()Get the MetaClass::operationsUserTypegetParentType()Get the MetaClass::parentTypeList<Property>getProperties()Get the MetaClass::propertiesPropertygetProperty(PropertyID propertyID)Get property identified by id providedPythonClassInfogetPythonClassInfo()Get Python language-dependant information of the classinthashCode()booleanremoveOperation(OperationID operationID)This operation remove a Operation identified by operationID in the list of operations.voidsetEcas(List<ECA> newEcas)voidsetIsAbstract(boolean newisAbstract)Set the MetaClass::isAbstractvoidsetLanguageDepInfos(Map<CommonMessages.Langs,LanguageDependantClassInfo> newlanguageDepInfos)Set the MetaClass::languageDepInfosvoidsetName(String newname)Set the MetaClass::namevoidsetNamespace(String newnamespace)Set the MetaClass::namespacevoidsetNamespaceID(NamespaceID newnamespaceID)Set the MetaClass::namespaceIDvoidsetOperations(List<Operation> newoperations)Set the MetaClass::operationsvoidsetOperations(Set<Operation> newoperations)Set the MetaClass::operationsvoidsetParentType(UserType newparentType)Set the MetaClass::parentTypevoidsetProperties(List<Property> newproperties)Set the MetaClass::propertiesvoidsetProperties(SortedSet<Property> newproperties)Set the MetaClass::propertiesStringtoString()-
Methods inherited from class es.bsc.dataclay.util.MgrObject
getDataClayID, setDataClayID
-
-
-
-
Constructor Detail
-
MetaClass
public MetaClass()
Creates an empty Metaclass
-
MetaClass
public MetaClass(String newnamespace, String newname, UserType newparentType, boolean newisAbstract)
MetaClass constructor with provided specifications and IDs- Parameters:
newnamespace- Namespace to setnewname- Name to be setnewparentType- Type of the parent class (can be null)newisAbstract- Indicates class is abstract
-
-
Method Detail
-
getName
public String getName()
Get the MetaClass::name- Returns:
- the name
-
setName
public void setName(String newname)
Set the MetaClass::name- Parameters:
newname- the name to set
-
getParentType
public UserType getParentType()
Get the MetaClass::parentType- Returns:
- the parentType
-
setParentType
public void setParentType(UserType newparentType)
Set the MetaClass::parentType- Parameters:
newparentType- the parentType
-
getProperties
public List<Property> getProperties()
Get the MetaClass::properties- Returns:
- the properties
-
setProperties
public void setProperties(SortedSet<Property> newproperties)
Set the MetaClass::properties- Parameters:
newproperties- the properties
-
setProperties
public void setProperties(List<Property> newproperties)
Set the MetaClass::properties- Parameters:
newproperties- the properties This is YAML friendly for lists --instead of sets which Python doesn't like because they contain non-hashable fields.
-
getOperations
public List<Operation> getOperations()
Get the MetaClass::operations- Returns:
- the operations
-
setOperations
public void setOperations(Set<Operation> newoperations)
Set the MetaClass::operations- Parameters:
newoperations- the operations
-
setOperations
public void setOperations(List<Operation> newoperations)
Set the MetaClass::operations- Parameters:
newoperations- the operations This is YAML friendly for lists --instead of sets which Python doesn't like because they contain non-hashable fields.
-
addPropertyAsEnrichment
public boolean addPropertyAsEnrichment(Property newproperty)
Add a new property to the list of properties- Parameters:
newproperty- property to add- Returns:
- TRUE if property was not found and added. FALSE, otherwise.
-
addProperty
public boolean addProperty(Property newproperty, int position)
Add a new property to the list of properties- Parameters:
newproperty- property to addposition- position of the property- Returns:
- TRUE if property was not found and added. FALSE, otherwise.
-
addOperation
public boolean addOperation(Operation newoperation)
Add a new operation to the list of operations- Parameters:
newoperation- Operation to add- Returns:
- TRUE if Operation was not found and added. FALSE, otherwise.
-
existsPropertyInClass
public boolean existsPropertyInClass(PropertyID propertyID)
This operation verifies if a Property identified by propertyID exists- Parameters:
propertyID- ID of the property to query- Returns:
- TRUE if the provided property exists in the MetaClass. FALSE otherwise.
-
existsPropertyInClass
public boolean existsPropertyInClass(String propertyName)
This operation verifies if a Property with the name provided exists- Parameters:
propertyName- Name of the property to query- Returns:
- TRUE if the provided property exists in the MetaClass. FALSE otherwise.
-
existsOperationInClass
public boolean existsOperationInClass(OperationID operationID)
This operation verifies if a Operation identified by operationID exists- Parameters:
operationID- ID of the operation to query- Returns:
- TRUE if the provided operation exists in the MetaClass. FALSE otherwise.
-
removeOperation
public boolean removeOperation(OperationID operationID)
This operation remove a Operation identified by operationID in the list of operations.- Parameters:
operationID- ID of the operation to remove- Returns:
- TRUE if the provided Operation was successfully removed from system. FALSE otherwise.
-
getNamespace
public String getNamespace()
Get the MetaClass::namespace- Returns:
- the namespace
-
setNamespace
public void setNamespace(String newnamespace)
Set the MetaClass::namespace- Parameters:
newnamespace- the namespace to set
-
getOperation
public Operation getOperation(OperationID operationID)
Get operation identified by id provided- Parameters:
operationID- Operation ID- Returns:
- Operation or NULL if not exists.
-
getProperty
public Property getProperty(PropertyID propertyID)
Get property identified by id provided- Parameters:
propertyID- property ID- Returns:
- property or NULL if not exists.
-
getImplementation
public Implementation getImplementation(ImplementationID implID)
Get Implementation identified by id provided- Parameters:
implID- Implementation ID- Returns:
- Implementation or NULL if not exists.
-
getImplementationAndOperation
public Tuple<Operation,Implementation> getImplementationAndOperation(ImplementationID implementationID)
Get the implementation with ID provided and the associated operation or NULL if not found.- Parameters:
implementationID- ID of the implementation to seek- Returns:
- implementation with ID provided and the associated operation or NULL if not found.
-
getLanguageDepInfos
public Map<CommonMessages.Langs,LanguageDependantClassInfo> getLanguageDepInfos()
Get the MetaClass::languageDepInfos- Returns:
- the languageDepInfos
-
getJavaClassInfo
public JavaClassInfo getJavaClassInfo()
Get Java language-dependant information of the class- Returns:
- Java language-dependant information of the class
-
getPythonClassInfo
public PythonClassInfo getPythonClassInfo()
Get Python language-dependant information of the class- Returns:
- Python language-dependant information of the class
-
setLanguageDepInfos
public void setLanguageDepInfos(Map<CommonMessages.Langs,LanguageDependantClassInfo> newlanguageDepInfos)
Set the MetaClass::languageDepInfos- Parameters:
newlanguageDepInfos- the languageDepInfos to set
-
addLanguageDepInfo
public void addLanguageDepInfo(LanguageDependantClassInfo langClassInfo)
Add language dependant class information- Parameters:
langClassInfo- Language class information
-
getIsAbstract
public boolean getIsAbstract()
Get the MetaClass::isAbstract- Returns:
- the isAbstract
-
setIsAbstract
public void setIsAbstract(boolean newisAbstract)
Set the MetaClass::isAbstract- Parameters:
newisAbstract- the isAbstract to set
-
getNamespaceID
public NamespaceID getNamespaceID()
Get the MetaClass::namespaceID- Returns:
- the namespaceID
-
setNamespaceID
public void setNamespaceID(NamespaceID newnamespaceID)
Set the MetaClass::namespaceID- Parameters:
newnamespaceID- the namespaceID to set
-
-