public abstract class AbstractXOPType extends AegisType
Modifier and Type | Field and Description |
---|---|
static String |
XML_MIME_ATTR_LOCAL_NAME |
static QName |
XML_MIME_BASE64 |
static QName |
XML_MIME_CONTENT_TYPE |
static String |
XML_MIME_NS |
static QName |
XOP_HREF |
static QName |
XOP_INCLUDE |
static String |
XOP_NS |
Constructor and Description |
---|
AbstractXOPType(boolean useXmimeBinaryType,
String expectedContentTypes)
Create an XOP type.
|
Modifier and Type | Method and Description |
---|---|
void |
addToSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement schemaElement)
If the type object merely wants to contribute attributes to the
xsd:element element, it can implement this.
|
protected abstract Attachment |
createAttachment(Object object,
String id) |
protected abstract byte[] |
getBytes(Object object)
if MtoM is not enabled, we need bytes to turn into base64.
|
protected abstract String |
getContentType(Object object,
Context context) |
protected abstract Object |
readAttachment(Attachment att,
Context context) |
Object |
readMtoM(MessageReader reader,
Context context)
This is called from base64Type when it recognizes an XOP attachment.
|
Object |
readObject(MessageReader reader,
Context context)
This defers to the plain base64 type, which calls back into here above for XOP.
|
boolean |
usesXmime() |
protected abstract Object |
wrapBytes(byte[] bareBytes,
String contentType)
If one of these types arrives unoptimized, we need to convert it to the
desired return type.
|
void |
writeObject(Object object,
MessageWriter writer,
Context context)
Writes the object to the MessageWriter.
|
equals, getDependencies, getMaxOccurs, getMinOccurs, getSchemaType, getType, getTypeClass, getTypeMapping, hashCode, hasMaxOccurs, hasMinOccurs, isAbstract, isComplex, isFlatArray, isNillable, isWriteOuter, setAbstract, setFlatArray, setNillable, setSchemaType, setTypeClass, setTypeMapping, setWriteOuter, toString, usesUtilityTypes, writeSchema
public static final String XOP_NS
public static final String XML_MIME_NS
public static final String XML_MIME_ATTR_LOCAL_NAME
public static final QName XOP_INCLUDE
public static final QName XML_MIME_CONTENT_TYPE
public static final QName XOP_HREF
public static final QName XML_MIME_BASE64
public AbstractXOPType(boolean useXmimeBinaryType, String expectedContentTypes)
useXmimeBinaryType
- whether to use xmime:base64Binary.expectedContentTypes
- whether to public xmime:expectedContentTypes.public Object readMtoM(MessageReader reader, Context context) throws DatabindingException
reader
- context
- DatabindingException
public Object readObject(MessageReader reader, Context context) throws DatabindingException
readObject
in class AegisType
DatabindingException
protected abstract Object readAttachment(Attachment att, Context context) throws IOException
IOException
public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException
AegisType
writeObject
in class AegisType
DatabindingException
protected abstract Attachment createAttachment(Object object, String id)
protected abstract Object wrapBytes(byte[] bareBytes, String contentType)
bareBytes
- the bytes pulled out of the base64.contentType
- when we support xmime:contentType, this will be passed along.protected abstract byte[] getBytes(Object object)
public void addToSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement schemaElement)
AegisType
addToSchemaElement
in class AegisType
Apache CXF