Modifier and Type | Field and Description |
---|---|
private org.w3c.dom.Document |
doc |
Constructor and Description |
---|
DOMParser() |
Modifier and Type | Method and Description |
---|---|
void |
checkCR(org.w3c.dom.Node cr)
Checks the format of a WSSL causal relationship
|
void |
checkInp(org.w3c.dom.Node inp)
Checks the format of a WSSL input
|
void |
checkOutp(org.w3c.dom.Node outp)
Checks the format of a WSSL output
|
void |
checkPost(org.w3c.dom.Node post)
Checks the format of a WSSL postcondition
|
void |
checkPre(org.w3c.dom.Node pre)
Checks the format of a WSSL precondition
|
org.w3c.dom.NodeList |
getCR()
Returns the set of WSSL causal relationships contained in the parsed document.
|
org.w3c.dom.NodeList |
getGoals()
Returns the set of WSSL goals contained in the parsed document.
|
org.w3c.dom.NodeList |
getInp()
Returns the set of WSSL inputs contained in the parsed document.
|
org.w3c.dom.NodeList |
getOutp()
Returns the set of WSSL outputs contained in the parsed document.
|
org.w3c.dom.NodeList |
getPost()
Returns the set of WSSL postconditions contained in the parsed document.
|
org.w3c.dom.NodeList |
getPre()
Returns the set of WSSL preconditions contained in the parsed document.
|
java.lang.String |
getQoSAttribute(org.w3c.dom.Node constraintNode)
Returns the QoS attribute name associated with the constraint passes as parameter.
|
org.w3c.dom.NodeList |
getQoSConstraints(org.w3c.dom.Node profileNode)
Returns the set of QoS constraints contained in the QoS Profile given as parameter
|
java.lang.String |
getQoSOperator(org.w3c.dom.Node constraintNode)
Returns the operator involved in the constraint passed as parameter.
|
org.w3c.dom.NodeList |
getQoSProfiles()
Returns the set of QoS profiles contained in the parsed document.
|
float |
getQoSValue(org.w3c.dom.Node constraintNode)
Returns the QoS attribute value associated with the constraint passed as parameter.
|
org.w3c.dom.Node |
getService()
Returns the service information contained in the parsed document.
|
java.lang.String |
LogExpToProlog(org.w3c.dom.Node le)
Returns the FLEX (sub-)clause that corresponds to the logical expression.
|
java.lang.String |
NameToProlog(java.lang.String name,
char mode)
Translate a WSSL action or variable name to FLEX
|
boolean |
parse(java.net.URL wsslfile,
java.net.URL schemafile)
Parses and validates a WSSL file.
|
java.lang.String[] |
StateRHSToProlog(org.w3c.dom.Node le)
Returns the FLEX (sub-)clause that corresponds to the right-hand side of
the state update axiom, contained in node le.
|
java.lang.String[] |
StateUpdateToProlog(org.w3c.dom.Node su)
Returns the FLEX clause that corresponds to the state update axiom
contained in node le.
|
java.lang.String |
TermToProlog(org.w3c.dom.Node le)
Returns the FLEX (sub-)clause that corresponds to the term contained
in node le.
|
void |
writeCR(org.w3c.dom.NodeList crList,
java.nio.file.Path path)
Produces FLEX clauses for the given WSSL causal relationships.
|
java.lang.String |
writeGoals(org.w3c.dom.NodeList goalList)
Produces FLEX clauses for the given WSSL goals.
|
com.parctechnologies.eclipse.CompoundTerm[] |
writeGoalsCT(org.w3c.dom.NodeList goalList)
Produces FLEX clauses for the given WSSL goals.
|
void |
writePost(org.w3c.dom.NodeList outpList,
org.w3c.dom.NodeList postList,
java.nio.file.Path path)
Produces FLEX clauses for the given WSSL outputs and postconditions.
|
void |
writePre(org.w3c.dom.NodeList inpList,
org.w3c.dom.NodeList preList,
int numOut,
java.nio.file.Path path)
Produces FLEX clauses for the given WSSL inputs and preconditions.
|
public boolean parse(java.net.URL wsslfile, java.net.URL schemafile) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
Parser
parse
in interface Parser
wsslfile
- URL
pointing to the WSSL file to be parsedschemafile
- URL
containing the XML Schema to validate againstjavax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.NodeList getInp()
Parser
public org.w3c.dom.NodeList getOutp()
Parser
public org.w3c.dom.NodeList getPre()
Parser
public org.w3c.dom.NodeList getPost()
Parser
public org.w3c.dom.NodeList getCR()
Parser
public org.w3c.dom.NodeList getGoals()
Parser
public void writePre(org.w3c.dom.NodeList inpList, org.w3c.dom.NodeList preList, int numOut, java.nio.file.Path path) throws InvalidFormatException, java.io.IOException
Parser
writePre
in interface Parser
inpList
- a NodeList
containing WSSL input nodespreList
- a NodeList
containing WSSL precondition nodesnumOut
- the number of service outputs (necessary, to solve the singleton problem)path
- a Path
pointing to the FLEX file where the clauses are writtenInvalidFormatException
java.io.IOException
public void writePost(org.w3c.dom.NodeList outpList, org.w3c.dom.NodeList postList, java.nio.file.Path path) throws InvalidFormatException, java.io.IOException
Parser
writePost
in interface Parser
outpList
- a NodeList
containing WSSL output nodespostList
- a NodeList
containing WSSL postcondition nodespath
- a Path
pointing to the FLEX file where the clauses are writtenInvalidFormatException
java.io.IOException
public void writeCR(org.w3c.dom.NodeList crList, java.nio.file.Path path) throws InvalidFormatException, java.io.IOException
Parser
writeCR
in interface Parser
crList
- a NodeList
containing WSSL causal relationship nodespath
- a Path
pointing to the FLEX file where the clauses are writtenInvalidFormatException
java.io.IOException
public java.lang.String writeGoals(org.w3c.dom.NodeList goalList) throws InvalidFormatException
Parser
writeGoals
in interface Parser
goalList
- a NodeList
containing WSSL goalsInvalidFormatException
public java.lang.String LogExpToProlog(org.w3c.dom.Node le) throws InvalidFormatException
le
- node containing a WSSL logical expressionInvalidFormatException
public java.lang.String TermToProlog(org.w3c.dom.Node le) throws InvalidFormatException
le
- node containing a WSSL termInvalidFormatException
public java.lang.String[] StateRHSToProlog(org.w3c.dom.Node le) throws InvalidFormatException
le
- node containing the right-hand size of a WSSL state update axiomInvalidFormatException
public java.lang.String[] StateUpdateToProlog(org.w3c.dom.Node su) throws InvalidFormatException
su
- node containing a WSSL state update axiomInvalidFormatException
public void checkInp(org.w3c.dom.Node inp) throws InvalidFormatException
inp
- a Node
containing a WSSL inputInvalidFormatException
public void checkOutp(org.w3c.dom.Node outp) throws InvalidFormatException
outp
- a Node
containing a WSSL outputInvalidFormatException
public void checkPre(org.w3c.dom.Node pre) throws InvalidFormatException
pre
- a Node
containing a WSSL preconditionInvalidFormatException
public void checkPost(org.w3c.dom.Node post) throws InvalidFormatException
post
- a Node
containing a WSSL postconditionInvalidFormatException
public void checkCR(org.w3c.dom.Node cr) throws InvalidFormatException
cr
- a Node
containing a WSSL causal relationshipInvalidFormatException
public java.lang.String NameToProlog(java.lang.String name, char mode) throws InvalidFormatException
name
- the name to be translatedmode
- 'a' if the name to be translated corresponds to an action,
'v' if it corresponds to a variableInvalidFormatException
public org.w3c.dom.Node getService()
Parser
getService
in interface Parser
Node
corresponding to the WSSL service elementpublic com.parctechnologies.eclipse.CompoundTerm[] writeGoalsCT(org.w3c.dom.NodeList goalList) throws InvalidFormatException
Parser
writeGoalsCT
in interface Parser
goalList
- a NodeList
containing WSSL goalsCompoundTerm
array objectInvalidFormatException
public java.lang.String getQoSOperator(org.w3c.dom.Node constraintNode)
Parser
getQoSOperator
in interface Parser
constraintNode
- Node
containing a WSSL QoS constraintString
containing the operator namepublic java.lang.String getQoSAttribute(org.w3c.dom.Node constraintNode)
Parser
getQoSAttribute
in interface Parser
constraintNode
- Node
containing a WSSL QoS constraint*String
containing the attribute namepublic float getQoSValue(org.w3c.dom.Node constraintNode)
Parser
getQoSValue
in interface Parser
constraintNode
- Node
containing a WSSL QoS constraintpublic org.w3c.dom.NodeList getQoSProfiles()
Parser
getQoSProfiles
in interface Parser
NodeList
containing WSSL QoS profilespublic org.w3c.dom.NodeList getQoSConstraints(org.w3c.dom.Node profileNode)
Parser
getQoSConstraints
in interface Parser
profileNode
- a Node
containing a QoS Profile nodeNodeList
containing WSSL QoS constraints