org.eclipse.emf.ecore.xmi.impl
Class XMLInfoImpl

java.lang.Object
  extended by org.eclipse.emf.ecore.xmi.impl.XMLInfoImpl
All Implemented Interfaces:
XMLResource.XMLInfo

public class XMLInfoImpl
extends java.lang.Object
implements XMLResource.XMLInfo

This class is used with the XMLMap class 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 class maintains the association between XMLInfo objects and the ecore constructs they describe.


Field Summary
protected  java.lang.String name
           
protected  java.lang.String targetNamespace
           
protected  int xmlRepresentation
           
 
Fields inherited from interface org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo
ATTRIBUTE, CONTENT, ELEMENT, UNSPECIFIED
 
Constructor Summary
XMLInfoImpl()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlRepresentation

protected int xmlRepresentation

targetNamespace

protected java.lang.String targetNamespace

name

protected java.lang.String name
Constructor Detail

XMLInfoImpl

public XMLInfoImpl()
Method Detail

getXMLRepresentation

public 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.

Specified by:
getXMLRepresentation in interface XMLResource.XMLInfo

setXMLRepresentation

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

Specified by:
setXMLRepresentation in interface XMLResource.XMLInfo

getTargetNamespace

public java.lang.String getTargetNamespace()
Description copied from interface: XMLResource.XMLInfo
Gets the target namespace for the Ecore construct.

Specified by:
getTargetNamespace in interface XMLResource.XMLInfo

setTargetNamespace

public void setTargetNamespace(java.lang.String namespaceURI)
Description copied from interface: XMLResource.XMLInfo
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.

Specified by:
setTargetNamespace in interface XMLResource.XMLInfo

getName

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

Specified by:
getName in interface XMLResource.XMLInfo

setName

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

Specified by:
setName in interface XMLResource.XMLInfo

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