public final class SCXMLHelper extends Object
Modifier and Type | Method and Description |
---|---|
static void |
cloneDatamodel(Datamodel datamodel,
Context ctx,
Evaluator evaluator,
org.apache.commons.logging.Log log)
Clone data model.
|
static String |
escapeXML(String str)
Escape XML strings for serialization.
|
static Set |
getAncestorClosure(Set states,
Set upperBounds)
Creates a set which contains given states and all their ancestors
recursively up to the upper bound.
|
static TransitionTarget |
getLCA(TransitionTarget tt1,
TransitionTarget tt2)
Finds the least common ancestor of transition targets tt1 and tt2 if
one exists.
|
static String |
getNodeValue(Node node)
Retrieve a DOM node value as a string depending on its type.
|
static Set |
getStatesExited(Transition t,
Set currentStates)
Returns the set of all states (and parallels) which are exited if a
given transition t is going to be taken.
|
static boolean |
implementationOf(Class clas,
Class interfayce)
Whether the class implements the interface.
|
static boolean |
inConflict(Transition t1,
Transition t2,
Set currentStates)
According to the UML definition, two transitions
are conflicting if the sets of states they exit overlap.
|
static boolean |
isDescendant(TransitionTarget tt,
TransitionTarget ctx)
Checks whether a transition target tt (State or Parallel) is a
descendant of the transition target context.
|
static boolean |
isLegalConfig(Set states,
ErrorReporter errRep)
Checks whether a given set of states is a legal Harel State Table
configuration (with the respect to the definition of the OR and AND
states).
|
static boolean |
isStringEmpty(String attr)
Return true if the string is empty.
|
static void |
setNodeValue(Node node,
String value)
Set node value, depending on its type, from a String.
|
static boolean |
subtypeOf(Class child,
Class parent)
Whether the first argument is a subtype of the second.
|
public static boolean isStringEmpty(String attr)
attr
- The String to testpublic static boolean isDescendant(TransitionTarget tt, TransitionTarget ctx)
tt
- TransitionTarget to check - a potential descendantctx
- TransitionTarget context - a potential ancestorpublic static Set getAncestorClosure(Set states, Set upperBounds)
states
- The Set of StatesupperBounds
- The Set of upper bound Statespublic static boolean isLegalConfig(Set states, ErrorReporter errRep)
states
- a set of stateserrRep
- ErrorReporter to report detailed error info if neededpublic static TransitionTarget getLCA(TransitionTarget tt1, TransitionTarget tt2)
tt1
- First TransitionTargettt2
- Second TransitionTargetpublic static Set getStatesExited(Transition t, Set currentStates)
t
- transition to be takencurrentStates
- the set of current states (simple states only)public static boolean inConflict(Transition t1, Transition t2, Set currentStates)
t1
- a transition to check against t2t2
- a transition to check against t1currentStates
- the set of current states (simple states only)getStatesExited(Transition, Set)
public static boolean subtypeOf(Class child, Class parent)
child
- The candidate subtypeparent
- The supertypepublic static boolean implementationOf(Class clas, Class interfayce)
clas
- The candidate classinterfayce
- The interfacepublic static void setNodeValue(Node node, String value)
node
- A Node whose value is to be setvalue
- The new valuepublic static String getNodeValue(Node node)
node
- A node to be retreivedpublic static void cloneDatamodel(Datamodel datamodel, Context ctx, Evaluator evaluator, org.apache.commons.logging.Log log)
ctx
- The context to clone to.datamodel
- The datamodel to clone.evaluator
- The expression evaluator.log
- The error log.Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.