| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
action |
private org.w3c.dom.Document |
doc |
private java.util.ArrayList<java.lang.String> |
variables |
| Constructor and Description |
|---|
DOMParser2() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkCR(org.w3c.dom.Node cr)
Checks the format of a WSSL causal relationship
|
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.
|
int |
getSize()
Returns the size of the variables array
|
java.lang.String |
getVariable(int position)
Returns the String at the given position of the variables array
|
com.parctechnologies.eclipse.CompoundTerm |
LogExpToCompoundTerm(org.w3c.dom.Node le)
Returns the FLEX (sub-)clause that corresponds to the logical expression.
|
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.
|
com.parctechnologies.eclipse.CompoundTerm |
TermToCompoundTerm(org.w3c.dom.Node le)
Returns the FLEX (sub-)clause that corresponds to the term 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.
|
private org.w3c.dom.Document doc
private java.lang.String action
private java.util.ArrayList<java.lang.String> variables
public boolean parse(java.net.URL wsslfile,
java.net.URL schemafile)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
Parserparse in interface Parserwsslfile - URL pointing to the WSSL file to be parsedschemafile - URL containing the XML Schema to validate againstjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic org.w3c.dom.NodeList getInp()
Parserpublic org.w3c.dom.NodeList getOutp()
Parserpublic org.w3c.dom.NodeList getPre()
Parserpublic org.w3c.dom.NodeList getPost()
Parserpublic org.w3c.dom.NodeList getCR()
Parserpublic org.w3c.dom.NodeList getGoals()
Parserpublic org.w3c.dom.NodeList getQoSProfiles()
ParsergetQoSProfiles in interface ParserNodeList containing WSSL QoS profilespublic org.w3c.dom.NodeList getQoSConstraints(org.w3c.dom.Node profileNode)
ParsergetQoSConstraints in interface ParserprofileNode - a Node containing a QoS Profile nodeNodeList containing WSSL QoS constraintspublic java.lang.String getQoSOperator(org.w3c.dom.Node constraintNode)
ParsergetQoSOperator in interface ParserconstraintNode - Node containing a WSSL QoS constraintString containing the operator namepublic java.lang.String getQoSAttribute(org.w3c.dom.Node constraintNode)
ParsergetQoSAttribute in interface ParserconstraintNode - Node containing a WSSL QoS constraint*String containing the attribute namepublic float getQoSValue(org.w3c.dom.Node constraintNode)
ParsergetQoSValue in interface ParserconstraintNode - Node containing a WSSL QoS constraintpublic org.w3c.dom.Node getService()
ParsergetService in interface ParserNode corresponding to the WSSL service elementpublic void writePre(org.w3c.dom.NodeList inpList,
org.w3c.dom.NodeList preList,
int numOut,
java.nio.file.Path path)
throws InvalidFormatException,
java.io.IOException
ParserwritePre in interface ParserinpList - 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 writtenInvalidFormatExceptionjava.io.IOExceptionpublic void writePost(org.w3c.dom.NodeList outpList,
org.w3c.dom.NodeList postList,
java.nio.file.Path path)
throws InvalidFormatException,
java.io.IOException
ParserwritePost in interface ParseroutpList - a NodeList containing WSSL output nodespostList - a NodeList containing WSSL postcondition nodespath - a Path pointing to the FLEX file where the clauses are writtenInvalidFormatExceptionjava.io.IOExceptionpublic void writeCR(org.w3c.dom.NodeList crList,
java.nio.file.Path path)
throws InvalidFormatException,
java.io.IOException
ParserwriteCR in interface ParsercrList - a NodeList containing WSSL causal relationship nodespath - a Path pointing to the FLEX file where the clauses are writtenInvalidFormatExceptionjava.io.IOExceptionpublic java.lang.String writeGoals(org.w3c.dom.NodeList goalList)
throws InvalidFormatException
ParserwriteGoals in interface ParsergoalList - a NodeList containing WSSL goalsInvalidFormatExceptionpublic com.parctechnologies.eclipse.CompoundTerm[] writeGoalsCT(org.w3c.dom.NodeList goalList)
throws InvalidFormatException
ParserwriteGoalsCT in interface ParsergoalList - a NodeList containing WSSL goalsCompoundTerm array objectInvalidFormatExceptionpublic com.parctechnologies.eclipse.CompoundTerm LogExpToCompoundTerm(org.w3c.dom.Node le)
throws InvalidFormatException
le - node containing a WSSL logical expressionCompoundTerm containing the FLEX clauseInvalidFormatExceptionpublic com.parctechnologies.eclipse.CompoundTerm TermToCompoundTerm(org.w3c.dom.Node le)
throws InvalidFormatException
le - node containing a WSSL termCompoundTerm containing the FLEX clauseInvalidFormatExceptionpublic java.lang.String LogExpToProlog(org.w3c.dom.Node le)
throws InvalidFormatException
le - node containing a WSSL logical expressionInvalidFormatExceptionpublic java.lang.String TermToProlog(org.w3c.dom.Node le)
throws InvalidFormatException
le - node containing a WSSL termInvalidFormatExceptionpublic java.lang.String[] StateRHSToProlog(org.w3c.dom.Node le)
throws InvalidFormatException
le - node containing the right-hand size of a WSSL state update axiomInvalidFormatExceptionpublic java.lang.String[] StateUpdateToProlog(org.w3c.dom.Node su)
throws InvalidFormatException
su - node containing a WSSL state update axiomInvalidFormatExceptionpublic void checkCR(org.w3c.dom.Node cr)
throws InvalidFormatException
cr - a Node containing a WSSL causal relationshipInvalidFormatExceptionpublic 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 variableInvalidFormatExceptionpublic java.lang.String getVariable(int position)
position - index of the String to returnpublic int getSize()