org.eclipse.emf.ecore.xmi
Interface XMLResource.XMLInfo

All Known Subinterfaces:
XMLInfo
All Known Implementing Classes:
XMLInfoImpl, XMLInfoImpl
Enclosing interface:
XMLResource

public static interface XMLResource.XMLInfo

This interface is used with the XMLMap interface to describe how to serialize objects and features. You can specify the name to use instead of the model name, whether a feature will be serialized as an XML attribute, XML element, or XML content, and whether to use a namespace when serializing an object.

The XMLMap interface maintains the association between XMLInfo objects and the ecore constructs they describe.


Field Summary
static int ATTRIBUTE
           
static int CONTENT
           
static int ELEMENT
           
static int UNSPECIFIED
          These constants are used to specify the XML representation of an Ecore construct.
 
Method Summary
 java.lang.String getName()
          Returns the name to use for the Ecore construct in an XML file.
 java.lang.String getTargetNamespace()
          Gets the target namespace for the Ecore construct.
 int getXMLRepresentation()
          Returns ELEMENT if the Ecore construct is to be serialized as an XML element; ATTRIBUTE if the Ecore construct is to be serialized as an XML attribute; and CONTENT if the Ecore construct is to be serialized in element content.
 void setName(java.lang.String name)
          Set the name to be used in an XML file.
 void setTargetNamespace(java.lang.String namespaceURI)
          Set the target namespace for the Ecore construct.
 void setXMLRepresentation(int representation)
          Set attribute to true to serialize a feature as an XML attribute.
 

Field Detail

UNSPECIFIED

static final int UNSPECIFIED
These constants are used to specify the XML representation of an Ecore construct.

See Also:
Constant Field Values

ELEMENT

static final int ELEMENT
See Also:
Constant Field Values

ATTRIBUTE

static final int ATTRIBUTE
See Also:
Constant Field Values

CONTENT

static final int CONTENT
See Also:
Constant Field Values
Method Detail

getXMLRepresentation

int getXMLRepresentation()
Returns ELEMENT if the Ecore construct is to be serialized as an XML element; ATTRIBUTE if the Ecore construct is to be serialized as an XML attribute; and CONTENT if the Ecore construct is to be serialized in element content. By default, the value is UNSPECIFIED.


setXMLRepresentation

void setXMLRepresentation(int representation)
Set attribute to true to serialize a feature as an XML attribute.


setTargetNamespace

void setTargetNamespace(java.lang.String namespaceURI)
Set the target namespace for the Ecore construct. By default, this is null. A package with the namespaceURI must be registered with the EPackage.Registry.


getTargetNamespace

java.lang.String getTargetNamespace()
Gets the target namespace for the Ecore construct.


getName

java.lang.String getName()
Returns the name to use for the Ecore construct in an XML file.


setName

void setName(java.lang.String name)
Set the name to be used in an XML file.


Copyright 2001-2012 IBM Corporation and others.
All Rights Reserved.