|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinf.compilers.XmlAdaptor<Sentence>
ai.krr.propositions.XplSentenceAdaptor
public class XplSentenceAdaptor
This class is an adaptor between the ai.krr.propositions.Sentence class that can be used as an internal representation for reasoning and its external form in an XML Syntax. The XMLSchema defining the XPL format ....
property | possible values | default |
---|---|---|
case-sensitive | true, false | true |
Field Summary |
---|
Fields inherited from class inf.compilers.XmlAdaptor |
---|
indentStr, props |
Constructor Summary | |
---|---|
XplSentenceAdaptor()
This constructor creates a SyntaxAdaptor that can be used to read statements in an XML syntax for propositional logic (XPL) and create a propositional Sentence for it, or it can be used to write out a propositional Sentence in XPL syntax. |
Method Summary | |
---|---|
protected XplSentenceAdaptor |
clone()
This function returns a copy of this SyntaxAdaptor that contains a (shallow) copy of the properties. |
protected org.w3c.dom.Element |
generateAtomNode(org.w3c.dom.Document doc,
Atom atom,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateConnectedSentenceNode(org.w3c.dom.Document doc,
ConnectedSentence stmt,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateLiteralNode(org.w3c.dom.Document doc,
Literal lit,
java.util.Set<NameSpace> nss)
|
protected org.w3c.dom.Element |
generateNegatedSentenceNode(org.w3c.dom.Document doc,
NegatedSentence stmt,
java.util.Set<NameSpace> nss)
|
org.w3c.dom.Element |
generateNodeTree(org.w3c.dom.Document doc,
Sentence content)
This function generates an Element Node that is the root for the given content. |
org.w3c.dom.Element |
generateSentenceNode(org.w3c.dom.Document doc,
Sentence content,
java.util.Set<NameSpace> nss)
This function generates an Element Node that is the root for the given content. |
protected org.w3c.dom.Element |
generateTruthValueNode(org.w3c.dom.Document doc,
TruthValue tValue,
java.util.Set<NameSpace> nss)
|
java.lang.Class<Sentence> |
getInternalClass()
This function returns the Class that holds the internal representation this adaptor translates to and from. |
java.lang.String |
getSyntaxName()
This function returns the name that should identify the syntactical language that this adaptor translates to and from. |
protected Atom |
parseAtom(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected ConnectedSentence |
parseConnectedSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected Literal |
parseLiteral(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected NegatedSentence |
parseNegatedSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
Sentence |
parseNodeTree(org.w3c.dom.Element root)
This function takes a DOM Document and generates an internal representation of the statement in the representation R that represents the content of the given Document. |
protected Sentence |
parseSentence(org.w3c.dom.Element node,
java.util.Map<java.lang.String,NameSpace> proxies)
|
protected TruthValue |
parseTruthValue(org.w3c.dom.Element node)
|
Methods inherited from class inf.compilers.XmlAdaptor |
---|
addContentText, generateContentNodeTree, generateDocument, getContentText, getProperty, parseContentNodeTree, parseDocument, prettyPrint, read, setProperty, setSyntaxAdaptors, write |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XplSentenceAdaptor()
This constructor creates a SyntaxAdaptor that can be used to read statements in an XML syntax for propositional logic (XPL) and create a propositional Sentence for it, or it can be used to write out a propositional Sentence in XPL syntax. The given properties must not be null.
Method Detail |
---|
protected XplSentenceAdaptor clone()
This function returns a copy of this SyntaxAdaptor that contains a (shallow) copy of the properties.
clone
in class java.lang.Object
public java.lang.Class<Sentence> getInternalClass()
This function returns the Class that holds the internal representation this adaptor translates to and from.
public java.lang.String getSyntaxName()
This function returns the name that should identify the syntactical language that this adaptor translates to and from.
public Sentence parseNodeTree(org.w3c.dom.Element root) throws inf.compilers.ExpressivenessException, java.text.ParseException
This function takes a DOM Document and generates an internal representation of the statement in the representation R that represents the content of the given Document. No validation will be performed here.
parseNodeTree
in class inf.compilers.XmlAdaptor<Sentence>
root
- the root Element of the Document to be transformed here
inf.compilers.ExpressivenessException
java.text.ParseException
public org.w3c.dom.Element generateNodeTree(org.w3c.dom.Document doc, Sentence content) throws inf.compilers.ExpressivenessException
This function generates an Element Node that is the root for the given content. The way it is generated depends on the type of sentence this is.
generateNodeTree
in class inf.compilers.XmlAdaptor<Sentence>
doc
- the Document to which the Node will belongcontent
- a statement in the internal representation language
inf.compilers.ExpressivenessException
- if the XML cannot represent the given
statementpublic org.w3c.dom.Element generateSentenceNode(org.w3c.dom.Document doc, Sentence content, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
This function generates an Element Node that is the root for the given content. The way it is generated depends on the type of sentence this is.
doc
- the Document to which the Node will belongcontent
- a statement in the internal representation languagenss
- the set of all NameSpaces used in the given Sentence
inf.compilers.ExpressivenessException
- if any contained NamedSymbol is internalprotected org.w3c.dom.Element generateConnectedSentenceNode(org.w3c.dom.Document doc, ConnectedSentence stmt, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateNegatedSentenceNode(org.w3c.dom.Document doc, NegatedSentence stmt, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateLiteralNode(org.w3c.dom.Document doc, Literal lit, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateAtomNode(org.w3c.dom.Document doc, Atom atom, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected org.w3c.dom.Element generateTruthValueNode(org.w3c.dom.Document doc, TruthValue tValue, java.util.Set<NameSpace> nss) throws inf.compilers.ExpressivenessException
inf.compilers.ExpressivenessException
protected Sentence parseSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected TruthValue parseTruthValue(org.w3c.dom.Element node)
protected Atom parseAtom(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected Literal parseLiteral(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected NegatedSentence parseNegatedSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
protected ConnectedSentence parseConnectedSentence(org.w3c.dom.Element node, java.util.Map<java.lang.String,NameSpace> proxies) throws java.text.ParseException
java.text.ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |