|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.codegen.decl.CodeAgent
Chooses code templates from a XML file that relates to a given specification.
Field Summary | |
(package private) Hashtable |
arguments
|
(package private) static String |
ATTRID
|
(package private) static String |
CONNECTOR
|
(package private) boolean |
connectorEnabled
|
(package private) static String |
CONTRUE
|
(package private) static String |
LI
|
(package private) static String |
MISARG
|
(package private) static String |
MISPARNAME
|
(package private) static String |
NAME
|
(package private) static String |
NOPATTERN
|
(package private) static String |
NOTEMPLATE
|
(package private) static String |
PARAM
|
(package private) static String |
RULE
|
(package private) String |
ruleAndSpec
|
(package private) static String |
SPEC
|
(package private) static String |
TAGPATTERN
|
(package private) static String |
TEMPLATE
|
(package private) Document |
xmlDocument
|
(package private) static String |
XMLFILE
|
(package private) org.apache.xerces.parsers.DOMParser |
xmlParser
|
(package private) NodeList |
xmlPattern
|
Constructor Summary | |
CodeAgent(String rules)
Creates a CodeAgent object. |
Method Summary | |
void |
enableConnector()
Enables connector lines. |
private String |
getCode(Node template)
|
String |
getCodeFor(String rule,
String spec)
|
private Node |
getPatternForRule(String rule)
|
private Node |
getTemplateForSpec(Node pattern,
String spec)
|
static void |
main(String[] args)
|
void |
reset()
Cleans up the CodeAgent object. |
void |
setArgument(String argSpec,
String argCont)
Adds an argument specification to the current state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
Hashtable arguments
org.apache.xerces.parsers.DOMParser xmlParser
Document xmlDocument
NodeList xmlPattern
boolean connectorEnabled
String ruleAndSpec
static final String TAGPATTERN
static final String XMLFILE
static final String ATTRID
static final String RULE
static final String CONNECTOR
static final String CONTRUE
static final String NOPATTERN
static final String NOTEMPLATE
static final String TEMPLATE
static final String SPEC
static final String LI
static final String PARAM
static final String NAME
static final String MISARG
static final String MISPARNAME
Constructor Detail |
public CodeAgent(String rules)
rules
- the URL of the file containing the mapping rulesMethod Detail |
public static void main(String[] args)
public void setArgument(String argSpec, String argCont)
argSpec
- the name or placeholder of the argumentargCont
- the replacement for the placeholder in the templatepublic String getCodeFor(String rule, String spec) throws Exception
rule
- the name of the grammar rulespec
- a specification that determines the template more precisely
Exception
public void reset()
public void enableConnector()
private Node getPatternForRule(String rule)
private Node getTemplateForSpec(Node pattern, String spec)
private String getCode(Node template) throws Exception
Exception
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |