org.eclipse.emf.ecore.xmi.impl
Class XMLSaveImpl
java.lang.Object
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl
- All Implemented Interfaces:
- XMLSave
- Direct Known Subclasses:
- XMISaveImpl
- public class XMLSaveImpl
- extends Object
- implements XMLSave
This implements the XML serializer, possibly using an XMLMap
if one is provided as a save option.
Method Summary |
protected void |
addNamespaceDeclarations()
|
protected void |
endSaveFeatures(EObject o,
int elementType,
String content)
|
protected String |
getContent(EObject o,
EStructuralFeature[] features)
|
protected String |
getDataTypeElementSingleSimple(EObject o,
EStructuralFeature f)
|
protected String |
getElementIDRefManySimple(EObject o,
EStructuralFeature f)
|
protected String |
getElementIDRefSingleSimple(EObject o,
EStructuralFeature f)
|
protected String |
getElementReferenceManySimple(EObject o,
EStructuralFeature f)
|
protected String |
getElementReferenceSingleSimple(EObject o,
EStructuralFeature f)
|
protected void |
init(XMLResource resource,
Map options)
|
boolean |
isDuplicateURI(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)
|
void |
save(XMLResource resource,
OutputStream outputStream,
Map options)
|
protected void |
saveAttributeFeatureMap(EObject o,
EStructuralFeature f)
|
protected void |
saveContainedMany(EObject o,
EStructuralFeature f)
|
protected void |
saveContainedSingle(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 boolean |
saveElementFeatureMap(EObject o,
EStructuralFeature f)
|
protected void |
saveElementID(EObject o)
|
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 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(EStructuralFeature f)
|
protected void |
saveNil(EStructuralFeature f)
|
protected void |
saveTypeAttribute(EClass eClass)
|
protected void |
saveTypeAttribute(EDataType eDataType)
|
char[] |
toChar()
|
void |
traverse(List contents)
|
void |
write(OutputStreamWriter os)
|
void |
writeAscii(OutputStream os)
|
protected Object |
writeTopObject(EObject top)
|
protected Object |
writeTopObjects(List contents)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
helper
protected XMLHelper helper
doc
protected XMLString doc
declareXSI
protected boolean declareXSI
useEncodedAttributeStyle
protected boolean useEncodedAttributeStyle
declareXML
protected boolean declareXML
saveTypeInfo
protected boolean saveTypeInfo
escape
protected XMLSaveImpl.Escape escape
featureTable
protected XMLSaveImpl.Lookup featureTable
encoding
protected String encoding
idAttributeName
protected String idAttributeName
processDanglingHREF
protected String processDanglingHREF
declareSchemaLocation
protected boolean declareSchemaLocation
declareSchemaLocationImplementation
protected boolean declareSchemaLocationImplementation
map
protected XMLResource.XMLMap map
extendedMetaData
protected ExtendedMetaData extendedMetaData
anySimpleType
protected EClass anySimpleType
anyType
protected EClass anyType
eObjectToExtensionMap
protected Map eObjectToExtensionMap
xmlSchemaTypePackage
protected EPackage xmlSchemaTypePackage
flushThreshold
protected int flushThreshold
SKIP
protected static final int SKIP
- See Also:
- Constant Field Values
SAME_DOC
protected static final int SAME_DOC
- See Also:
- Constant Field Values
CROSS_DOC
protected static final int CROSS_DOC
- See Also:
- Constant Field Values
TRANSIENT
protected static final int TRANSIENT
- See Also:
- Constant Field Values
DATATYPE_SINGLE
protected static final int DATATYPE_SINGLE
- See Also:
- Constant Field Values
DATATYPE_ELEMENT_SINGLE
protected static final int DATATYPE_ELEMENT_SINGLE
- See Also:
- Constant Field Values
DATATYPE_CONTENT_SINGLE
protected static final int DATATYPE_CONTENT_SINGLE
- See Also:
- Constant Field Values
DATATYPE_SINGLE_NILLABLE
protected static final int DATATYPE_SINGLE_NILLABLE
- See Also:
- Constant Field Values
DATATYPE_MANY
protected static final int DATATYPE_MANY
- See Also:
- Constant Field Values
OBJECT_CONTAIN_SINGLE
protected static final int OBJECT_CONTAIN_SINGLE
- See Also:
- Constant Field Values
OBJECT_CONTAIN_MANY
protected static final int OBJECT_CONTAIN_MANY
- See Also:
- Constant Field Values
OBJECT_HREF_SINGLE
protected static final int OBJECT_HREF_SINGLE
- See Also:
- Constant Field Values
OBJECT_HREF_MANY
protected static final int OBJECT_HREF_MANY
- See Also:
- Constant Field Values
OBJECT_CONTAIN_SINGLE_UNSETTABLE
protected static final int OBJECT_CONTAIN_SINGLE_UNSETTABLE
- See Also:
- Constant Field Values
OBJECT_CONTAIN_MANY_UNSETTABLE
protected static final int OBJECT_CONTAIN_MANY_UNSETTABLE
- See Also:
- Constant Field Values
OBJECT_HREF_SINGLE_UNSETTABLE
protected static final int OBJECT_HREF_SINGLE_UNSETTABLE
- See Also:
- Constant Field Values
OBJECT_HREF_MANY_UNSETTABLE
protected static final int OBJECT_HREF_MANY_UNSETTABLE
- See Also:
- Constant Field Values
OBJECT_ELEMENT_SINGLE
protected static final int OBJECT_ELEMENT_SINGLE
- See Also:
- Constant Field Values
OBJECT_ELEMENT_SINGLE_UNSETTABLE
protected static final int OBJECT_ELEMENT_SINGLE_UNSETTABLE
- See Also:
- Constant Field Values
OBJECT_ELEMENT_MANY
protected static final int OBJECT_ELEMENT_MANY
- See Also:
- Constant Field Values
OBJECT_ELEMENT_IDREF_SINGLE
protected static final int OBJECT_ELEMENT_IDREF_SINGLE
- See Also:
- Constant Field Values
OBJECT_ELEMENT_IDREF_SINGLE_UNSETTABLE
protected static final int OBJECT_ELEMENT_IDREF_SINGLE_UNSETTABLE
- See Also:
- Constant Field Values
OBJECT_ELEMENT_IDREF_MANY
protected static final int OBJECT_ELEMENT_IDREF_MANY
- See Also:
- Constant Field Values
ATTRIBUTE_FEATURE_MAP
protected static final int ATTRIBUTE_FEATURE_MAP
- See Also:
- Constant Field Values
ELEMENT_FEATURE_MAP
protected static final int ELEMENT_FEATURE_MAP
- See Also:
- Constant Field Values
XML_VERSION
protected static final String XML_VERSION
- See Also:
- Constant Field Values
XSI_NIL
protected static final String XSI_NIL
- See Also:
- Constant Field Values
XSI_TYPE_NS
protected static final String XSI_TYPE_NS
- See Also:
- Constant Field Values
XSI_XMLNS
protected static final String XSI_XMLNS
- See Also:
- Constant Field Values
XSI_SCHEMA_LOCATION
protected static final String XSI_SCHEMA_LOCATION
- See Also:
- Constant Field Values
XSI_NO_NAMESPACE_SCHEMA_LOCATION
protected static final String XSI_NO_NAMESPACE_SCHEMA_LOCATION
- See Also:
- Constant Field Values
EMPTY_ELEMENT
protected static final int EMPTY_ELEMENT
- See Also:
- Constant Field Values
CONTENT_ELEMENT
protected static final int CONTENT_ELEMENT
- See Also:
- Constant Field Values
XMLSaveImpl
public XMLSaveImpl(XMLHelper helper)
XMLSaveImpl
public XMLSaveImpl(Map options,
XMLHelper helper,
String encoding)
- Constructor for XMLSave.
- Parameters:
options
- helper
- encoding
-
save
public void save(XMLResource resource,
OutputStream outputStream,
Map options)
throws IOException
- Specified by:
save
in interface XMLSave
- Throws:
IOException
init
protected void init(XMLResource resource,
Map options)
traverse
public void traverse(List contents)
writeTopObject
protected Object writeTopObject(EObject top)
writeTopObjects
protected Object writeTopObjects(List contents)
addNamespaceDeclarations
protected void addNamespaceDeclarations()
isDuplicateURI
public boolean isDuplicateURI(String nsURI)
write
public void write(OutputStreamWriter os)
throws IOException
- Throws:
IOException
writeAscii
public void writeAscii(OutputStream os)
throws IOException
- Throws:
IOException
toChar
public char[] toChar()
saveElement
protected void saveElement(EObject o,
EStructuralFeature f)
saveTypeAttribute
protected void saveTypeAttribute(EClass eClass)
saveTypeAttribute
protected void saveTypeAttribute(EDataType eDataType)
saveFeatures
protected boolean saveFeatures(EObject o)
endSaveFeatures
protected void endSaveFeatures(EObject o,
int elementType,
String content)
processElementExtensions
protected boolean processElementExtensions(EObject object)
- Returns true if there were extensions for the specified object.
processAttributeExtensions
protected void processAttributeExtensions(EObject object)
saveDataTypeSingle
protected void saveDataTypeSingle(EObject o,
EStructuralFeature f)
isNil
protected boolean isNil(EObject o,
EStructuralFeature f)
isEmpty
protected boolean isEmpty(EObject o,
EStructuralFeature f)
saveNil
protected void saveNil(EStructuralFeature f)
saveManyEmpty
protected void saveManyEmpty(EStructuralFeature f)
saveDataTypeMany
protected void saveDataTypeMany(EObject o,
EStructuralFeature f)
saveEObjectSingle
protected void saveEObjectSingle(EObject o,
EStructuralFeature f)
saveEObjectMany
protected void saveEObjectMany(EObject o,
EStructuralFeature f)
saveIDRefSingle
protected void saveIDRefSingle(EObject o,
EStructuralFeature f)
saveIDRefMany
protected void saveIDRefMany(EObject o,
EStructuralFeature f)
saveElementReference
protected void saveElementReference(EObject remote,
EStructuralFeature f)
saveElementReferenceSingle
protected void saveElementReferenceSingle(EObject o,
EStructuralFeature f)
saveElementReferenceMany
protected void saveElementReferenceMany(EObject o,
EStructuralFeature f)
getElementReferenceSingleSimple
protected String getElementReferenceSingleSimple(EObject o,
EStructuralFeature f)
getElementReferenceManySimple
protected String getElementReferenceManySimple(EObject o,
EStructuralFeature f)
saveElementIDRef
protected void saveElementIDRef(EObject target,
EStructuralFeature f)
saveElementIDRefSingle
protected void saveElementIDRefSingle(EObject o,
EStructuralFeature f)
saveElementIDRefMany
protected void saveElementIDRefMany(EObject o,
EStructuralFeature f)
getElementIDRefSingleSimple
protected String getElementIDRefSingleSimple(EObject o,
EStructuralFeature f)
getElementIDRefManySimple
protected String getElementIDRefManySimple(EObject o,
EStructuralFeature f)
saveHref
protected void saveHref(EObject remote,
EStructuralFeature f)
saveHRefSingle
protected void saveHRefSingle(EObject o,
EStructuralFeature f)
saveHRefMany
protected void saveHRefMany(EObject o,
EStructuralFeature f)
saveContainedSingle
protected void saveContainedSingle(EObject o,
EStructuralFeature f)
saveContainedMany
protected void saveContainedMany(EObject o,
EStructuralFeature f)
saveElementFeatureMap
protected boolean saveElementFeatureMap(EObject o,
EStructuralFeature f)
saveAttributeFeatureMap
protected void saveAttributeFeatureMap(EObject o,
EStructuralFeature f)
sameDocSingle
protected int sameDocSingle(EObject o,
EStructuralFeature f)
sameDocMany
protected int sameDocMany(EObject o,
EStructuralFeature f)
getContent
protected String getContent(EObject o,
EStructuralFeature[] features)
saveDataTypeElementSingle
protected void saveDataTypeElementSingle(EObject o,
EStructuralFeature f)
getDataTypeElementSingleSimple
protected String getDataTypeElementSingleSimple(EObject o,
EStructuralFeature f)
saveElementID
protected void saveElementID(EObject o)