|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cxf.aegis.AegisContext
public class AegisContext
The Aegis Databinding context object. This object coordinates the data binding process: reading and writing XML. By default, this object sets up a default set of type mappings. This consists of two DefaultTypeMapping objects. The first is empty and has the Default, Java5, and XML TypeCreator classes configured. The second contains the standard mappings of the stock types. If a type can't be mapped in either, then the creators create a mapping and store it in the first one. The application can control some parameters of the type creators by creating a TypeCreationOptions object and setting properties. The application can add custom mappings to the type mapping, or even use its own classes for the TypeMapping or TypeCreator objects. Aegis, unlike JAXB, has no concept of a 'root element'. So, an application that uses Aegis without a web service has to either depend on xsi:type (at least for root elements) or have its own mapping from elements to classes, and pass the resulting Class objects to the readers. At this level, the application must specify the initial set of classes to make make use of untyped collections or .aegis.xml files. If the application leaves this list empty, and reads XML messages, then no .aegis.xml files are used unless the application has specified a Class<T> for the root of a particular item read. Specifically, if the application just leaves it to Aegis to map an element tagged with an xsi:type to a class, Aegis can't know that some arbitrary class in some arbitrary package is mapped to a particular schema type by QName in a mapping XML file. At the level of the CXF data binding, the 'root elements' are defined by the WSDL message parts. Additional classes that participate are termed 'override' classes.
Field Summary | |
---|---|
static java.lang.String |
SCHEMA_NS
Namespace used for miscellaneous Aegis types. |
Constructor Summary | |
---|---|
AegisContext()
Construct a context. |
Method Summary | |
---|---|
static void |
addUtilityTypesToSchema(org.jdom.Element root)
|
protected AbstractTypeCreator |
createDefaultTypeCreator()
|
AegisReader<org.w3c.dom.Element> |
createDomElementReader()
|
AegisWriter<org.w3c.dom.Element> |
createDomElementWriter()
|
protected AbstractTypeCreator |
createRootTypeCreator()
|
TypeCreator |
createTypeCreator()
|
AegisReader<javax.xml.stream.XMLStreamReader> |
createXMLStreamReader()
|
AegisWriter<javax.xml.stream.XMLStreamWriter> |
createXMLStreamWriter()
|
java.util.Map<java.lang.Class<?>,java.lang.String> |
getBeanImplementationMap()
This property provides support for interfaces. |
TypeCreationOptions |
getConfiguration()
Deprecated. 2.1 |
java.lang.String |
getMappingNamespaceURI()
What URI identifies the type mapping for this context? When the XMLTypeCreator reads .aegis.xml file, it will only read mappings for this URI (or no URI). |
java.util.Set<java.lang.Class<?>> |
getRootClasses()
|
java.util.Set<java.lang.String> |
getRootClassNames()
Retrieve the set of root class names. |
Type |
getRootType(java.lang.Class clazz)
If a class was provided as part of the 'root' list, retrieve it's Type by Class. |
Type |
getRootType(javax.xml.namespace.QName schemaTypeName)
If a class was provided as part of the root list, retrieve it's Type by schema type QName. |
java.util.Set<Type> |
getRootTypes()
Retrieve the Aegis type objects for the root classes. |
TypeCreationOptions |
getTypeCreationOptions()
Return the type mapping configuration associated with this context. |
TypeMapping |
getTypeMapping()
Return the type mapping object used by this context. |
org.w3c.dom.Document |
getTypesSchemaDocument()
|
void |
initialize()
Initialize the context. |
boolean |
isMtomEnabled()
Is MTOM enabled in this context? |
boolean |
isMtomUseXmime()
Should this service use schema for MTOM types xmime:base64Binary instead of xsd:base64Binary? |
boolean |
isReadXsiTypes()
|
boolean |
isWriteXsiTypes()
|
static boolean |
schemaImportsUtilityTypes(org.jdom.Element schemaElement)
|
void |
setBeanImplementationMap(java.util.Map<java.lang.Class<?>,java.lang.String> beanImplementationMap)
|
void |
setConfiguration(TypeCreationOptions newConfiguration)
Deprecated. 2.1 |
void |
setMappingNamespaceURI(java.lang.String mappingNamespaceURI)
|
void |
setMtomEnabled(boolean mtomEnabled)
|
void |
setMtomUseXmime(boolean mtomUseXmime)
|
void |
setReadXsiTypes(boolean flag)
Controls the use of xsi:type attributes when reading objects. |
void |
setRootClasses(java.util.Set<java.lang.Class<?>> rootClasses)
The list of initial classes. |
void |
setRootClassNames(java.util.Set<java.lang.String> classNames)
Set the root class names. |
void |
setTypeCreationOptions(TypeCreationOptions newConfiguration)
Set the configuration object. |
void |
setTypeMapping(TypeMapping typeMapping)
Set the type mapping object used by this context. |
void |
setWriteXsiTypes(boolean flag)
Controls whether Aegis writes xsi:type attributes on all elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SCHEMA_NS
Constructor Detail |
---|
public AegisContext()
Method Detail |
---|
public TypeCreator createTypeCreator()
protected AbstractTypeCreator createRootTypeCreator()
protected AbstractTypeCreator createDefaultTypeCreator()
public void initialize()
mappingNamespaceURI
- URI to select mappings based on the encoding.public AegisReader<org.w3c.dom.Element> createDomElementReader()
public AegisReader<javax.xml.stream.XMLStreamReader> createXMLStreamReader()
public AegisWriter<org.w3c.dom.Element> createDomElementWriter()
public AegisWriter<javax.xml.stream.XMLStreamWriter> createXMLStreamWriter()
public Type getRootType(java.lang.Class clazz)
clazz
-
public Type getRootType(javax.xml.namespace.QName schemaTypeName)
schemaTypeName
-
public static boolean schemaImportsUtilityTypes(org.jdom.Element schemaElement)
public org.w3c.dom.Document getTypesSchemaDocument()
public static void addUtilityTypesToSchema(org.jdom.Element root)
public java.util.Set<java.lang.String> getRootClassNames()
public void setRootClassNames(java.util.Set<java.lang.String> classNames)
setRootClasses(Set)
.
classNames
- public TypeCreationOptions getConfiguration()
public TypeCreationOptions getTypeCreationOptions()
public void setConfiguration(TypeCreationOptions newConfiguration)
configuration
- The configuration to set.public void setTypeCreationOptions(TypeCreationOptions newConfiguration)
configuration
- The configuration to set.public boolean isWriteXsiTypes()
public boolean isReadXsiTypes()
public void setWriteXsiTypes(boolean flag)
flag
- public void setReadXsiTypes(boolean flag)
flag
- public TypeMapping getTypeMapping()
public void setTypeMapping(TypeMapping typeMapping)
typeMapping
- public java.util.Set<Type> getRootTypes()
public java.util.Map<java.lang.Class<?>,java.lang.String> getBeanImplementationMap()
BeanType
public void setBeanImplementationMap(java.util.Map<java.lang.Class<?>,java.lang.String> beanImplementationMap)
public java.util.Set<java.lang.Class<?>> getRootClasses()
public void setRootClasses(java.util.Set<java.lang.Class<?>> rootClasses)
rootClasses
- public boolean isMtomEnabled()
public void setMtomEnabled(boolean mtomEnabled)
public boolean isMtomUseXmime()
public void setMtomUseXmime(boolean mtomUseXmime)
public java.lang.String getMappingNamespaceURI()
public void setMappingNamespaceURI(java.lang.String mappingNamespaceURI)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |