Package org.simpleframework.xml.core
Class DetailExtractor
- java.lang.Object
-
- org.simpleframework.xml.core.DetailExtractor
-
class DetailExtractor extends java.lang.Object
TheDetailExtractor
object is used to extract details for a specific class. All details extracted are cached so that they can be reused when requested several times. This provides an increase in performance when there are large class hierarchies as annotations does not need to be scanned a second time.- See Also:
Detail
-
-
Field Summary
Fields Modifier and Type Field Description private Cache<Detail>
details
This contains a cache of the details scanned for classes.private Cache<ContactList>
fields
This is the cache of fields for specific classes scanned.private Cache<ContactList>
methods
This is the cache of methods for specific classes scanned.private DefaultType
override
This is an optional access type for the details created.private Support
support
This contains various support functions for the details.
-
Constructor Summary
Constructors Constructor Description DetailExtractor(Support support)
Constructor for theDetailExtractor
object.DetailExtractor(Support support, DefaultType override)
Constructor for theDetailExtractor
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Detail
getDetail(java.lang.Class type)
This is used to get aDetail
object describing a class and its annotations.ContactList
getFields(java.lang.Class type)
This is used to acquire a list ofContact
objects that represent the annotated fields in a type.private ContactList
getFields(java.lang.Class type, Detail detail)
This is used to acquire a list ofContact
objects that represent the annotated fields in a type.ContactList
getMethods(java.lang.Class type)
This is used to acquire a list ofContact
objects that represent the annotated methods in a type.private ContactList
getMethods(java.lang.Class type, Detail detail)
This is used to acquire a list ofContact
objects that represent the annotated methods in a type.
-
-
-
Field Detail
-
methods
private final Cache<ContactList> methods
This is the cache of methods for specific classes scanned.
-
fields
private final Cache<ContactList> fields
This is the cache of fields for specific classes scanned.
-
details
private final Cache<Detail> details
This contains a cache of the details scanned for classes.
-
override
private final DefaultType override
This is an optional access type for the details created.
-
support
private final Support support
This contains various support functions for the details.
-
-
Constructor Detail
-
DetailExtractor
public DetailExtractor(Support support)
Constructor for theDetailExtractor
object. This is used to extract various details for a class, such as the method and field details as well as the annotations used on the class. The primary purpose for this is to create cachable values that reduce the amount of reflection required.- Parameters:
support
- this contains various support functions
-
DetailExtractor
public DetailExtractor(Support support, DefaultType override)
Constructor for theDetailExtractor
object. This is used to extract various details for a class, such as the method and field details as well as the annotations used on the class. The primary purpose for this is to create cachable values that reduce the amount of reflection required.- Parameters:
support
- this contains various support functionsoverride
- this is the override used for details created
-
-
Method Detail
-
getDetail
public Detail getDetail(java.lang.Class type)
This is used to get aDetail
object describing a class and its annotations. Any detail retrieved from this will be cached to increase the performance of future accesses.- Parameters:
type
- this is the type to acquire the detail for- Returns:
- an object describing the type and its annotations
-
getFields
public ContactList getFields(java.lang.Class type) throws java.lang.Exception
This is used to acquire a list ofContact
objects that represent the annotated fields in a type. The entire class hierarchy is scanned for annotated fields. Caching of the contact list is done to increase performance.- Parameters:
type
- this is the type to scan for annotated fields- Returns:
- this returns a list of the annotated fields
- Throws:
java.lang.Exception
-
getFields
private ContactList getFields(java.lang.Class type, Detail detail) throws java.lang.Exception
This is used to acquire a list ofContact
objects that represent the annotated fields in a type. The entire class hierarchy is scanned for annotated fields. Caching of the contact list is done to increase performance.- Parameters:
detail
- this is the detail to scan for annotated fields- Returns:
- this returns a list of the annotated fields
- Throws:
java.lang.Exception
-
getMethods
public ContactList getMethods(java.lang.Class type) throws java.lang.Exception
This is used to acquire a list ofContact
objects that represent the annotated methods in a type. The entire class hierarchy is scanned for annotated methods. Caching of the contact list is done to increase performance.- Parameters:
type
- this is the type to scan for annotated methods- Returns:
- this returns a list of the annotated methods
- Throws:
java.lang.Exception
-
getMethods
private ContactList getMethods(java.lang.Class type, Detail detail) throws java.lang.Exception
This is used to acquire a list ofContact
objects that represent the annotated methods in a type. The entire class hierarchy is scanned for annotated methods. Caching of the contact list is done to increase performance.- Parameters:
type
- this is the type to scan for annotated methodsdetail
- this is the type to scan for annotated methods- Returns:
- this returns a list of the annotated methods
- Throws:
java.lang.Exception
-
-