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

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

public class VisitorSerializeXML
extends AbstractVisitor

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

See Also:
LogExprSerializerXML, AbstractVisitor

Constructor Summary
VisitorSerializeXML(Document doc)
           
 
Method Summary
 Object getSerializedObject()
          All serialized elements are added to a vector.
 void visitAtom(org.omwg.logicalexpression.Atom expr)
          Builds an element in the document with the Atom's identifier as attribute.
 void visitAttributeContraintMolecule(org.omwg.logicalexpression.AttributeConstraintMolecule expr)
           
 void visitAttributeInferenceMolecule(org.omwg.logicalexpression.AttributeInferenceMolecule expr)
           
 void visitAttributeValueMolecule(org.omwg.logicalexpression.AttributeValueMolecule expr)
           
 void visitCompoundMolecule(org.omwg.logicalexpression.CompoundMolecule expr)
           
 void visitConjunction(org.omwg.logicalexpression.Conjunction expr)
          Builds a node in the document with the Binary's operator type as name.
 void visitConstraint(org.omwg.logicalexpression.Constraint expr)
          Builds a node in the document with the Unary's operator type as name.
 void visitDisjunction(org.omwg.logicalexpression.Disjunction expr)
          Builds a node in the document with the Binary's operator type as name.
 void visitEquivalence(org.omwg.logicalexpression.Equivalence expr)
          Builds a node in the document with the Binary's operator type as name.
 void visitExistentialQuantification(org.omwg.logicalexpression.ExistentialQuantification expr)
          Builds a node in the document with the Quantified's operator type as name.
 void visitImplication(org.omwg.logicalexpression.Implication expr)
          Builds a node in the document with the Binary's operator type as name.
 void visitInverseImplication(org.omwg.logicalexpression.InverseImplication expr)
          Builds a node in the document with the Binary's operator type as name.
 void visitLogicProgrammingRule(org.omwg.logicalexpression.LogicProgrammingRule expr)
          Builds a node in the document with the Binary's operator type as name.
 void visitMemberShipMolecule(org.omwg.logicalexpression.MembershipMolecule expr)
           
 void visitNegation(org.omwg.logicalexpression.Negation expr)
          Builds a node in the document with the Unary's operator type as name.
 void visitNegationAsFailure(org.omwg.logicalexpression.NegationAsFailure expr)
          Builds a node in the document with the Unary's operator type as name.
 void visitSubConceptMolecule(org.omwg.logicalexpression.SubConceptMolecule expr)
           
 void visitUniversalQuantification(org.omwg.logicalexpression.UniversalQuantification expr)
          Builds a node in the document with the Quantified's operator type as name.
 
Methods inherited from class org.deri.wsmo4j.logicalexpression.AbstractVisitor
visitMolecule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisitorSerializeXML

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

visitAtom

public void visitAtom(org.omwg.logicalexpression.Atom expr)
Builds an element in the document with the Atom's identifier as attribute. The Atom's terms are added as children to the node. The element is then added to a vector.

Specified by:
visitAtom in interface org.omwg.logicalexpression.Visitor
Overrides:
visitAtom in class AbstractVisitor
Parameters:
expr - Atom to be serialized
See Also:
AbstractVisitor.visitAtom(Atom)

visitCompoundMolecule

public void visitCompoundMolecule(org.omwg.logicalexpression.CompoundMolecule expr)

visitNegationAsFailure

public void visitNegationAsFailure(org.omwg.logicalexpression.NegationAsFailure expr)
Builds a node in the document with the Unary's operator type as name. The Unary's logical expression is added as child to the node. The node is then added to a vector.

Specified by:
visitNegationAsFailure in interface org.omwg.logicalexpression.Visitor
Overrides:
visitNegationAsFailure in class AbstractVisitor
Parameters:
expr - Unary Expression to be serialized, with operator NAF
See Also:
AbstractVisitor.visitNegationAsFailure(NegationAsFailure)

visitNegation

public void visitNegation(org.omwg.logicalexpression.Negation expr)
Builds a node in the document with the Unary's operator type as name. The Unary's logical expression is added as child to the node. The node is then added to a vector.

Specified by:
visitNegation in interface org.omwg.logicalexpression.Visitor
Overrides:
visitNegation in class AbstractVisitor
Parameters:
expr - Unary Expression to be serialized, with operator NEG
See Also:
AbstractVisitor.visitNegation(Negation)

visitConstraint

public void visitConstraint(org.omwg.logicalexpression.Constraint expr)
Builds a node in the document with the Unary's operator type as name. The Unary's logical expression is added as child to the node. The node is then added to a vector.

Specified by:
visitConstraint in interface org.omwg.logicalexpression.Visitor
Overrides:
visitConstraint in class AbstractVisitor
Parameters:
expr - Unary Expression to be serialized, with operator CONSTRAINT
See Also:
AbstractVisitor.visitConstraint(Constraint)

visitConjunction

public void visitConjunction(org.omwg.logicalexpression.Conjunction expr)
Builds a node in the document with the Binary's operator type as name. The Binary's logical expressions are added as children to the node. The node is then added to a vector.

Specified by:
visitConjunction in interface org.omwg.logicalexpression.Visitor
Overrides:
visitConjunction in class AbstractVisitor
Parameters:
expr - Binary Expression to be serialized, with operator AND
See Also:
AbstractVisitor.visitConjunction(Conjunction)

visitEquivalence

public void visitEquivalence(org.omwg.logicalexpression.Equivalence expr)
Builds a node in the document with the Binary's operator type as name. The Binary's logical expressions are added as children to the node. The node is then added to a vector.

Specified by:
visitEquivalence in interface org.omwg.logicalexpression.Visitor
Overrides:
visitEquivalence in class AbstractVisitor
Parameters:
expr - Binary Expression to be serialized, with operator EQUIVALENT
See Also:
AbstractVisitor.visitEquivalence(Equivalence)

visitInverseImplication

public void visitInverseImplication(org.omwg.logicalexpression.InverseImplication expr)
Builds a node in the document with the Binary's operator type as name. The Binary's logical expressions are added as children to the node. The node is then added to a vector.

Specified by:
visitInverseImplication in interface org.omwg.logicalexpression.Visitor
Overrides:
visitInverseImplication in class AbstractVisitor
Parameters:
expr - Binary Expression to be serialized, with operator IMPLIEDBY
See Also:
AbstractVisitor.visitInverseImplication(InverseImplication)

visitImplication

public void visitImplication(org.omwg.logicalexpression.Implication expr)
Builds a node in the document with the Binary's operator type as name. The Binary's logical expressions are added as children to the node. The node is then added to a vector.

Specified by:
visitImplication in interface org.omwg.logicalexpression.Visitor
Overrides:
visitImplication in class AbstractVisitor
Parameters:
expr - Binary Expression to be serialized, with operator IMPLIES
See Also:
AbstractVisitor.visitImplication(Implication)

visitLogicProgrammingRule

public void visitLogicProgrammingRule(org.omwg.logicalexpression.LogicProgrammingRule expr)
Builds a node in the document with the Binary's operator type as name. The Binary's logical expressions are added as children to the node. The node is then added to a vector.

Specified by:
visitLogicProgrammingRule in interface org.omwg.logicalexpression.Visitor
Overrides:
visitLogicProgrammingRule in class AbstractVisitor
Parameters:
expr - Binary Expression to be serialized, with operator IMPLIEDBYLP
See Also:
AbstractVisitor.visitLogicProgrammingRule(LogicProgrammingRule)

visitDisjunction

public void visitDisjunction(org.omwg.logicalexpression.Disjunction expr)
Builds a node in the document with the Binary's operator type as name. The Binary's logical expressions are added as children to the node. The node is then added to a vector.

Specified by:
visitDisjunction in interface org.omwg.logicalexpression.Visitor
Overrides:
visitDisjunction in class AbstractVisitor
Parameters:
expr - Binary Expression to be serialized, with operator OR
See Also:
AbstractVisitor.visitDisjunction(Disjunction)

visitUniversalQuantification

public void visitUniversalQuantification(org.omwg.logicalexpression.UniversalQuantification expr)
Builds a node in the document with the Quantified's operator type as name. The Quantified's Variables and its logical expression are added as children to the node. The node is then added to a vector.

Specified by:
visitUniversalQuantification in interface org.omwg.logicalexpression.Visitor
Overrides:
visitUniversalQuantification in class AbstractVisitor
Parameters:
expr - Quantified Expression to be serialized, with operator FORALL
See Also:
AbstractVisitor.visitUniversalQuantification(UniversalQuantification)

visitExistentialQuantification

public void visitExistentialQuantification(org.omwg.logicalexpression.ExistentialQuantification expr)
Builds a node in the document with the Quantified's operator type as name. The Quantified's Variables and its logical expression are added as children to the node. The node is then added to a vector.

Specified by:
visitExistentialQuantification in interface org.omwg.logicalexpression.Visitor
Overrides:
visitExistentialQuantification in class AbstractVisitor
Parameters:
expr - Quantified Expression to be serialized, with operator EXISTS
See Also:
AbstractVisitor.visitExistentialQuantification(ExistentialQuantification)

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

visitSubConceptMolecule

public void visitSubConceptMolecule(org.omwg.logicalexpression.SubConceptMolecule expr)

visitMemberShipMolecule

public void visitMemberShipMolecule(org.omwg.logicalexpression.MembershipMolecule expr)

visitAttributeValueMolecule

public void visitAttributeValueMolecule(org.omwg.logicalexpression.AttributeValueMolecule expr)

visitAttributeContraintMolecule

public void visitAttributeContraintMolecule(org.omwg.logicalexpression.AttributeConstraintMolecule expr)

visitAttributeInferenceMolecule

public void visitAttributeInferenceMolecule(org.omwg.logicalexpression.AttributeInferenceMolecule expr)


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