net.sf.jsefa.xml.annotation
Class XmlTypeMappingFactory
java.lang.Object
net.sf.jsefa.common.annotation.TypeMappingFactory<QName,XmlTypeMappingRegistry>
net.sf.jsefa.xml.annotation.XmlTypeMappingFactory
public final class XmlTypeMappingFactory
- extends TypeMappingFactory<QName,XmlTypeMappingRegistry>
Factory for creating TypeMapping
s from annotated classes.
It is thread safe.
- Author:
- Norman Lahme-Huetig, Matthias Derer
Method Summary |
QName |
createIfAbsent(Class<?> objectType)
Creates a new TypeMapping for the given object type from its annotations if it is not already registered
in the type mapping registry given to the constructor of the class. |
protected QName |
getAnnotatedDataTypeName(Annotation annotation,
Class<?> annotationContextClass)
Returns the data type name as declared through the given annotation. |
Methods inherited from class net.sf.jsefa.common.annotation.TypeMappingFactory |
assertHasSimpleType, assertNoCollectionType, assertTypeMappingExists, assertTypeMappingIsSimple, createSimpleTypeConverter, getCollectionItemType, getMapKeyType, getMapValueType, getObjectAccessorProvider, getSimpleTypeConverterProvider, getTypeMappingRegistry, getValidatorFactory, getValidatorProvider, hasCollectionType, hasMapType, hasSimpleType, prepareToCreate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlTypeMappingFactory
public XmlTypeMappingFactory(XmlTypeMappingRegistry typeMappingRegistry,
SimpleTypeConverterProvider simpleTypeConverterProvider,
ValidatorProvider validatorProvider,
ObjectAccessorProvider objectAccessorProvider,
XmlDataTypeDefaultNameRegistry dataTypeDefaultNameRegistry)
- Constructs a new
XmlTypeMappingFactory
.
- Parameters:
typeMappingRegistry
- the type mapping registry. New types will be registered using that registry.simpleTypeConverterProvider
- the simple type converter provider to usevalidatorProvider
- the validator provider to useobjectAccessorProvider
- the object accessor provider to usedataTypeDefaultNameRegistry
- the data type default name registry to use
createIfAbsent
public QName createIfAbsent(Class<?> objectType)
- Creates a new
TypeMapping
for the given object type from its annotations if it is not already registered
in the type mapping registry given to the constructor of the class. The resulting type mapping will be registered
in the type mapping registry under the returned name.
Additional type mappings will be created and registered recursivly if necessary.
- Specified by:
createIfAbsent
in class TypeMappingFactory<QName,XmlTypeMappingRegistry>
- Parameters:
objectType
- the object type
- Returns:
- the name of the created type mapping. The type mapping itself can be retrieved using the type mapping
registry.
getAnnotatedDataTypeName
protected QName getAnnotatedDataTypeName(Annotation annotation,
Class<?> annotationContextClass)
- Returns the data type name as declared through the given annotation.
- Specified by:
getAnnotatedDataTypeName
in class TypeMappingFactory<QName,XmlTypeMappingRegistry>
- Parameters:
annotation
- the annotationannotationContextClass
- the context class of the annotation. This class may be needed to interpret the
annotation data.
- Returns:
- a data type name
Copyright © 2014. All rights reserved.