Package org.terracotta.context.extractor
Class ObjectContextExtractor
- java.lang.Object
-
- org.terracotta.context.extractor.ObjectContextExtractor
-
public final class ObjectContextExtractor extends java.lang.ObjectExtracts context information from object instances and creates appropriate enclosingContextElementinstances.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateObjectContextExtractor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static AttributeGetter<java.lang.Object>createFieldAttributeGetter(java.lang.Object from, java.lang.reflect.Field f)static ContextElementextract(java.lang.Object from)Returns aContextElementinstance for the supplied object.private static java.util.Map<java.lang.String,AttributeGetter<java.lang.Object>>extractFieldAttributes(java.lang.Object from)private static java.util.Map<? extends java.lang.String,? extends AttributeGetter<java.lang.Object>>extractInstanceAttribute(java.lang.Object from)private static java.util.Map<java.lang.String,AttributeGetter<java.lang.Object>>extractMethodAttributes(java.lang.Object from)
-
-
-
Method Detail
-
extract
public static ContextElement extract(java.lang.Object from)
Returns aContextElementinstance for the supplied object.The supplied object's class type is parsed for
ContextAttributeannotations and the associated attributes are extracted and returned in the form of aContextElement.- 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)
-
-