com.ibm.pdp.engine
Interface IMicroPatternProcessingContext


public interface IMicroPatternProcessingContext

An IMicroPatternProcessingContext is associated with a IMicroPattern to further describe the processing context in which this Micro Pattern expanding occurs


Field Summary
static java.lang.String copyright
           
 
Method Summary
 java.util.Iterator<java.lang.String> getAllAttributeNames()
           
 java.lang.String getAttribute(java.lang.String attributeName)
           
 java.lang.Object getData(java.lang.String key)
           
 com.ibm.pdp.engine.IGeneratedInfo getGeneratedInfo()
           
 IMicroPatternGenerationProperties getGenerationProperties()
          Returns the generation properties.
 int getStatus()
           
 boolean inUserCode()
           
 java.util.Iterator referenceIterator()
           
 void registerReference(java.lang.Object reference)
          Convenience method to help collect references during the processing of MPs
 void setAttribute(java.lang.String attributeName, java.lang.String value)
          Sets the given attribute in the Micro-Pattern Processing Context so that it is available for further reference by Micro-Pattern handlers.
 void setData(java.lang.String key, java.lang.Object data)
          Sets the given Object data in the Micro-Pattern Processing Context so that it is available for further reference by Micro-Pattern handlers.
 void setGenerationProperties(IMicroPatternGenerationProperties properties)
          Sets the generation properties.
 void setStatus(int status, int location, java.lang.String msg, java.lang.String userAction)
          Sets the current processing status, message and associated action
In case status is IMicroPattern.UNRECOVERABLE_ERROR or IMicroPattern.WARNING_RAISED
the getStatus() method will no more return IMicroPattern.STATUS_OK.
 java.util.Iterator<com.ibm.pdp.engine.extension.IProcessingStatus> statusStack()
           
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getAllAttributeNames

java.util.Iterator<java.lang.String> getAllAttributeNames()
Returns:
the whole list of already set attributes

getAttribute

java.lang.String getAttribute(java.lang.String attributeName)
Parameters:
attributeName -
Returns:
the given attribute's name associated value, or null if this attribute has not been already set
This is a convenience method for String attributes

getData

java.lang.Object getData(java.lang.String key)
Parameters:
key -
Returns:
the given key associated data, or null if this key has not been already set

getGeneratedInfo

com.ibm.pdp.engine.IGeneratedInfo getGeneratedInfo()
Returns:
the IGeneratedInfo associated with the current source code

getGenerationProperties

IMicroPatternGenerationProperties getGenerationProperties()
Returns the generation properties.

Returns:

getStatus

int getStatus()
Returns:
the current processing status for this context

inUserCode

boolean inUserCode()
Returns:
whether or not this Micro-Pattern is processed as a generated code or as a user-code

referenceIterator

java.util.Iterator referenceIterator()
Returns:
an Iterator on the list of registered references

registerReference

void registerReference(java.lang.Object reference)
Convenience method to help collect references during the processing of MPs

Parameters:
reference -
key -

setAttribute

void setAttribute(java.lang.String attributeName,
                  java.lang.String value)
Sets the given attribute in the Micro-Pattern Processing Context so that it is available for further reference by Micro-Pattern handlers.
A best practice for Micro-Pattern handlers is to prefix the attribute's name by the namespace. Therefore, com.ibm.pdp.pacbase.LoopIndiceGenerated="true" may be a good choice whereas LoopIndiceGenerated="true" may not be explicit enough
This is a convenience method for String attributes

Parameters:
attributeName -
value -

setData

void setData(java.lang.String key,
             java.lang.Object data)
Sets the given Object data in the Micro-Pattern Processing Context so that it is available for further reference by Micro-Pattern handlers.
A best practice for Micro-Pattern handlers is to prefix the data key by the namespace. Therefore, com.ibm.pdp.pacbase.LoopIndiceGenerated may be a good choice whereas LoopIndiceGenerated may not be explicit enough

Parameters:
key -
data -

setGenerationProperties

void setGenerationProperties(IMicroPatternGenerationProperties properties)
Sets the generation properties.


setStatus

void setStatus(int status,
               int location,
               java.lang.String msg,
               java.lang.String userAction)
Sets the current processing status, message and associated action
In case status is IMicroPattern.UNRECOVERABLE_ERROR or IMicroPattern.WARNING_RAISED
the getStatus() method will no more return IMicroPattern.STATUS_OK.
The higher status will always remain active, so that setting status IMicroPattern.UNRECOVERABLE_ERROR
then IMicroPattern.WARNING_RAISED will lead to the getStatus() method to return IMicroPattern.UNRECOVERABLE_ERROR

Parameters:
status - The current processing context Status. May be IMicroPattern.STATUS_OK (default), IMicroPattern.WARNING_RAISED or IMicroPattern.UNRECOVERABLE_ERROR
location - the location in source code to which associate this status, or 0
msg - The associated message for the current status. This field shouldn't be null
userAction - An optional user action aimed at resolving the WARNING or UNRECOVERABLE ERROR. May be null

statusStack

java.util.Iterator<com.ibm.pdp.engine.extension.IProcessingStatus> statusStack()
Returns:
an Iterator over the internally managed IProcessingStatus stack