fi.hut.tml.xsmiles.mlfc.xforms.constraint
Class DynamicDependencyHandler.Dependency

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.constraint.DynamicDependencyHandler.Dependency
All Implemented Interfaces:
FunctionChangeListener, InstanceItemListener
Direct Known Subclasses:
DynamicDependencyHandler.ValueDependency
Enclosing class:
DynamicDependencyHandler

public class DynamicDependencyHandler.Dependency
extends java.lang.Object
implements InstanceItemListener, FunctionChangeListener


Nested Class Summary
 class DynamicDependencyHandler.Dependency.RealNodeList
           
 class DynamicDependencyHandler.Dependency.ValueChangeListener
          this class listens for the change in the referred nodeset
 
Field Summary
protected static int afterValueChangeState
           
protected  short binding_state
          the current binding state, one of the above
 int bindingType
           
protected static int defaultDirtyState
           
protected  int dirtyState
           
protected  boolean hasFunctionReferences
           
protected  DynamicDependencyListener listener
           
static int NODESET_BINDING
           
static int READONLY_DIRTY
           
static int RELEVANT_DIRTY
           
static int REQUIRED_DIRTY
           
static int SINGLENODE_BINDING
           
static int VALID_DIRTY
           
static int VALUE_BINDING
           
static int VALUE_DIRTY
           
protected  DynamicDependencyHandler.Dependency.ValueChangeListener valueChangeListener
           
protected  LookupResult xpathresult
           
 
Constructor Summary
DynamicDependencyHandler.Dependency(int aBindingType)
           
 
Method Summary
 void checkStyling()
           
 void checkValidity(InstanceItem item)
          An instance item instructs the control to check its status, when the status changes
 void checkVisibility(InstanceItem item)
          An instance item instructs the control to check its status, when the status changes
 void clearAllDirtyFlags()
           
protected  org.w3c.dom.NodeList convertToTrueNodeList(org.w3c.dom.NodeList nodes)
           
 void destroy()
           
protected  void dumpList(org.w3c.dom.NodeList list)
          dump list contents
protected  org.w3c.dom.NodeList executeAndGetBoundNodeset(DynamicDependencyListener l)
           
protected  void executeAndGetReferredNodes(DynamicDependencyListener l, LookupResult result)
           
 void functionValueChanged(java.lang.String function)
           
 short getBindingState()
           
 int getBindingType()
           
 org.w3c.dom.NodeList getBoundNodes()
           
 DynamicDependencyListener getDependencyListener()
           
 org.w3c.dom.Node getRefNode()
           
 boolean hasDirtyFlags()
           
protected  boolean hasNode(org.w3c.dom.Node n, org.w3c.dom.NodeList list)
          see, if a node is contained in a nodelist
 void init(DynamicDependencyListener depListener)
           
protected  boolean isDifferentSet(org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
          compares two sets
 void notifyError(java.lang.Exception e, boolean atSubmission)
          notify this listener that there was an error in the value of the instance item.
 void reevaluateBinding()
          execute the XPath and see if the bound nodeset has changed.
protected  void removeBoundListeners()
           
protected  void removeNodeListFromVector(org.w3c.dom.NodeList list, java.util.Vector vect)
           
protected  void removeRefListeners()
           
 void setDirtyState(int stateids, boolean val, boolean addToDirtyList)
           
 void setReadonly(boolean readonly)
           
 void setRequired(boolean required)
           
 boolean testAndClearDirtyState(int stateid)
           
 boolean testDirtyState(int stateids)
           
 void valueChanged(java.lang.String newValue)
          The value of this instanceItem has changed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xpathresult

protected LookupResult xpathresult

SINGLENODE_BINDING

public static final int SINGLENODE_BINDING
See Also:
Constant Field Values

NODESET_BINDING

public static final int NODESET_BINDING
See Also:
Constant Field Values

VALUE_BINDING

public static final int VALUE_BINDING
See Also:
Constant Field Values

bindingType

public int bindingType

hasFunctionReferences

protected boolean hasFunctionReferences

listener

protected DynamicDependencyListener listener

valueChangeListener

protected DynamicDependencyHandler.Dependency.ValueChangeListener valueChangeListener

binding_state

protected short binding_state
the current binding state, one of the above


VALID_DIRTY

public static final int VALID_DIRTY
See Also:
Constant Field Values

REQUIRED_DIRTY

public static final int REQUIRED_DIRTY
See Also:
Constant Field Values

READONLY_DIRTY

public static final int READONLY_DIRTY
See Also:
Constant Field Values

RELEVANT_DIRTY

public static final int RELEVANT_DIRTY
See Also:
Constant Field Values

VALUE_DIRTY

public static final int VALUE_DIRTY
See Also:
Constant Field Values

defaultDirtyState

protected static final int defaultDirtyState
See Also:
Constant Field Values

afterValueChangeState

protected static final int afterValueChangeState
See Also:
Constant Field Values

dirtyState

protected int dirtyState
Constructor Detail

DynamicDependencyHandler.Dependency

public DynamicDependencyHandler.Dependency(int aBindingType)
Method Detail

init

public void init(DynamicDependencyListener depListener)
          throws java.lang.Exception
Throws:
java.lang.Exception

getDependencyListener

public DynamicDependencyListener getDependencyListener()

getBindingState

public short getBindingState()
Returns:
the current binding state

testDirtyState

public boolean testDirtyState(int stateids)

setDirtyState

public void setDirtyState(int stateids,
                          boolean val,
                          boolean addToDirtyList)

hasDirtyFlags

public boolean hasDirtyFlags()

testAndClearDirtyState

public boolean testAndClearDirtyState(int stateid)

executeAndGetReferredNodes

protected void executeAndGetReferredNodes(DynamicDependencyListener l,
                                          LookupResult result)
                                   throws java.lang.Exception
Returns:
all the nodes that the xpath expression refers to. Note! this will also return the nodes that are result of the expression
Throws:
java.lang.Exception

executeAndGetBoundNodeset

protected org.w3c.dom.NodeList executeAndGetBoundNodeset(DynamicDependencyListener l)
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

removeNodeListFromVector

protected void removeNodeListFromVector(org.w3c.dom.NodeList list,
                                        java.util.Vector vect)

dumpList

protected void dumpList(org.w3c.dom.NodeList list)
dump list contents


isDifferentSet

protected boolean isDifferentSet(org.w3c.dom.NodeList nl1,
                                 org.w3c.dom.NodeList nl2)
compares two sets


hasNode

protected boolean hasNode(org.w3c.dom.Node n,
                          org.w3c.dom.NodeList list)
see, if a node is contained in a nodelist


getBoundNodes

public org.w3c.dom.NodeList getBoundNodes()

getRefNode

public org.w3c.dom.Node getRefNode()

convertToTrueNodeList

protected org.w3c.dom.NodeList convertToTrueNodeList(org.w3c.dom.NodeList nodes)

reevaluateBinding

public void reevaluateBinding()
                       throws java.lang.Exception
execute the XPath and see if the bound nodeset has changed. if changed, then update internal listeners and notify the listener

Throws:
java.lang.Exception

removeBoundListeners

protected void removeBoundListeners()

removeRefListeners

protected void removeRefListeners()

destroy

public void destroy()

checkValidity

public void checkValidity(InstanceItem item)
An instance item instructs the control to check its status, when the status changes

Specified by:
checkValidity in interface InstanceItemListener

checkVisibility

public void checkVisibility(InstanceItem item)
An instance item instructs the control to check its status, when the status changes

Specified by:
checkVisibility in interface InstanceItemListener

notifyError

public void notifyError(java.lang.Exception e,
                        boolean atSubmission)
notify this listener that there was an error in the value of the instance item. This can be schema validity, constraint, required etc.

Specified by:
notifyError in interface InstanceItemListener

setReadonly

public void setReadonly(boolean readonly)
Specified by:
setReadonly in interface InstanceItemListener

setRequired

public void setRequired(boolean required)
Specified by:
setRequired in interface InstanceItemListener

valueChanged

public void valueChanged(java.lang.String newValue)
The value of this instanceItem has changed

Specified by:
valueChanged in interface InstanceItemListener

getBindingType

public int getBindingType()

functionValueChanged

public void functionValueChanged(java.lang.String function)
Specified by:
functionValueChanged in interface FunctionChangeListener

checkStyling

public void checkStyling()
Specified by:
checkStyling in interface InstanceItemListener

clearAllDirtyFlags

public void clearAllDirtyFlags()


X-Smiles 1.2