Top Description Constructors Methods
org.terracotta.context.extractor

public final Class ObjectContextExtractor

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, .Method, .Modifier, java.util.Collections, .HashMap, .Map, org.terracotta.context.ContextElement, org.terracotta.context.annotations.ContextAttribute

Extracts context information from object instances and creates appropriate enclosing ContextElement instances.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static AttributeGetter<Object>
public static ContextElement

Returns:

a ContextElement
extract
(Object
object to extract context for
from
)

Returns a ContextElement instance for the supplied object.

private static Map<String, AttributeGetter<Object>>
private static Map<? extends String, ? extends AttributeGetter<Object>>
private static Map<String, AttributeGetter<Object>>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ObjectContextExtractorback to summary
private ObjectContextExtractor()

Method Detail

createFieldAttributeGetterback to summary
private static AttributeGetter<Object> createFieldAttributeGetter(Object from, Field f)
extractback to summary
public static ContextElement extract(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

object to extract context for

Returns:ContextElement

a ContextElement

extractFieldAttributesback to summary
private static Map<String, AttributeGetter<Object>> extractFieldAttributes(Object from)
extractInstanceAttributeback to summary
private static Map<? extends String, ? extends AttributeGetter<Object>> extractInstanceAttribute(Object from)
extractMethodAttributesback to summary
private static Map<String, AttributeGetter<Object>> extractMethodAttributes(Object from)