Class 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
    • 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 Class
      protected java.lang.String getPropertyDescription​(java.lang.Object o)
      The Object's description
      protected 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
    • Field Detail

      • 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
    • Constructor Detail

      • DefaultDescriptor

        public DefaultDescriptor()
    • 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 interface ElementDescriptor
        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 interface ElementDescriptor
        Returns:
        a map of properties describing the element