|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl
public class XMLSaveImpl
This implements the XML serializer, possibly using an XMLMap if one is provided as a save option.
Nested Class Summary | |
---|---|
protected static class |
XMLSaveImpl.Escape
|
protected static class |
XMLSaveImpl.Lookup
|
protected class |
XMLSaveImpl.XMLTypeInfoImpl
Forces type information (xsi:type/xmi:type) to be serialized for references in cases where the object's type is different from the feature's type. |
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.xmi.XMLSave |
---|
XMLSave.XMLTypeInfo |
Field Summary | |
---|---|
protected EClass |
anySimpleType
|
protected EClass |
anyType
|
protected static int |
ATTRIBUTE_FEATURE_MAP
|
protected static int |
CONTENT_ELEMENT
|
protected static int |
CROSS_DOC
|
protected org.w3c.dom.Node |
currentNode
|
protected static int |
DATATYPE_ATTRIBUTE_MANY
|
protected static int |
DATATYPE_CONTENT_SINGLE
|
protected static int |
DATATYPE_ELEMENT_SINGLE
|
protected static int |
DATATYPE_MANY
|
protected static int |
DATATYPE_SINGLE
|
protected static int |
DATATYPE_SINGLE_NILLABLE
|
protected boolean |
declareSchemaLocation
|
protected boolean |
declareSchemaLocationImplementation
|
protected boolean |
declareXML
|
protected boolean |
declareXSI
|
protected XMLString |
doc
|
protected org.w3c.dom.Document |
document
|
protected static int |
ELEMENT_FEATURE_MAP
|
protected XMLResource.ElementHandler |
elementHandler
|
protected static int |
EMPTY_ELEMENT
|
protected java.lang.String |
encoding
|
protected java.util.Map<EObject,AnyType> |
eObjectToExtensionMap
|
protected XMLSaveImpl.Escape |
escape
|
protected XMLSaveImpl.Escape |
escapeURI
|
protected ExtendedMetaData |
extendedMetaData
|
protected XMLSaveImpl.Lookup |
featureTable
|
protected int |
flushThreshold
|
protected DOMHandler |
handler
|
protected XMLHelper |
helper
|
protected java.lang.String |
idAttributeName
|
protected java.lang.String |
idAttributeNS
|
protected static int |
INDEX_LOOKUP
|
protected boolean |
keepDefaults
|
protected XMLResource.XMLMap |
map
|
protected NameInfo |
nameInfo
|
protected static int |
OBJECT_ATTRIBUTE_IDREF_MANY
|
protected static int |
OBJECT_ATTRIBUTE_IDREF_SINGLE
|
protected static int |
OBJECT_ATTRIBUTE_MANY
|
protected static int |
OBJECT_ATTRIBUTE_SINGLE
|
protected static int |
OBJECT_CONTAIN_MANY
|
protected static int |
OBJECT_CONTAIN_MANY_UNSETTABLE
|
protected static int |
OBJECT_CONTAIN_SINGLE
|
protected static int |
OBJECT_CONTAIN_SINGLE_UNSETTABLE
|
protected static int |
OBJECT_ELEMENT_IDREF_MANY
|
protected static int |
OBJECT_ELEMENT_IDREF_SINGLE
|
protected static int |
OBJECT_ELEMENT_IDREF_SINGLE_UNSETTABLE
|
protected static int |
OBJECT_ELEMENT_MANY
|
protected static int |
OBJECT_ELEMENT_SINGLE
|
protected static int |
OBJECT_ELEMENT_SINGLE_UNSETTABLE
|
protected static int |
OBJECT_HREF_MANY
|
protected static int |
OBJECT_HREF_MANY_UNSETTABLE
|
protected static int |
OBJECT_HREF_SINGLE
|
protected static int |
OBJECT_HREF_SINGLE_UNSETTABLE
|
protected java.lang.String |
processDanglingHREF
|
protected XMLResource.ResourceEntityHandler |
resourceEntityHandler
|
protected EObject |
root
|
protected java.util.List<? extends EObject> |
roots
|
protected static int |
SAME_DOC
|
protected boolean |
saveTypeInfo
|
protected static int |
SKIP
|
protected boolean |
toDOM
|
protected static int |
TRANSIENT
|
protected boolean |
useCache
|
protected boolean |
useEncodedAttributeStyle
|
protected static java.lang.String |
XML_VERSION
|
protected XMLResource |
xmlResource
|
protected EPackage |
xmlSchemaTypePackage
|
protected XMLSave.XMLTypeInfo |
xmlTypeInfo
|
protected java.lang.String |
xmlVersion
|
protected static java.lang.String |
XSI_NIL
|
protected static java.lang.String |
XSI_NO_NAMESPACE_SCHEMA_LOCATION
|
protected static java.lang.String |
XSI_SCHEMA_LOCATION
|
protected static java.lang.String |
XSI_TYPE_NS
|
protected static java.lang.String |
XSI_XMLNS
|
Constructor Summary | |
---|---|
XMLSaveImpl(java.util.Map<?,?> options,
XMLHelper helper,
java.lang.String encoding)
Constructor for XMLSave. |
|
XMLSaveImpl(java.util.Map<?,?> options,
XMLHelper helper,
java.lang.String encoding,
java.lang.String xmlVersion)
|
|
XMLSaveImpl(XMLHelper helper)
|
Method Summary | |
---|---|
protected void |
addDoctypeInformation()
|
protected void |
addNamespaceDeclarations()
|
protected java.lang.String |
convertURI(java.lang.String uri)
|
protected void |
endSave(java.util.List<? extends EObject> contents)
|
protected void |
endSaveFeatures(EObject o,
int elementType,
java.lang.String content)
|
protected java.lang.String |
getContent(EObject o,
EStructuralFeature[] features)
|
protected java.lang.String |
getDataTypeElementSingleSimple(EObject o,
EStructuralFeature f)
|
protected java.lang.String |
getDatatypeValue(java.lang.Object value,
EStructuralFeature f,
boolean isAttribute)
|
protected java.lang.String |
getElementIDRefManySimple(EObject o,
EStructuralFeature f)
|
protected java.lang.String |
getElementIDRefSingleSimple(EObject o,
EStructuralFeature f)
|
protected java.lang.String |
getElementReferenceManySimple(EObject o,
EStructuralFeature f)
|
protected java.lang.String |
getElementReferenceSingleSimple(EObject o,
EStructuralFeature f)
|
protected EObject |
getSchemaLocationRoot(EObject eObject)
|
protected void |
init(XMLResource resource,
java.util.Map<?,?> options)
|
boolean |
isDuplicateURI(java.lang.String nsURI)
|
protected boolean |
isEmpty(EObject o,
EStructuralFeature f)
|
protected boolean |
isNil(EObject o,
EStructuralFeature f)
|
protected void |
processAttributeExtensions(EObject object)
|
protected boolean |
processElementExtensions(EObject object)
Returns true if there were extensions for the specified object. |
protected int |
sameDocMany(EObject o,
EStructuralFeature f)
|
protected int |
sameDocSingle(EObject o,
EStructuralFeature f)
|
org.w3c.dom.Document |
save(XMLResource resource,
org.w3c.dom.Document doc,
java.util.Map<?,?> options,
DOMHandler handler)
|
void |
save(XMLResource resource,
java.io.OutputStream outputStream,
java.util.Map<?,?> options)
|
void |
save(XMLResource resource,
java.io.Writer writer,
java.util.Map<?,?> options)
Saves the resource to the writer using the specified options. |
protected void |
saveAttributeFeatureMap(EObject o,
EStructuralFeature f)
|
protected void |
saveContainedMany(EObject o,
EStructuralFeature f)
|
protected void |
saveContainedSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveDataTypeAttributeMany(EObject o,
EStructuralFeature f)
|
protected void |
saveDataTypeElementSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveDataTypeMany(EObject o,
EStructuralFeature f)
|
protected void |
saveDataTypeSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveElement(EObject o,
EStructuralFeature f)
|
protected void |
saveElement(EObject o,
java.lang.Object value,
EStructuralFeature f)
|
protected void |
saveElement(InternalEObject o,
EStructuralFeature f)
|
protected boolean |
saveElementFeatureMap(EObject o,
EStructuralFeature f)
|
protected void |
saveElementID(EObject o)
|
protected void |
saveElementIDRef(EObject o,
EObject target,
EStructuralFeature f)
|
protected void |
saveElementIDRef(EObject target,
EStructuralFeature f)
|
protected void |
saveElementIDRefMany(EObject o,
EStructuralFeature f)
|
protected void |
saveElementIDRefSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveElementReference(EObject remote,
EStructuralFeature f)
|
protected void |
saveElementReferenceMany(EObject o,
EStructuralFeature f)
|
protected void |
saveElementReferenceSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveEObjectMany(EObject o,
EStructuralFeature f)
|
protected void |
saveEObjectSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveFeatureMapElementReference(EObject o,
EReference f)
|
protected boolean |
saveFeatures(EObject o)
|
protected void |
saveHref(EObject remote,
EStructuralFeature f)
|
protected void |
saveHRefMany(EObject o,
EStructuralFeature f)
|
protected void |
saveHRefSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveIDRefMany(EObject o,
EStructuralFeature f)
|
protected void |
saveIDRefSingle(EObject o,
EStructuralFeature f)
|
protected void |
saveManyEmpty(EObject o,
EStructuralFeature f)
|
protected void |
saveManyEmpty(EStructuralFeature f)
|
protected void |
saveNil(EObject o,
EStructuralFeature f)
|
protected void |
saveNil(EStructuralFeature f)
|
protected void |
saveTypeAttribute(EClass eClass)
|
protected void |
saveTypeAttribute(EDataType eDataType)
|
protected boolean |
shouldSaveFeature(EObject o,
EStructuralFeature f)
|
char[] |
toChar()
|
void |
traverse(java.util.List<? extends EObject> contents)
|
void |
write(java.io.OutputStreamWriter os)
Deprecated. since 2.2 - instead use #write(Writer) |
void |
write(java.io.Writer os)
|
void |
writeAscii(java.io.OutputStream os)
|
protected void |
writeTopAttributes(EObject top)
|
protected boolean |
writeTopElements(EObject top)
|
protected java.lang.Object |
writeTopObject(EObject top)
|
protected java.lang.Object |
writeTopObjects(java.util.List<? extends EObject> contents)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int INDEX_LOOKUP
protected XMLHelper helper
protected XMLString doc
protected boolean declareXSI
protected boolean useEncodedAttributeStyle
protected boolean declareXML
protected boolean saveTypeInfo
protected XMLSave.XMLTypeInfo xmlTypeInfo
protected boolean keepDefaults
protected XMLSaveImpl.Escape escape
protected XMLSaveImpl.Escape escapeURI
protected XMLResource.ResourceEntityHandler resourceEntityHandler
protected XMLSaveImpl.Lookup featureTable
protected java.lang.String encoding
protected java.lang.String xmlVersion
protected java.lang.String idAttributeName
protected java.lang.String idAttributeNS
protected java.lang.String processDanglingHREF
protected boolean declareSchemaLocation
protected boolean declareSchemaLocationImplementation
protected XMLResource.XMLMap map
protected ExtendedMetaData extendedMetaData
protected EClass anySimpleType
protected EClass anyType
protected java.util.Map<EObject,AnyType> eObjectToExtensionMap
protected EPackage xmlSchemaTypePackage
protected int flushThreshold
protected boolean toDOM
protected DOMHandler handler
protected org.w3c.dom.Document document
protected org.w3c.dom.Node currentNode
protected NameInfo nameInfo
protected boolean useCache
protected EObject root
protected XMLResource xmlResource
protected java.util.List<? extends EObject> roots
protected XMLResource.ElementHandler elementHandler
protected static final int SKIP
protected static final int SAME_DOC
protected static final int CROSS_DOC
protected static final int TRANSIENT
protected static final int DATATYPE_SINGLE
protected static final int DATATYPE_ELEMENT_SINGLE
protected static final int DATATYPE_CONTENT_SINGLE
protected static final int DATATYPE_SINGLE_NILLABLE
protected static final int DATATYPE_MANY
protected static final int OBJECT_CONTAIN_SINGLE
protected static final int OBJECT_CONTAIN_MANY
protected static final int OBJECT_HREF_SINGLE
protected static final int OBJECT_HREF_MANY
protected static final int OBJECT_CONTAIN_SINGLE_UNSETTABLE
protected static final int OBJECT_CONTAIN_MANY_UNSETTABLE
protected static final int OBJECT_HREF_SINGLE_UNSETTABLE
protected static final int OBJECT_HREF_MANY_UNSETTABLE
protected static final int OBJECT_ELEMENT_SINGLE
protected static final int OBJECT_ELEMENT_SINGLE_UNSETTABLE
protected static final int OBJECT_ELEMENT_MANY
protected static final int OBJECT_ELEMENT_IDREF_SINGLE
protected static final int OBJECT_ELEMENT_IDREF_SINGLE_UNSETTABLE
protected static final int OBJECT_ELEMENT_IDREF_MANY
protected static final int ATTRIBUTE_FEATURE_MAP
protected static final int ELEMENT_FEATURE_MAP
protected static final int OBJECT_ATTRIBUTE_SINGLE
protected static final int OBJECT_ATTRIBUTE_MANY
protected static final int OBJECT_ATTRIBUTE_IDREF_SINGLE
protected static final int OBJECT_ATTRIBUTE_IDREF_MANY
protected static final int DATATYPE_ATTRIBUTE_MANY
protected static final java.lang.String XML_VERSION
protected static final java.lang.String XSI_NIL
protected static final java.lang.String XSI_TYPE_NS
protected static final java.lang.String XSI_XMLNS
protected static final java.lang.String XSI_SCHEMA_LOCATION
protected static final java.lang.String XSI_NO_NAMESPACE_SCHEMA_LOCATION
protected static final int EMPTY_ELEMENT
protected static final int CONTENT_ELEMENT
Constructor Detail |
---|
public XMLSaveImpl(XMLHelper helper)
public XMLSaveImpl(java.util.Map<?,?> options, XMLHelper helper, java.lang.String encoding)
options
- helper
- encoding
- public XMLSaveImpl(java.util.Map<?,?> options, XMLHelper helper, java.lang.String encoding, java.lang.String xmlVersion)
Method Detail |
---|
public org.w3c.dom.Document save(XMLResource resource, org.w3c.dom.Document doc, java.util.Map<?,?> options, DOMHandler handler)
save
in interface XMLSave
resource
- a resourcedoc
- a Document
(must not be null)options
- optionshandler
- a DOMHandler
(must not be null)
public void save(XMLResource resource, java.io.Writer writer, java.util.Map<?,?> options) throws java.io.IOException
XMLSave
save
in interface XMLSave
java.io.IOException
public void save(XMLResource resource, java.io.OutputStream outputStream, java.util.Map<?,?> options) throws java.io.IOException
save
in interface XMLSave
java.io.IOException
protected void endSave(java.util.List<? extends EObject> contents) throws java.io.IOException
java.io.IOException
protected void init(XMLResource resource, java.util.Map<?,?> options)
public void traverse(java.util.List<? extends EObject> contents)
protected void writeTopAttributes(EObject top)
protected boolean writeTopElements(EObject top)
protected java.lang.Object writeTopObject(EObject top)
protected java.lang.Object writeTopObjects(java.util.List<? extends EObject> contents)
protected void addNamespaceDeclarations()
protected void addDoctypeInformation()
protected EObject getSchemaLocationRoot(EObject eObject)
public boolean isDuplicateURI(java.lang.String nsURI)
@Deprecated public void write(java.io.OutputStreamWriter os) throws java.io.IOException
os
-
java.io.IOException
public void write(java.io.Writer os) throws java.io.IOException
java.io.IOException
public void writeAscii(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public char[] toChar()
protected void saveElement(InternalEObject o, EStructuralFeature f)
protected void saveElement(EObject o, EStructuralFeature f)
protected void saveTypeAttribute(EClass eClass)
protected void saveTypeAttribute(EDataType eDataType)
protected boolean shouldSaveFeature(EObject o, EStructuralFeature f)
protected boolean saveFeatures(EObject o)
protected void endSaveFeatures(EObject o, int elementType, java.lang.String content)
protected boolean processElementExtensions(EObject object)
protected void processAttributeExtensions(EObject object)
protected void saveDataTypeSingle(EObject o, EStructuralFeature f)
protected boolean isNil(EObject o, EStructuralFeature f)
protected boolean isEmpty(EObject o, EStructuralFeature f)
protected void saveNil(EObject o, EStructuralFeature f)
protected void saveNil(EStructuralFeature f)
protected void saveManyEmpty(EObject o, EStructuralFeature f)
protected void saveManyEmpty(EStructuralFeature f)
protected void saveDataTypeMany(EObject o, EStructuralFeature f)
protected void saveDataTypeAttributeMany(EObject o, EStructuralFeature f)
protected void saveEObjectSingle(EObject o, EStructuralFeature f)
protected void saveEObjectMany(EObject o, EStructuralFeature f)
protected void saveIDRefSingle(EObject o, EStructuralFeature f)
protected void saveIDRefMany(EObject o, EStructuralFeature f)
protected void saveElementReference(EObject remote, EStructuralFeature f)
protected void saveElementReferenceSingle(EObject o, EStructuralFeature f)
protected void saveElementReferenceMany(EObject o, EStructuralFeature f)
protected java.lang.String getElementReferenceSingleSimple(EObject o, EStructuralFeature f)
protected java.lang.String getElementReferenceManySimple(EObject o, EStructuralFeature f)
protected void saveElementIDRef(EObject o, EObject target, EStructuralFeature f)
protected void saveElementIDRef(EObject target, EStructuralFeature f)
protected void saveElementIDRefSingle(EObject o, EStructuralFeature f)
protected void saveElementIDRefMany(EObject o, EStructuralFeature f)
protected java.lang.String getElementIDRefSingleSimple(EObject o, EStructuralFeature f)
protected java.lang.String getElementIDRefManySimple(EObject o, EStructuralFeature f)
protected void saveHref(EObject remote, EStructuralFeature f)
protected void saveHRefSingle(EObject o, EStructuralFeature f)
protected void saveHRefMany(EObject o, EStructuralFeature f)
protected void saveContainedSingle(EObject o, EStructuralFeature f)
protected void saveContainedMany(EObject o, EStructuralFeature f)
protected void saveFeatureMapElementReference(EObject o, EReference f)
protected boolean saveElementFeatureMap(EObject o, EStructuralFeature f)
protected void saveAttributeFeatureMap(EObject o, EStructuralFeature f)
protected int sameDocSingle(EObject o, EStructuralFeature f)
protected int sameDocMany(EObject o, EStructuralFeature f)
protected java.lang.String getContent(EObject o, EStructuralFeature[] features)
protected void saveDataTypeElementSingle(EObject o, EStructuralFeature f)
protected java.lang.String getDataTypeElementSingleSimple(EObject o, EStructuralFeature f)
protected void saveElementID(EObject o)
protected java.lang.String getDatatypeValue(java.lang.Object value, EStructuralFeature f, boolean isAttribute)
protected void saveElement(EObject o, java.lang.Object value, EStructuralFeature f)
protected java.lang.String convertURI(java.lang.String uri)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |