|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--DocumentReader
|
+--HierarchicalDocumentReader
| Field Summary | |
(package private) static boolean |
debug
Spam out debuggin information, if debug is true |
private static long |
fakeIDCounter
AUX counter to create unique fake IDs |
private static java.lang.String |
fakeIDName
Name of Component IDs that are not present in the original document used in wrapAroundInstHashTable. |
static java.lang.String |
huppaalDTD
Version of the hierarchical Huppaal grammar |
private org.w3c.dom.Element |
oldRoot
original, hierarchical document-root |
private static java.lang.String |
unambigousNameSeparator
Separate Strings (names) for hashing |
(package private) static boolean |
useLabelConstruct
Determines whether translations uses the <label> construct for assignments, guards and synchronisations. |
(package private) static boolean |
useLabelForInvariants
Determines whether translations uses the <label> construct also for invariants. |
private java.util.Hashtable |
wrapAroundInstHashTable
Hashing global element names to dummy component Elements |
| Fields inherited from class DocumentReader |
hashOriginalIDsToElements, origDoc, sanityChecks |
| Constructor Summary | |
HierarchicalDocumentReader(org.w3c.dom.Document theDoc)
Default Constructor |
|
| Method Summary | |
void |
addGuardsAndAssignmentsOfConnectionInContext(org.w3c.dom.Element connection,
java.util.Vector guards,
java.util.Vector assignments,
java.lang.Object contextOfIt)
The TexualInstantiaion is handed over for context information (i.e. |
private void |
addIDAndElementToHashTable(java.lang.String ID,
org.w3c.dom.Element el)
Make hash table entries for Elements that are not accessible in the original document Used to retrieve components with fake IDs. |
void |
collectGuardsAndAssignmentsOfTarget(org.w3c.dom.Element target,
java.util.Vector guards,
java.util.Vector assignments,
java.lang.Object context)
Traverses the entry-fork starting with this target (which is assumed to point at a component and an entry) The guards and assignments present in the connections are collected textually (Vector of strings), without any assumption on the order. NOTE:The result of this process possibly has to be adjusted to the current instantiation (i.e., names have to be mapped) The information for this can be extraced from the context, which is a list (stack?) of renamings. |
void |
createJoinsForGlobalExits(TextualInstantiation tinst,
org.w3c.dom.Element globalEntry)
Create the Joins for stopping global elements (direct children of root); |
java.lang.String |
docToString()
Return the original document as string |
org.w3c.dom.NodeList |
getAllAliveGlobalInits()
Return the list of global inits, that refer to a root element that is part of the system. |
private org.w3c.dom.NodeList |
getAllChildrenThatAreAssignments(org.w3c.dom.Element connection)
Retrieve all child nodes that are assignments. |
private org.w3c.dom.NodeList |
getAllChildrenThatAreGuards(org.w3c.dom.Element connection)
Retrieve all child nodes that are guards. |
private org.w3c.dom.NodeList |
getAllChildrenThatAreSynchronisation(org.w3c.dom.Element connection)
Retrieve all child nodes that are synchronisations. |
java.util.Vector |
getAllExitsOfComponent(org.w3c.dom.Element component)
Returns a Vector of exit Elements, that correspond to the exits of the template this component instantiates. |
static java.util.Vector |
getAllExitsOfTemplate(org.w3c.dom.Element template)
Returns a Vector of exit Elements, that correspond to the exits of this template. |
static java.util.Vector |
getAllLocationsAndComponents(org.w3c.dom.Element template)
Return a vector with all locations and components. |
org.w3c.dom.NodeList |
getAllTemplates()
Return the (complete) list of defined hierarchical templates |
private org.w3c.dom.Element |
getConnectionOfEntry(org.w3c.dom.Element entry)
Returns the (one) connection an entry points to |
java.util.Vector |
getConnectionsToExitOrExitpoint(org.w3c.dom.Element exitOrExitpoint)
Returns s Vector of Elements, containing all the pointing-to connections. |
java.lang.String |
getDeclarationText()
Retrieve the texutal declaration data from element tag, if present |
org.w3c.dom.NodeList |
getDirectChildNodes()
All direct Children of root |
org.w3c.dom.NodeList |
getDirectChildNodesWithTag(java.lang.String tag)
Some direct children of root |
private org.w3c.dom.Element |
getEntryATargetPointsTo(org.w3c.dom.Element target)
Returns the (one) <entry&rt; element that a target points to |
org.w3c.dom.Element |
getForkElementOfEntry(org.w3c.dom.Element entry)
Map <entry> or <entrypoint> to the (single) corresponding fork Element. Throws exception, if used wrongly or in wrong context. |
java.lang.String |
getInstantiationText()
Retrieve the texutal instantiation data from element tag, if present |
java.util.Vector |
getNamesOfAliveSystemParts()
Browse the system definition to get the name of instantiations that are declared to be part of the top-level parallel composition. |
java.lang.String |
getSystemText()
Retrieve the texutal system data from element tag, if present |
org.w3c.dom.Element |
getTargetElementOfEntry(org.w3c.dom.Element entry)
Map <entry> or <entrypoint> to the (single) corresponding target Element. Throws exception, if used wrongly or in wrong context. |
org.w3c.dom.NodeList |
getTargetsOfFork(org.w3c.dom.Element fork)
|
org.w3c.dom.Element |
getTemplateWithName(java.lang.String name)
Returns the Element in the original (hierarchical) document, that has the specified name. Throws Exception, if not found. |
java.lang.String |
getTextualAssignmentOfTransitionIfPresent(org.w3c.dom.Element transition)
Returns the text of a assignment, if present and not the empty string, otherwise, returns null. Throws Exception, if not called on transition or connection. |
java.lang.String |
getTextualGuardOfTransitionIfPresent(org.w3c.dom.Element transition)
Returns the text of a guard, if present and not the empty string, otherwise, returns null. Throws Exception, if not called on transition or connection. |
static org.w3c.dom.Element |
getTheChildAssignmentIfExists(org.w3c.dom.Element connection)
Retrieve (if existent) the child that is assignment. Return null, if it does not exist. Throws exception, if more than two such children exist. |
static org.w3c.dom.Element |
getTheChildGuardIfExists(org.w3c.dom.Element connection)
Retrieve (if existent) the child that is guard. Return null, if it does not exist. Throws exception, if more than two such children exist. |
static org.w3c.dom.Element |
getTheChildInvariantIfExists(org.w3c.dom.Element connection)
Retrieve (if existent) the child that is invariant. Return null, if it does not exist. Throws exception, if more than two such children exist. |
static org.w3c.dom.Element |
getTheChildSynchronisationIfExists(org.w3c.dom.Element connection)
Retrieve (if existent) the child that is synchronisation. Return null, if it does not exist. Throws exception, if more than two such children exist. |
static boolean |
hasDefaultExit(org.w3c.dom.Element template)
Checks whether this template has a default exit. |
boolean |
isANDComponent(org.w3c.dom.Element component)
Returns true, if the component is isantiation of an AND template. Trows Exception, if called on a non-component |
boolean |
isANDTemplate(org.w3c.dom.Element template)
Returns true, if the template is an AND element. Trows Exception, if called on a non-template |
static boolean |
isAssignmentElement(org.w3c.dom.Node n)
Test, whether this is an assignment Element. Depends on useLabelConstruct. |
static boolean |
isComponent(org.w3c.dom.Element el)
Test whether this element is a component. Throws Exception, if the element is not a location or component. |
static boolean |
isDefaultExitOrExitpoint(org.w3c.dom.Element exitOrExitpoint)
Returns true, if the element is a default exit or an exitpoint. Throws exception on type error. |
static boolean |
isGuardElement(org.w3c.dom.Node n)
Test, whether this is an guard Element. Depends on useLabelConstruct. |
boolean |
isHistoryComponent(org.w3c.dom.Element component)
Returns true, if the component is a history element. Trows Exception, if called on a non-component |
static boolean |
isHistoryEntry(org.w3c.dom.Element entry)
Returns true, if the entry is a history element. Trows Exception, if called on a non-entry |
boolean |
isHistoryTemplate(org.w3c.dom.Element template)
Returns true, if the template is a history element. Trows Exception, if called on a non-template |
static boolean |
isInvariantElement(org.w3c.dom.Node n)
Test, whether this is an invariant Element. Depends on useLabelConstruct. |
static boolean |
isNailElement(org.w3c.dom.Node n)
Test, whether a node is an Element and a nail |
static boolean |
isSourceElement(org.w3c.dom.Node n)
Test, whether a node is an Element and a source |
static boolean |
isSynchronisationElement(org.w3c.dom.Node n)
Test, whether this is an synchronisation Element. Depends on useLabelConstruct. |
static boolean |
isTargetElement(org.w3c.dom.Node n)
Test, whether a node is an Element and a target |
static java.util.Vector |
splitCommaSeperatedString(java.lang.String s)
Given a string containing a comma-speparated list, split it into a vector of Strings (without the commata). Trims the strings (cuts away whitespaces). |
org.w3c.dom.Element |
wrapComponentAroundGlobalInstantiation(java.lang.String instName,
java.lang.String templateName)
Returns a (dummy) component Element, that points to a global instantiation. Once constructed, these Elements are stored in a Hashtable, so the result on the same call will be unique. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final boolean useLabelConstruct
static final boolean useLabelForInvariants
public static final java.lang.String huppaalDTD
private org.w3c.dom.Element oldRoot
private java.util.Hashtable wrapAroundInstHashTable
private static final java.lang.String unambigousNameSeparator
private static final java.lang.String fakeIDName
wrapAroundInstHashTable.private static long fakeIDCounter
static boolean debug
| Constructor Detail |
public HierarchicalDocumentReader(org.w3c.dom.Document theDoc)
| Method Detail |
public org.w3c.dom.NodeList getDirectChildNodes()
public org.w3c.dom.NodeList getDirectChildNodesWithTag(java.lang.String tag)
public org.w3c.dom.Element getTemplateWithName(java.lang.String name)
throws java.lang.Exception
public org.w3c.dom.NodeList getAllTemplates()
public org.w3c.dom.NodeList getAllAliveGlobalInits()
throws java.lang.Exception
public java.lang.String getSystemText()
throws java.lang.Exception
public java.lang.String getInstantiationText()
throws java.lang.Exception
public java.lang.String getDeclarationText()
throws java.lang.Exception
public java.util.Vector getAllExitsOfComponent(org.w3c.dom.Element component)
throws java.lang.Exception
public static java.util.Vector getAllExitsOfTemplate(org.w3c.dom.Element template)
throws java.lang.Exception
public static java.util.Vector getAllLocationsAndComponents(org.w3c.dom.Element template)
throws java.lang.Exception
public static boolean isComponent(org.w3c.dom.Element el)
throws java.lang.Exception
public static boolean isDefaultExitOrExitpoint(org.w3c.dom.Element exitOrExitpoint)
throws java.lang.Exception
public static boolean hasDefaultExit(org.w3c.dom.Element template)
throws java.lang.Exception
public boolean isHistoryTemplate(org.w3c.dom.Element template)
throws java.lang.Exception
public boolean isANDTemplate(org.w3c.dom.Element template)
throws java.lang.Exception
public boolean isHistoryComponent(org.w3c.dom.Element component)
throws java.lang.Exception
public boolean isANDComponent(org.w3c.dom.Element component)
throws java.lang.Exception
public static boolean isHistoryEntry(org.w3c.dom.Element entry)
throws java.lang.Exception
public static boolean isTargetElement(org.w3c.dom.Node n)
public static boolean isSourceElement(org.w3c.dom.Node n)
public static boolean isNailElement(org.w3c.dom.Node n)
public static boolean isAssignmentElement(org.w3c.dom.Node n)
useLabelConstruct.public static boolean isGuardElement(org.w3c.dom.Node n)
useLabelConstruct.public static boolean isSynchronisationElement(org.w3c.dom.Node n)
useLabelConstruct.public static boolean isInvariantElement(org.w3c.dom.Node n)
useLabelConstruct.
public org.w3c.dom.Element getForkElementOfEntry(org.w3c.dom.Element entry)
throws java.lang.Exception
public org.w3c.dom.Element getTargetElementOfEntry(org.w3c.dom.Element entry)
throws java.lang.Exception
public org.w3c.dom.NodeList getTargetsOfFork(org.w3c.dom.Element fork)
throws java.lang.Exception
public void collectGuardsAndAssignmentsOfTarget(org.w3c.dom.Element target,
java.util.Vector guards,
java.util.Vector assignments,
java.lang.Object context)
throws java.lang.Exception
public void addGuardsAndAssignmentsOfConnectionInContext(org.w3c.dom.Element connection,
java.util.Vector guards,
java.util.Vector assignments,
java.lang.Object contextOfIt)
throws java.lang.Exception
public java.util.Vector getNamesOfAliveSystemParts()
throws java.lang.Exception
private org.w3c.dom.NodeList getAllChildrenThatAreAssignments(org.w3c.dom.Element connection)
private org.w3c.dom.NodeList getAllChildrenThatAreGuards(org.w3c.dom.Element connection)
private org.w3c.dom.NodeList getAllChildrenThatAreSynchronisation(org.w3c.dom.Element connection)
private org.w3c.dom.Element getEntryATargetPointsTo(org.w3c.dom.Element target)
throws java.lang.Exception
public java.util.Vector getConnectionsToExitOrExitpoint(org.w3c.dom.Element exitOrExitpoint)
throws java.lang.Exception
DocumentReader.sanityChecks is true - or if there are no
ingoing
connections.
private org.w3c.dom.Element getConnectionOfEntry(org.w3c.dom.Element entry)
throws java.lang.Exception
public java.lang.String getTextualGuardOfTransitionIfPresent(org.w3c.dom.Element transition)
throws java.lang.Exception
public java.lang.String getTextualAssignmentOfTransitionIfPresent(org.w3c.dom.Element transition)
throws java.lang.Exception
public static org.w3c.dom.Element getTheChildAssignmentIfExists(org.w3c.dom.Element connection)
throws java.lang.Exception
public static org.w3c.dom.Element getTheChildGuardIfExists(org.w3c.dom.Element connection)
throws java.lang.Exception
public static org.w3c.dom.Element getTheChildSynchronisationIfExists(org.w3c.dom.Element connection)
throws java.lang.Exception
public static org.w3c.dom.Element getTheChildInvariantIfExists(org.w3c.dom.Element connection)
throws java.lang.Exception
public java.lang.String docToString()
public void createJoinsForGlobalExits(TextualInstantiation tinst,
org.w3c.dom.Element globalEntry)
throws java.lang.Exception
public static java.util.Vector splitCommaSeperatedString(java.lang.String s)
public org.w3c.dom.Element wrapComponentAroundGlobalInstantiation(java.lang.String instName,
java.lang.String templateName)
throws java.lang.Exception
private void addIDAndElementToHashTable(java.lang.String ID,
org.w3c.dom.Element el)
throws java.lang.Exception
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||