Package org.simpleframework.xml.core
Class ExtractorFactory
java.lang.Object
org.simpleframework.xml.core.ExtractorFactory
The
ExtractorFactory
is used to create an extractor
object that can be used to build a label for each annotation in
the union group. In order to build an extractor the factory
requires the Contact
and the union annotation.
Each extractor created by this factory can be used to extract
the constituent parts of each label defined in the union.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
TheElementExtractor
object is used extract the constituent parts of the provided union annotation.private static class
TheElementListExtractor
object is used extract the constituent parts of the provided union annotation.private static class
TheElementListExtractor
object is used extract the constituent parts of the provided union annotation.private static class
TheExtractorBuilder
object is used to instantiate an extractor based an a particular union annotation. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExtractorFactory
(Contact contact, Annotation label, Format format) Constructor for theExtractorFactory
object. -
Method Summary
Modifier and TypeMethodDescriptiongetBuilder
(Annotation label) This returns a builder used to instantiate an extractor based on a particular union annotation.This is used to instantiate anExtractor
based on the union annotation provided.private Object
getInstance
(Annotation label) This is used to instantiate anExtractor
based on the union annotation provided.
-
Field Details
-
label
This is the union annotation this creates extractors for. -
contact
This is the contact that has been annotated as a union. -
format
The format used for each of the extractors instantiated.
-
-
Constructor Details
-
ExtractorFactory
Constructor for theExtractorFactory
object. This requires the contact that was annotated as a union and the actual union annotation, which is used to build individual labels based on the declarations.- Parameters:
contact
- this is the field or method annotatedlabel
- this is the union annotation to extract fromformat
- this is the format used by the extractors
-
-
Method Details
-
getInstance
This is used to instantiate anExtractor
based on the union annotation provided. Each extractor provides a uniform interface to the constituent parts of the union.- Returns:
- this returns an extractor for the union
- Throws:
Exception
-
getInstance
This is used to instantiate anExtractor
based on the union annotation provided. Each extractor provides a uniform interface to the constituent parts of the union.- Parameters:
label
- this is the union annotation to be used- Returns:
- this returns an extractor for the union
- Throws:
Exception
-
getBuilder
This returns a builder used to instantiate an extractor based on a particular union annotation. If the annotation provided does not represent a valid union an exception is thrown.- Parameters:
label
- this is the union annotation to build for- Returns:
- this returns a builder used to create an extractor
- Throws:
Exception
-