Class AbstractPropertyExtractor

    • Field Detail

      • m_Cache

        protected static Hashtable<Class,​List<Class>> m_Cache
        the cache for object class / extractor relation.
      • m_Extractors

        protected static String[] m_Extractors
        the extractors (classnames) currently available.
      • m_ExtractorClasses

        protected static Class[] m_ExtractorClasses
        the extractors (classes) currently available.
      • m_Current

        protected Object m_Current
        the current object to inspect.
    • Constructor Detail

      • AbstractPropertyExtractor

        public AbstractPropertyExtractor()
    • Method Detail

      • initExtractors

        protected static void initExtractors()
        Initializes the extractors.
      • getExtractor

        public static AbstractPropertyExtractor getExtractor​(Object obj)
        Returns the first extractor for the specified object.
        Parameters:
        obj - the object to get an extractor for
        Returns:
        the extractor
      • getExtractor

        public static AbstractPropertyExtractor getExtractor​(Class cls)
        Returns the first extractor for the specified class.
        Parameters:
        cls - the class to get an extractor for
        Returns:
        the extractor
      • getExtractors

        public static List<AbstractPropertyExtractor> getExtractors​(Object obj)
        Returns all the extractors for the specified object.
        Parameters:
        obj - the object to get the extractors for
        Returns:
        the extractors
      • getExtractors

        public static List<AbstractPropertyExtractor> getExtractors​(Class cls)
        Returns all the extractors for the specified class.
        Parameters:
        cls - the class to get the extractors for
        Returns:
        the extractors
      • handles

        public abstract boolean handles​(Class cls)
        Checks whether this extractor actually handles this type of class.
        Parameters:
        cls - the class to check
        Returns:
        true if the extractor handles the object/class
      • setCurrent

        public void setCurrent​(Object value)
        Sets the current object to inspect.
        Parameters:
        value - the object to inspect
        See Also:
        initialize()
      • getCurrent

        public Object getCurrent()
        Returns the current object that is inspected.
        Returns:
        the current object
      • initialize

        protected void initialize()
        Initializes the extractor.

        Default implementation does nothing.
      • size

        public abstract int size()
        The number of properties that are available.
        Returns:
        the number of properties
      • hasValue

        public boolean hasValue​(int index)
        Checks whether the specified property has a value.
        Parameters:
        index - the index of the property to check
        Returns:
        true if a value exists
      • getValue

        public abstract Object getValue​(int index)
        Returns the current value of the specified property.
        Parameters:
        index - the index of the property to retrieve
        Returns:
        the current value of the property
      • getLabel

        public abstract String getLabel​(int index)
        Returns the label for the specified property.
        Parameters:
        index - the index of the property to get the label for
        Returns:
        the label for the property
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler