Class DefaultDescriptor
- java.lang.Object
-
- com.sodius.mdw.metamodel.rhapsody.util.log.DefaultDescriptor
-
- All Implemented Interfaces:
ElementDescriptor
- Direct Known Subclasses:
EObjectDescriptor
public class DefaultDescriptor extends java.lang.Object implements ElementDescriptor
ElementDescriptor handling any Object and providing standard properties: - PROPERTY_ID representing a unique identifier of the element: hashcode by default - PROPERTY_CLASS representing the class from which the object is an instance - PROPERTY_DESCRIPTION represents the object's content. Subclasses of DefaultDescriptor are invited to contribue on those properties by overriding following respective methods: - getPropertyID - getPropertyClassName - getPropertyDescription
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_CLASS
static java.lang.String
PROPERTY_DESCRIPTION
static java.lang.String
PROPERTY_ID
protected java.util.Map<java.lang.String,java.util.function.Function<java.lang.Object,java.lang.String>>
propertyGetters
Map storing list of Properties handled by this Descriptor and its respective method to call
-
Constructor Summary
Constructors Constructor Description DefaultDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getHandledClass()
java.util.Map<java.lang.String,java.lang.String>
getProperties(java.lang.Object element)
protected java.lang.String
getPropertyClassName(java.lang.Object o)
The Object's Classprotected java.lang.String
getPropertyDescription(java.lang.Object o)
The Object's descriptionprotected java.lang.String
getPropertyID(java.lang.Object o)
The Object's ID-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sodius.mdw.metamodel.rhapsody.util.log.ElementDescriptor
canHandle
-
-
-
-
Field Detail
-
PROPERTY_ID
public static final java.lang.String PROPERTY_ID
- See Also:
- Constant Field Values
-
PROPERTY_CLASS
public static final java.lang.String PROPERTY_CLASS
- See Also:
- Constant Field Values
-
PROPERTY_DESCRIPTION
public static final java.lang.String PROPERTY_DESCRIPTION
- See Also:
- Constant Field Values
-
propertyGetters
protected final java.util.Map<java.lang.String,java.util.function.Function<java.lang.Object,java.lang.String>> propertyGetters
Map storing list of Properties handled by this Descriptor and its respective method to call
-
-
Method Detail
-
getPropertyDescription
protected java.lang.String getPropertyDescription(java.lang.Object o)
The Object's description- Parameters:
o
-- Returns:
- toString()
-
getPropertyID
protected java.lang.String getPropertyID(java.lang.Object o)
The Object's ID- Parameters:
o
-- Returns:
- hascode()
-
getPropertyClassName
protected java.lang.String getPropertyClassName(java.lang.Object o)
The Object's Class- Parameters:
o
-- Returns:
- getClass().GetSimpleName()
-
getHandledClass
public java.lang.Class<?> getHandledClass()
- Specified by:
getHandledClass
in interfaceElementDescriptor
- Returns:
- the Java Class this descriptor can handle
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties(java.lang.Object element)
- Specified by:
getProperties
in interfaceElementDescriptor
- Returns:
- a map of properties describing the element
-
-