Class DescriptorManager
- java.lang.Object
-
- com.sodius.mdw.metamodel.rhapsody.util.log.DescriptorManager
-
public class DescriptorManager extends java.lang.ObjectGenerate String description of an Object from registred ElementDescriptors- See Also:
ElementDescriptor
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdescriptionDefaultprotected java.lang.StringdescriptionHeaderprotected java.lang.StringdescriptionNullprotected java.lang.StringdescriptionTailprotected java.util.List<ElementDescriptor>descriptorsprotected java.lang.StringpropertySeparatorprotected java.lang.StringpropertyValueSeparator
-
Constructor Summary
Constructors Constructor Description DescriptorManager()Instanciate a new DecriptorManager with default formaters - descriptionDefault = "unknownElement" - descriptionNull = "null" - descriptionHeader = "" - descriptionTail = "" - propertySeparator = ", " - propertyValueSeparator = "="DescriptorManager(java.lang.String descriptionDefault, java.lang.String descriptionNull, java.lang.String descriptionHeader, java.lang.String descriptionTail, java.lang.String propertySeparator, java.lang.String propertyValueSeparator)Instanciate a new DecriptorManager with specific formaters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgenerateDescription(java.lang.String key, java.lang.String value)Generates a description related to one property key, valueprotected java.lang.StringgenerateDescription(java.util.Map<java.lang.String,java.lang.String> properties)Generates a description based on a map (key,value) of propertiesjava.lang.StringgetDescription(java.lang.Object element)Search for the most appropriate ElementDescriptor for this element and returns the generated descriptionvoidregister(ElementDescriptor descriptor)Register a new ElementDescriptor in this manager, and replace any pre-existing one handling the same classvoidregister(ElementDescriptor descriptor, boolean replace)Register a new ElementDescriptor in this manager
-
-
-
Field Detail
-
descriptionDefault
protected final java.lang.String descriptionDefault
-
descriptionNull
protected final java.lang.String descriptionNull
-
descriptors
protected final java.util.List<ElementDescriptor> descriptors
-
descriptionHeader
protected final java.lang.String descriptionHeader
-
descriptionTail
protected final java.lang.String descriptionTail
-
propertySeparator
protected final java.lang.String propertySeparator
-
propertyValueSeparator
protected final java.lang.String propertyValueSeparator
-
-
Constructor Detail
-
DescriptorManager
public DescriptorManager(java.lang.String descriptionDefault, java.lang.String descriptionNull, java.lang.String descriptionHeader, java.lang.String descriptionTail, java.lang.String propertySeparator, java.lang.String propertyValueSeparator)Instanciate a new DecriptorManager with specific formaters- Parameters:
descriptionDefault- Default String description of an element if no compatible ElementDescriptor founddescriptionNull- String description for null valuesdescriptionHeader- Header of a descriptiondescriptionTail- Tail of a descriptionpropertySeparator- Separator used between properties provided by an ElementDescriptorpropertyValueSeparator- Separator between key and value of a property
-
DescriptorManager
public DescriptorManager()
Instanciate a new DecriptorManager with default formaters - descriptionDefault = "unknownElement" - descriptionNull = "null" - descriptionHeader = "" - descriptionTail = "" - propertySeparator = ", " - propertyValueSeparator = "="
-
-
Method Detail
-
register
public void register(ElementDescriptor descriptor, boolean replace)
Register a new ElementDescriptor in this manager- Parameters:
descriptor-replace- true if this descriptor should replace any pre-existing one handling the same class
-
register
public void register(ElementDescriptor descriptor)
Register a new ElementDescriptor in this manager, and replace any pre-existing one handling the same class- Parameters:
descriptor-
-
getDescription
public java.lang.String getDescription(java.lang.Object element)
Search for the most appropriate ElementDescriptor for this element and returns the generated description- Parameters:
element-- Returns:
- the Element's description
-
generateDescription
protected java.lang.String generateDescription(java.util.Map<java.lang.String,java.lang.String> properties)
Generates a description based on a map (key,value) of properties- Parameters:
properties-- Returns:
-
generateDescription
protected java.lang.String generateDescription(java.lang.String key, java.lang.String value)Generates a description related to one property key, value- Parameters:
key-value-- Returns:
-
-