org.openarchitectureware.xpand2.debug
Class XpandElementAdapter

java.lang.Object
  extended by org.openarchitectureware.expression.debug.ExpressionElementAdapter
      extended by org.openarchitectureware.xpand2.debug.XpandElementAdapter
All Implemented Interfaces:
IElementAdapter

public class XpandElementAdapter
extends ExpressionElementAdapter

The IElementAdapter implementation for Xpand statements.

Author:
Clemens Kadura (zAJKa)

Field Summary
static java.lang.String TYPE
           
 
Fields inherited from class org.openarchitectureware.expression.debug.ExpressionElementAdapter
context, pres, specials
 
Constructor Summary
XpandElementAdapter()
           
 
Method Summary
 boolean canHandle(java.lang.Object element)
          returns true, if the implementation handles the element type
 SyntaxElementTO createEndElementTO(java.lang.Object element)
          computes a SyntaxElementTO for a surrounding element representing the end position to be highlighted before returning
the containerName should be the name of the file that holds the element
the element name should be a description of the end element
start, end and line should point to the end text to be highlighted
 java.lang.Object findElement(SyntaxElementTO se, java.lang.Object actual, int flag)
          find the element that corresponds to the given syntax element information
 java.lang.String getAdapterType()
          a unique type must be provided for each implementation
 java.util.List<NameValuePair> getVariables(java.lang.Object element)
          collect all available variables for a given element.
 boolean isSurroundingElement(java.lang.Object element)
          returns whether the element has a body and debugger shall stop again at the end of the execution of that element
 boolean shallHandle(java.lang.Object element)
          this method is called from the DebugMonitor prior to all other suspension activities (e.g. breakpoint check, subroutine level check)
this provides the opportunity to handle specific elements individually
Normal return value should be true
 
Methods inherited from class org.openarchitectureware.expression.debug.ExpressionElementAdapter
checkVariableHasMembers, createElementTO, getAllFeatures, getAllVisibleVariables, getContext, getVariableDetailRep, getVariableSimpleRep, setContext, shallSuspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values
Constructor Detail

XpandElementAdapter

public XpandElementAdapter()
Method Detail

getAdapterType

public java.lang.String getAdapterType()
Description copied from interface: IElementAdapter
a unique type must be provided for each implementation

Specified by:
getAdapterType in interface IElementAdapter
Overrides:
getAdapterType in class ExpressionElementAdapter
Returns:
the adapterType

canHandle

public boolean canHandle(java.lang.Object element)
Description copied from interface: IElementAdapter
returns true, if the implementation handles the element type

Specified by:
canHandle in interface IElementAdapter
Overrides:
canHandle in class ExpressionElementAdapter
Parameters:
element - the element that is going to be debugged
Returns:
true, if this class handles the element type

shallHandle

public boolean shallHandle(java.lang.Object element)
Description copied from interface: IElementAdapter
this method is called from the DebugMonitor prior to all other suspension activities (e.g. breakpoint check, subroutine level check)
this provides the opportunity to handle specific elements individually
Normal return value should be true

Specified by:
shallHandle in interface IElementAdapter
Overrides:
shallHandle in class ExpressionElementAdapter
Parameters:
element - the element that is going to be debugged
Returns:
whether or not to suspend the debugger process for the element

isSurroundingElement

public boolean isSurroundingElement(java.lang.Object element)
Description copied from interface: IElementAdapter
returns whether the element has a body and debugger shall stop again at the end of the execution of that element

Specified by:
isSurroundingElement in interface IElementAdapter
Overrides:
isSurroundingElement in class ExpressionElementAdapter
Parameters:
element - the element that is debugged currently
Returns:
whether the element has a body

createEndElementTO

public SyntaxElementTO createEndElementTO(java.lang.Object element)
Description copied from interface: IElementAdapter
computes a SyntaxElementTO for a surrounding element representing the end position to be highlighted before returning
the containerName should be the name of the file that holds the element
the element name should be a description of the end element
start, end and line should point to the end text to be highlighted

Specified by:
createEndElementTO in interface IElementAdapter
Overrides:
createEndElementTO in class ExpressionElementAdapter
Parameters:
element - the element that is going to be debugged
Returns:
a SyntaxElementTO that contains the information to be shown in the debugger views in a common neutral way

getVariables

public java.util.List<NameValuePair> getVariables(java.lang.Object element)
Description copied from interface: IElementAdapter
collect all available variables for a given element. With this method only the variables themselfs are collected, not their members.
Implementations must consider that elementcan be both a syntax element or an arbitrary java element to collect the member variables from!!

Specified by:
getVariables in interface IElementAdapter
Overrides:
getVariables in class ExpressionElementAdapter
Parameters:
element - the current element
Returns:
a name/value list that contains the variables

findElement

public java.lang.Object findElement(SyntaxElementTO se,
                                    java.lang.Object actual,
                                    int flag)
Description copied from interface: IElementAdapter
find the element that corresponds to the given syntax element information

Specified by:
findElement in interface IElementAdapter
Overrides:
findElement in class ExpressionElementAdapter
Parameters:
se - the syntax element transfer object
Returns:
the corresponding element