|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.data.format.ontology.OntologyFormat
public class OntologyFormat
The OntologyFormat writes out BrahmsObjects in the DARPA Agent Markup Language (DAML) to specify the ontology for a Brahms model used to define policies for the model.
Field Summary | |
---|---|
protected static java.lang.String |
LOG_PROPERTY
|
Constructor Summary | |
---|---|
OntologyFormat()
Constructor, creates a new OntologyFormat |
Method Summary | |
---|---|
protected static void |
closeKAoSMappingFile()
Closes the KAoS Mapping file. |
protected static java.lang.String |
convertPackageToDirectory(java.lang.String brahmspackage)
Converts the specified brahms package name into a directory string by converting the dots to path separators. |
protected static java.lang.String |
convertPackageToURL(java.lang.String brahmspackage)
Converts the specified brahms package name into a URL directory string by converting the dots to URL path separators. |
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 Ontology formatter for the given object. |
protected static java.io.DataOutputStream |
getKAoSMappingFile(java.util.Properties p)
Returns the KAoS Mapping file in which fully qualified names for Brahms elements are mapped to the fully qualified URL's for the KAoS ontology elements. |
protected static java.io.File |
getOntologyFile(BrahmsObject o,
java.util.Properties p)
Returns the file name for the ontology file for the given Brahms object. |
protected static java.lang.String |
getOntologyURL(BrahmsObject o,
java.util.Properties p)
Returns the complete URL for the ontology file for the specified BrahmsObject. |
void |
init()
Initialize the format linking the objects to the appropriate formatter |
protected static java.io.DataOutputStream |
openKAoSMappingFile(Model model,
java.util.Properties p)
Creates and opens the KAoS Mapping file in which fully qualified names for Brahms elements are mapped to the fully qualified URL's for the KAoS ontology elements. |
protected static java.io.DataOutputStream |
openOntologyFile(BrahmsObject o,
java.util.Properties p)
Determines the file name for the ontology file for the given Brahms object, creates the file, opens it and returns the stream to that file. |
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 |
---|
protected static final java.lang.String LOG_PROPERTY
Constructor Detail |
---|
public OntologyFormat()
Method Detail |
---|
public static IFormat getFormat()
protected static java.io.File getOntologyFile(BrahmsObject o, java.util.Properties p)
o
- the BrahmsObject for which the ontology file is to be determinedp
- the Properties with additional information relevant to the ontology generator
protected static java.lang.String getOntologyURL(BrahmsObject o, java.util.Properties p)
o
- the BrahmsObject for which the ontology URL is to be returnedp
- the Properties with additional information relevant to determine the URL
protected static java.io.DataOutputStream openOntologyFile(BrahmsObject o, java.util.Properties p)
o
- the BrahmsObject for which a file is to be opened for writingp
- the Properties with additional information relevant to the ontology generator
protected static java.io.DataOutputStream openKAoSMappingFile(Model model, java.util.Properties p)
model
- the Model for which the mapping file is to be createdp
- the Properties with additional information relevant to create the mapping file
protected static java.io.DataOutputStream getKAoSMappingFile(java.util.Properties p)
p
- the Properties with additional information relevant to obtain the mapping file
protected static void closeKAoSMappingFile()
protected static java.lang.String convertPackageToDirectory(java.lang.String brahmspackage)
brahmspackage
- the package to be converted
protected static java.lang.String convertPackageToURL(java.lang.String brahmspackage)
brahmspackage
- the package to be converted
protected static java.lang.String createXMLString(java.lang.String s)
s
- the String to be converted to an XML String
public void init()
public IFormatter getFormatter(BrahmsObject obj)
getFormatter
in interface IFormat
obj
- the BrahmsObject to be formatted
public void writeFormat(BrahmsObject obj, java.util.Properties p, java.io.DataOutputStream out)
writeFormat
in interface IFormat
obj
- the BrahmsObject to be written out in this formatp
- the Properties relevant for the formatting of the outputout
- the DataOutputStream to write the format output to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |