|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Configuration class for XML. It holds the EPackage to use when XML namespaces are not used in an XML file. It also holds the XMLMap to be used when serializing an XML file. The XML deserializer and serializer uses this class when an XML file is loaded and saved.
Nested Class Summary | |
static interface |
XMLHelper.ManyReference
|
Field Summary | |
static int |
DATATYPE_IS_MANY
|
static int |
DATATYPE_SINGLE
These are the kinds of features that are important when loading XMI files. |
static int |
IS_MANY_ADD
|
static int |
IS_MANY_MOVE
|
static int |
OTHER
|
Method Summary | |
void |
addPrefix(String prefix,
String uri)
Records the prefix to URI mapping while loading an XML document. |
String |
convertToString(EFactory factory,
EDataType dataType,
Object data)
Converts the given valuevalue to string while saving an XML document. |
EObject |
createObject(EFactory eFactory,
EClassifier type)
Create an object given an EFactory and a type |
EObject |
createObject(EFactory eFactory,
String name)
Deprecated. since 2.2. Instead use #createObject(EFactory, EClassifier) and #getType(EFactory, String) |
URI |
deresolve(URI uri)
Returns a relative URI if necessary and if possible. |
Map |
getAnyContentPrefixToURIMapping()
Returns a map of prefixes to URI mapping for elements with any content |
DanglingHREFException |
getDanglingHREFException()
|
ExtendedMetaData |
getExtendedMetaData()
Gets the ExtendedMetaData to use when serializing an XML file. |
EStructuralFeature |
getFeature(EClass eClass,
String namespaceURI,
String name)
Returns the structural feature for the XML element/attribute with the given namespaceURI and name. |
EStructuralFeature |
getFeature(EClass eClass,
String namespaceURI,
String name,
boolean isElement)
Returns the structural feature for the XML element/attribute with the given namespaceURI and name. |
int |
getFeatureKind(EStructuralFeature feature)
Return the kind of feature. |
String |
getHREF(EObject eObject)
Returns an HREF to this object from this resource |
String |
getID(EObject eObject)
Returns the xmi:id or null to supress |
String |
getIDREF(EObject eObject)
Returns an IDREF to this object |
String |
getJavaEncoding(String xmlEncoding)
Return a Java encoding corresponding to the given XML encoding. |
String |
getName(ENamedElement eNamedElement)
Returns the XML name of the ENamedElement |
String |
getNamespaceURI(String prefix)
Returns the namespaceURI in scope for the prefix. |
EPackage |
getNoNamespacePackage()
Gets the package to use when there is no XML namespace in an XML file. |
String |
getPrefix(EPackage ePackage)
Return the prefix used for this package. |
String |
getPrefix(String namespaceURI)
|
List |
getPrefixes(EPackage ePackage)
Return all the prefixes used for this package. |
EMap |
getPrefixToNamespaceMap()
|
String |
getQName(EClass eClass)
Returns the nsName:name c.ePackage().nsName() : c.eName() If there is an XMLMap, and the target namespace is null for this eClass, just the name is returned. |
String |
getQName(EDataType eDataType)
Returns the nsName:name c.ePackage().nsName() : c.eName() If there is an XMLMap, and the target namespace is null for this eClass, just the name is returned. |
String |
getQName(EStructuralFeature feature)
By default, this method returns the name of the feature. |
XMLResource |
getResource()
Returns the resource |
EClassifier |
getType(EFactory eFactory,
String typeName)
Given an EFactory and a type name, find and return the type |
String |
getURI(String prefix)
Returns the namespace prefix that's in effect while loading an XML document. |
Object |
getValue(EObject eObject,
EStructuralFeature eStructuralFeature)
Returns the XMI value of the EObject's feature |
String |
getXMLEncoding(String javaEncoding)
Return an XML encoding corresponding to the given Java encoding. |
XMLResource.XMLMap |
getXMLMap()
Gets the XMLMap to use when serializing an XML file. |
EPackage[] |
packages()
Returns the packages in getQName() |
void |
popContext()
Reverts to the previous namespace context while loading XML document. |
void |
popContext(Map prefixesToFactories)
Reverts to the previous namespace context while loading XML document and removes from the map, prefixes that have gone out of scope. |
void |
populateNameInfo(NameInfo nameInfo,
EClass eClass)
This method populates the given NameInfo with name information, resetting all the current
values in the nameInfo |
void |
populateNameInfo(NameInfo nameInfo,
EDataType eDataType)
This method populates the given NameInfo with name information, resetting all the current
values in the nameInfo |
void |
populateNameInfo(NameInfo nameInfo,
EStructuralFeature feature)
This method populates the given NameInfo with name information, resetting all the current
values in the nameInfo |
void |
pushContext()
Starts a new namespace context while loading an XML document. |
void |
recordPrefixToURIMapping()
Must be called during endDocument to record all the prefix to URI mappings that have been seen in the document during loading |
URI |
resolve(URI relative,
URI base)
|
void |
setAnySimpleType(EClass type)
Sets the any simple type class. |
void |
setCheckForDuplicates(boolean checkForDuplicates)
|
void |
setExtendedMetaData(ExtendedMetaData extendedMetaData)
Sets the ExtendedMetaData to use when serializing an XML file. |
List |
setManyReference(XMLHelper.ManyReference reference,
String location)
|
void |
setMustHavePrefix(boolean mustHavePrefix)
Specify if qualified names must have a prefix or could use default namespace (if possible) |
void |
setNoNamespacePackage(EPackage pkg)
Sets the package to use when there is no XML namespace in an XML file. |
void |
setOptions(Map options)
Sets various resource options on the helper |
void |
setPrefixToNamespaceMap(EMap prefixToNamespaceMap)
|
void |
setProcessDanglingHREF(String value)
|
void |
setValue(EObject eObject,
EStructuralFeature eStructuralFeature,
Object value,
int position)
Set the value of the feature for the object. |
void |
setXMLMap(XMLResource.XMLMap map)
Sets the XMLMap to use when serializing an XML file. |
Field Detail |
public static final int DATATYPE_SINGLE
public static final int DATATYPE_IS_MANY
public static final int IS_MANY_ADD
public static final int IS_MANY_MOVE
public static final int OTHER
Method Detail |
public void setOptions(Map options)
public void setNoNamespacePackage(EPackage pkg)
public EPackage getNoNamespacePackage()
public void setAnySimpleType(EClass type)
XMLResource.OPTION_ANY_SIMPLE_TYPE
public void setXMLMap(XMLResource.XMLMap map)
public XMLResource.XMLMap getXMLMap()
public void setExtendedMetaData(ExtendedMetaData extendedMetaData)
public ExtendedMetaData getExtendedMetaData()
public XMLResource getResource()
public Object getValue(EObject eObject, EStructuralFeature eStructuralFeature)
public String getName(ENamedElement eNamedElement)
public String getQName(EClass eClass)
public void populateNameInfo(NameInfo nameInfo, EClass eClass)
NameInfo
with name information, resetting all the current
values in the nameInfo
nameInfo
- the name information to populateeClass
- the EClass for which name has to be computedgetQName(EClass)
public String getQName(EDataType eDataType)
public void populateNameInfo(NameInfo nameInfo, EDataType eDataType)
NameInfo
with name information, resetting all the current
values in the nameInfo
nameInfo
- the name information to fill ineDataType
- the EDataType for which name has to be computedgetQName(EDataType)
public String getQName(EStructuralFeature feature)
public void populateNameInfo(NameInfo nameInfo, EStructuralFeature feature)
NameInfo
with name information, resetting all the current
values in the nameInfo
nameInfo
- the name information to fill infeature
- the EStructuralFeature for which name has to be computedgetQName(EStructuralFeature)
public String getPrefix(String namespaceURI)
public String getPrefix(EPackage ePackage)
public String getNamespaceURI(String prefix)
public List getPrefixes(EPackage ePackage)
public String getID(EObject eObject)
public String getIDREF(EObject eObject)
public String getHREF(EObject eObject)
public URI deresolve(URI uri)
public EPackage[] packages()
public EObject createObject(EFactory eFactory, String name)
public EObject createObject(EFactory eFactory, EClassifier type)
eFactory
- type
-
createObject(EFactory, String)
public EClassifier getType(EFactory eFactory, String typeName)
eFactory
- typeName
- createObject(EFactory, String)
public void setValue(EObject eObject, EStructuralFeature eStructuralFeature, Object value, int position)
public EStructuralFeature getFeature(EClass eClass, String namespaceURI, String name)
public EStructuralFeature getFeature(EClass eClass, String namespaceURI, String name, boolean isElement)
public int getFeatureKind(EStructuralFeature feature)
public String getXMLEncoding(String javaEncoding)
public String getJavaEncoding(String xmlEncoding)
public List setManyReference(XMLHelper.ManyReference reference, String location)
public void setCheckForDuplicates(boolean checkForDuplicates)
public void setProcessDanglingHREF(String value)
public DanglingHREFException getDanglingHREFException()
public URI resolve(URI relative, URI base)
public void addPrefix(String prefix, String uri)
public Map getAnyContentPrefixToURIMapping()
public void recordPrefixToURIMapping()
public String getURI(String prefix)
public void pushContext()
A new context should be pushed at the beginning of each XML element. The new context will automatically inherit the declarations of its parent context, but it will also keep track of which declarations were made within this context.
public void popContext()
The context should be popped at the end of each XML element. After popping the context, all namespace prefix mappings that were previously in scope are restored.
public void popContext(Map prefixesToFactories)
The context should be popped at the end of each XML element. After popping the context, all namespace prefix mappings that were previously in scope are restored.
public String convertToString(EFactory factory, EDataType dataType, Object data)
public EMap getPrefixToNamespaceMap()
public void setPrefixToNamespaceMap(EMap prefixToNamespaceMap)
public void setMustHavePrefix(boolean mustHavePrefix)
mustHavePrefix
-
|
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 |