|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.api.core.xmi.XMIHeader
public final class XMIHeader
Class that represents the content of an XMI file's header.
The XMI processor is designed to hide as much as possible the semantics of XMI by simply constructing
FeatureInfo
and EntityInfo
instances as an XMI stream is processed. These info classes are
thus similar to SAX events of a SAX XML document parser.
Nested Class Summary | |
---|---|
static class |
XMIHeader.Documentation
Class that represents the "xmi.document" portion of the header |
static class |
XMIHeader.Import
Class that represents the "xmi.import" tag in the header. |
static class |
XMIHeader.MetaMetaModel
Class that represents the "xmi.metametamodel" tag in the header. |
static class |
XMIHeader.MetaModel
Class that represents the "xmi.metamodel" tag in the header. |
static class |
XMIHeader.Model
Class that represents the "xmi.model" tag in the header |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_INDENT
Default indentation upon write |
Constructor Summary | |
---|---|
XMIHeader()
Constructor for XMIHeader. |
Method Summary | |
---|---|
protected static boolean |
addElement(org.jdom.Element parent,
java.lang.String tagName,
java.lang.String text)
Helper method. |
protected static boolean |
addImport(org.jdom.Element parent,
XMIHeader.Import importObj)
Helper method to add an import under the parent |
void |
addImport(java.lang.String name,
java.lang.String version,
java.lang.String href)
Add an import to this header. |
void |
addImport(java.lang.String name,
java.lang.String version,
java.lang.String href,
java.lang.String content)
Add an import to this header. |
void |
addMetaMetaModel(java.lang.String name,
java.lang.String version,
java.lang.String href)
Add a metametamodel to this header. |
void |
addMetaMetaModel(java.lang.String name,
java.lang.String version,
java.lang.String href,
java.lang.String content)
Add a metametamodel to this header. |
void |
addMetaModel(java.lang.String name,
java.lang.String version,
java.lang.String href)
Add a metamodel to this header. |
void |
addMetaModel(java.lang.String name,
java.lang.String version,
java.lang.String href,
java.lang.String content)
Add a metamodel to this header. |
protected static boolean |
addModel(org.jdom.Element parent,
XMIHeader.Model model)
Helper method to add a model to the parent. |
void |
addModel(java.lang.String name,
java.lang.String version,
java.lang.String href)
Add a model to this header. |
void |
addModel(java.lang.String name,
java.lang.String version,
java.lang.String href,
java.lang.String content)
Add a model to this header. |
protected static boolean |
addText(org.jdom.Element tag,
java.lang.String text)
Helper method to set the content on an Element. |
static void |
applyHeader(org.jdom.Document doc,
XMIHeader xmiHeader)
Apply the supplied XMI header to the XML (JDOM) Document. |
static void |
applyHeader(org.jdom.Element root,
XMIHeader xmiHeader,
boolean newDocument)
Apply the supplied XMI header to the specified element in an XML (JDOM) Document. |
boolean |
equals(java.lang.Object obj)
Determine whether this object is equivalent to the supplied object. |
XMIHeader.Documentation |
getDocumentation()
Get the Documentation object. |
java.util.Collection |
getImports()
Get the imports |
java.util.Collection |
getMetaMetaModels()
Get the meta-metamodels |
java.util.Collection |
getMetaModels()
Get the metamodels |
java.util.Collection |
getModels()
Get the models |
java.lang.String |
getXMIFragment()
Get the XML fragment that represents the header, using the default indentation and new lines for each tag. |
java.lang.String |
getXMIFragment(java.lang.String indent,
boolean newlines)
Get the XML fragment that represents the header |
void |
print(java.io.PrintStream stream)
Method to print the contents of the XMI Header object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_INDENT
Constructor Detail |
---|
public XMIHeader()
Method Detail |
---|
public XMIHeader.Documentation getDocumentation()
public java.util.Collection getModels()
XMIHeader.Model
instancespublic java.util.Collection getMetaModels()
XMIHeader.MetaModel
instancespublic java.util.Collection getMetaMetaModels()
XMIHeader.MetaMetaModel
instancespublic java.util.Collection getImports()
XMIHeader.Import
instancespublic void addModel(java.lang.String name, java.lang.String version, java.lang.String href)
name
- the name of the modelversion
- the version of the modelhref
- the URI of the modelpublic void addModel(java.lang.String name, java.lang.String version, java.lang.String href, java.lang.String content)
name
- the name of the modelversion
- the version of the modelhref
- the URI of the modelcontent
- the value of the "xmi.model" tagpublic void addMetaModel(java.lang.String name, java.lang.String version, java.lang.String href)
name
- the name of the metamodelversion
- the version of the metamodelhref
- the URI of the metamodelpublic void addMetaModel(java.lang.String name, java.lang.String version, java.lang.String href, java.lang.String content)
name
- the name of the metamodelversion
- the version of the metamodelhref
- the URI of the metamodelcontent
- the value of the "xmi.metamodel" tagpublic void addMetaMetaModel(java.lang.String name, java.lang.String version, java.lang.String href)
name
- the name of the metametamodelversion
- the version of the metametamodelhref
- the URI of the metametamodelpublic void addMetaMetaModel(java.lang.String name, java.lang.String version, java.lang.String href, java.lang.String content)
name
- the name of the metametamodelversion
- the version of the metametamodelhref
- the URI of the metametamodelcontent
- the value of the "xmi.metametamodel" tagpublic void addImport(java.lang.String name, java.lang.String version, java.lang.String href)
name
- the name of the imported file/modelversion
- the version of the imported file/modelhref
- the URI of the imported file/modelpublic void addImport(java.lang.String name, java.lang.String version, java.lang.String href, java.lang.String content)
name
- the name of the imported file/modelversion
- the version of the imported file/modelhref
- the URI of the imported file/modelcontent
- the value of the "xmi.import" tagpublic java.lang.String getXMIFragment(java.lang.String indent, boolean newlines)
indent
- the String value to use for indentationnewlines
- true if tags should be written on separate lines, or false
if the output should be condensed
public java.lang.String getXMIFragment()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be compared with this
public static void applyHeader(org.jdom.Document doc, XMIHeader xmiHeader)
doc
- the JDOM document that is to contain the XMI headerxmiHeader
- the header information to be written to the documentpublic static void applyHeader(org.jdom.Element root, XMIHeader xmiHeader, boolean newDocument)
root
- the element under which the header fragment is to be written;
this should be the "XMI" root tag of an XMI document.xmiHeader
- the header information to be written to the documentnewDocument
- true if this document may be a new document, or false if
an existing header (if one exists) should be replacedprotected static boolean addElement(org.jdom.Element parent, java.lang.String tagName, java.lang.String text)
parent
- the parent ElementtagName
- the name of the new Elementtext
- the content for the new Element
protected static boolean addText(org.jdom.Element tag, java.lang.String text)
tag
- the parent Element; may be nulltext
- the content for the new Element; may be null
protected static boolean addModel(org.jdom.Element parent, XMIHeader.Model model)
parent
- the parent Element; may be nullmodel
- the model to be added
protected static boolean addImport(org.jdom.Element parent, XMIHeader.Import importObj)
parent
- the parentimportObj
- the import object to be added
public void print(java.io.PrintStream stream)
stream
- the stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |