org.deri.wsmo4j.io.serializer.xml
Class VisitorSerializeXMLTerms

java.lang.Object
  extended by org.deri.wsmo4j.io.serializer.xml.VisitorSerializeXMLTerms
All Implemented Interfaces:
org.omwg.logicalexpression.terms.Visitor

public class VisitorSerializeXMLTerms
extends Object
implements org.omwg.logicalexpression.terms.Visitor

Concrete Visitor class. For each visited term, a document element is built.

See Also:
VisitorSerializeXML, Visitor

Constructor Summary
VisitorSerializeXMLTerms(Document doc)
           
 
Method Summary
 Object getSerializedObject()
          All serialized elements are added to a vector.
 void setName(String name)
          Set the type of element that is to be added to the document (term, atom or molecule).
 void visitComplexDataValue(org.omwg.ontology.ComplexDataValue t)
           
 void visitConstructedTerm(org.omwg.logicalexpression.terms.ConstructedTerm t)
          Builds an element in the document with the ConstructedTerm's name as attribute.
 void visitIRI(org.wsmo.common.IRI t)
          Builds an element in the document with the IRI's String representation as attribute.
 void visitNumberedID(org.omwg.logicalexpression.terms.NumberedAnonymousID t)
          Builds an element in the document with the Numbered Anonymous ID's String representation as attribute.
 void visitSimpleDataValue(org.omwg.ontology.SimpleDataValue t)
           
 void visitUnnumberedID(org.wsmo.common.UnnumberedAnonymousID t)
          Builds an element in the document with the Unnumbered Anonymous ID's String representation as attribute.
 void visitVariable(org.omwg.ontology.Variable t)
          Builds an element in the document with the Variable's String representation as attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisitorSerializeXMLTerms

public VisitorSerializeXMLTerms(Document doc)
Parameters:
doc - Document that will be filled with the xml structure
See Also:
org.deri.wsmo4j.io.serializer.xml.VisitorSerializeXML#VisitorSerializeXML(TopEntity, Document)
Method Detail

setName

public void setName(String name)
Set the type of element that is to be added to the document (term, atom or molecule).

Parameters:
name - type of element

visitConstructedTerm

public void visitConstructedTerm(org.omwg.logicalexpression.terms.ConstructedTerm t)
Builds an element in the document with the ConstructedTerm's name as attribute. The arguments are added as children to the node. The element is then added to a vector.

Specified by:
visitConstructedTerm in interface org.omwg.logicalexpression.terms.Visitor
Parameters:
t - ConstructedTerm to be serialized
See Also:
Visitor.visitConstructedTerm(org.omwg.logicalexpression.terms.ConstructedTerm)

visitVariable

public void visitVariable(org.omwg.ontology.Variable t)
Builds an element in the document with the Variable's String representation as attribute. The element is added to a vector.

Specified by:
visitVariable in interface org.omwg.logicalexpression.terms.Visitor
Parameters:
t - Variable to be serialized
See Also:
org.omwg.logicalexpression.terms.Visitor#visitVariable(org.omwg.logicalexpression.terms.Variable)

visitComplexDataValue

public void visitComplexDataValue(org.omwg.ontology.ComplexDataValue t)
Specified by:
visitComplexDataValue in interface org.omwg.logicalexpression.terms.Visitor

visitSimpleDataValue

public void visitSimpleDataValue(org.omwg.ontology.SimpleDataValue t)
Specified by:
visitSimpleDataValue in interface org.omwg.logicalexpression.terms.Visitor

visitUnnumberedID

public void visitUnnumberedID(org.wsmo.common.UnnumberedAnonymousID t)
Builds an element in the document with the Unnumbered Anonymous ID's String representation as attribute. The element is added to a vector.

Specified by:
visitUnnumberedID in interface org.omwg.logicalexpression.terms.Visitor
Parameters:
t - UnNBAnonymousID to be serialized
See Also:
org.omwg.logicalexpression.terms.Visitor#visitAnonymousID(org.omwg.logicalexpression.terms.UnNbAnonymousID)

visitNumberedID

public void visitNumberedID(org.omwg.logicalexpression.terms.NumberedAnonymousID t)
Builds an element in the document with the Numbered Anonymous ID's String representation as attribute. The element is added to a vector.

Specified by:
visitNumberedID in interface org.omwg.logicalexpression.terms.Visitor
Parameters:
t - NbAnonymousID to be serialized
See Also:
org.omwg.logicalexpression.terms.Visitor#visitNbAnonymousID(org.omwg.logicalexpression.terms.NbAnonymousID)

visitIRI

public void visitIRI(org.wsmo.common.IRI t)
Builds an element in the document with the IRI's String representation as attribute. The element is added to a vector.

Specified by:
visitIRI in interface org.omwg.logicalexpression.terms.Visitor
Parameters:
t - IRI to be serialized
See Also:
org.omwg.logicalexpression.terms.Visitor#visitIRI(org.omwg.logicalexpression.terms.IRI)

getSerializedObject

public Object getSerializedObject()
All serialized elements are added to a vector. This method removes the first serialized element from this vector and shifts any subsequent elements to the left (subtracts one from their indices).

Returns:
the serialized document node that is the first element in this vector


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.