Class ObjectContextExtractor


  • public final class ObjectContextExtractor
    extends java.lang.Object
    Extracts context information from object instances and creates appropriate enclosing ContextElement instances.
    • Constructor Detail

      • ObjectContextExtractor

        private ObjectContextExtractor()
    • Method Detail

      • extract

        public static ContextElement extract​(java.lang.Object from)
        Returns a ContextElement instance for the supplied object.

        The supplied object's class type is parsed for ContextAttribute annotations and the associated attributes are extracted and returned in the form of a ContextElement.

        Parameters:
        from - object to extract context for
        Returns:
        a ContextElement
      • extractInstanceAttribute

        private static java.util.Map<? extends java.lang.String,​? extends AttributeGetter<java.lang.Object>> extractInstanceAttribute​(java.lang.Object from)
      • extractMethodAttributes

        private static java.util.Map<java.lang.String,​AttributeGetter<java.lang.Object>> extractMethodAttributes​(java.lang.Object from)
      • extractFieldAttributes

        private static java.util.Map<java.lang.String,​AttributeGetter<java.lang.Object>> extractFieldAttributes​(java.lang.Object from)
      • createFieldAttributeGetter

        private static AttributeGetter<java.lang.Object> createFieldAttributeGetter​(java.lang.Object from,
                                                                                    java.lang.reflect.Field f)