|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 String |
UTILITY_TYPES_SCHEMA_NS
Namespace used for the miscellaneous Aegis type schema. |
Constructor Summary | |
---|---|
AegisContext()
Construct a context. |
Method Summary | |
---|---|
org.apache.ws.commons.schema.XmlSchema |
addTypesSchemaDocument(org.apache.ws.commons.schema.XmlSchemaCollection collection)
|
static void |
addUtilityTypesToSchema(org.apache.ws.commons.schema.XmlSchema root)
|
org.apache.ws.commons.schema.XmlSchema |
addXmimeSchemaDocument(org.apache.ws.commons.schema.XmlSchemaCollection collection)
|
protected AbstractTypeCreator |
createDefaultTypeCreator()
|
AegisReader<Element> |
createDomElementReader()
|
AegisWriter<Element> |
createDomElementWriter()
|
protected AbstractTypeCreator |
createRootTypeCreator()
|
TypeCreator |
createTypeCreator()
|
AegisReader<javax.xml.stream.XMLStreamReader> |
createXMLStreamReader()
|
AegisWriter<javax.xml.stream.XMLStreamWriter> |
createXMLStreamWriter()
|
Map<Class<?>,String> |
getBeanImplementationMap()
This property provides support for interfaces. |
TypeCreationOptions |
getConfiguration()
Deprecated. 2.1 |
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). |
Set<Type> |
getRootClasses()
|
Set<String> |
getRootClassNames()
Retrieve the set of root class names. |
AegisType |
getRootType(Class clazz)
If a class was provided as part of the 'root' list, retrieve it's AegisType by Class. |
AegisType |
getRootType(QName schemaTypeName)
If a class was provided as part of the root list, retrieve it's AegisType by schema type QName. |
Set<AegisType> |
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. |
void |
initialize()
Initialize the context. |
boolean |
isEnableJDOMMappings()
|
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.apache.ws.commons.schema.XmlSchema schema)
|
void |
setBeanImplementationMap(Map<Class<?>,String> beanImplementationMap)
|
void |
setConfiguration(TypeCreationOptions newConfiguration)
Deprecated. 2.1 |
void |
setEnableJDOMMappings(boolean enableJDOMMappings)
Whether to enable JDOM as a mapping for xsd:anyType if JDOM is in the classpath. |
void |
setMappingNamespaceURI(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(Set<Type> rootClasses)
The list of initial classes. |
void |
setRootClassNames(Set<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 String UTILITY_TYPES_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<Element> createDomElementReader()
public AegisReader<javax.xml.stream.XMLStreamReader> createXMLStreamReader()
public AegisWriter<Element> createDomElementWriter()
public AegisWriter<javax.xml.stream.XMLStreamWriter> createXMLStreamWriter()
public AegisType getRootType(Class clazz)
clazz
-
public AegisType getRootType(QName schemaTypeName)
schemaTypeName
-
public static boolean schemaImportsUtilityTypes(org.apache.ws.commons.schema.XmlSchema schema)
public org.apache.ws.commons.schema.XmlSchema addTypesSchemaDocument(org.apache.ws.commons.schema.XmlSchemaCollection collection)
public org.apache.ws.commons.schema.XmlSchema addXmimeSchemaDocument(org.apache.ws.commons.schema.XmlSchemaCollection collection)
public static void addUtilityTypesToSchema(org.apache.ws.commons.schema.XmlSchema root)
public Set<String> getRootClassNames()
public void setRootClassNames(Set<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 Set<AegisType> getRootTypes()
public Map<Class<?>,String> getBeanImplementationMap()
BeanType
public void setBeanImplementationMap(Map<Class<?>,String> beanImplementationMap)
public Set<Type> getRootClasses()
public void setRootClasses(Set<Type> rootClasses)
rootClasses
- public boolean isMtomEnabled()
public void setMtomEnabled(boolean mtomEnabled)
public boolean isMtomUseXmime()
public void setMtomUseXmime(boolean mtomUseXmime)
public String getMappingNamespaceURI()
public void setMappingNamespaceURI(String mappingNamespaceURI)
public boolean isEnableJDOMMappings()
public void setEnableJDOMMappings(boolean enableJDOMMappings)
enableJDOMMappings
-
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |