gov.nasa.arc.brahms.common.data.format.uml
Class UMLFormat

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.format.uml.UMLFormat
All Implemented Interfaces:
IFormat

public class UMLFormat
extends java.lang.Object
implements IFormat

The UMLFormat writes out BrahmsObjects in XMI (XML Metadata Interchange) for use by UML tools (Unified Modeling Language).

Version:
25 June 2004
Author:
Ron van Hoof

Field Summary
protected static java.lang.String LOG_PROPERTY
           
 
Constructor Summary
UMLFormat()
          Constructor, creates a new UMLFormat
 
Method Summary
protected static java.lang.String createXMLString(java.lang.String s)
          Creates a new String from the specified String converting special characters such as &, <, >, " and ' to XML codes for support by XML parsers.
static IFormat getFormat()
          Returns an instance of the OntologyFormat
 IFormatter getFormatter(BrahmsObject obj)
          Returns the UML formatter for the given object.
static java.lang.String getTypeXMLID(int type)
          Returns the XML ID for the specified value or meta type.
 void init()
          Initialize the format linking the objects to the appropriate formatter
 void writeFormat(BrahmsObject obj, java.util.Properties p, java.io.DataOutputStream out)
          Writes the given object out in the format defined for that object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_PROPERTY

protected static final java.lang.String LOG_PROPERTY
See Also:
Constant Field Values
Constructor Detail

UMLFormat

public UMLFormat()
Constructor, creates a new UMLFormat

Method Detail

getFormat

public static IFormat getFormat()
Returns an instance of the OntologyFormat

Returns:
IFormat an OntologyFormat

getTypeXMLID

public static java.lang.String getTypeXMLID(int type)
Returns the XML ID for the specified value or meta type.

Parameters:
type - the type for which the XML ID is to be returned
Returns:
String the type's XML ID

createXMLString

protected static java.lang.String createXMLString(java.lang.String s)
Creates a new String from the specified String converting special characters such as &, <, >, " and ' to XML codes for support by XML parsers. XML parsers cannot handle those special characters in Strings.

Parameters:
s - the String to be converted to an XML String
Returns:
String the converted XML String

init

public void init()
Initialize the format linking the objects to the appropriate formatter


getFormatter

public IFormatter getFormatter(BrahmsObject obj)
Returns the UML formatter for the given object.

Specified by:
getFormatter in interface IFormat
Parameters:
obj - the BrahmsObject to be formatted
Returns:
IFormatter the object containing the formatting logic for the object

writeFormat

public void writeFormat(BrahmsObject obj,
                        java.util.Properties p,
                        java.io.DataOutputStream out)
Writes the given object out in the format defined for that object.

Specified by:
writeFormat in interface IFormat
Parameters:
obj - the BrahmsObject to be written out in this format
p - the Properties relevant for the formatting of the output
out - the DataOutputStream to write the format output to


Copyright © 1997-2012 All Rights Reserved.