com.pega.pegarules.pub.clipboard
Interface PRObjectWrapper


public interface PRObjectWrapper

Interface used to define methods expected by Java Pages. PegaRULES will call these methods whenever a property on the page is referenced.

See ClipboardPage.attachJavaObject(com.pega.pegarules.pub.clipboard.PRObjectWrapper) for more information.

Note that any class that may be serialized in the PegaRULES database should have a unique identifier defined. This will allow serialized objects to be deserialized across versions and implementations of JVMs. To define the identifier, include a private field:

private static final long serialVersionUID = [a unique long]L;

Version:
$Revision: 31 $ $Date: 2009-06-24 09:38:04 -0400 (Wed, 24 Jun 2009) $
Author:
ernsg

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 void prAdd(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex, PRObjectWrapper aValue)
          Called when adding an element to an object list.
 void prAdd(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex, java.lang.String aValue)
          Called when adding a String to a list.
 void prClear(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName)
          Called when a Java Property List property is being cleared.
 PRObjectWrapper prCopy()
          Called when a Page that has an attached object is copied.
 java.lang.String prGet(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName)
          Called when retrieving a Java Property's value.
 java.lang.String prGet(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex)
          Called when retrieving a Java Property List element's value.
 PRObjectWrapper prGetNew(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName)
          Called when retrieving a new element to be added to a list.
 PRObjectWrapper prGetObject(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName)
          Called when retrieving an embedded object from this object.
 PRObjectWrapper prGetObject(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex)
          Called when retrieving an embedded object from a list contained in this object.
 java.lang.Object prGetWrappedObject()
          Used to get the object contained in this wrapper.
 void prRemove(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex)
          Remove an element from a Page List or Java Property List.
 boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex, PRObjectWrapper aValue)
          Called when an embedded object in a list is being set.
 boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, int aIndex, java.lang.String aValue)
          Called when a Java Property List element's value is being set.
 boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, PRObjectWrapper aValue)
          Called when an embedded object is being set.
 boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName, java.lang.String aValue)
          Called when a Java Property's value is being set.
 int prSize(PublicAPI aTools, ClipboardProperty aProperty, java.lang.String aMethodName)
          Returns the number of elements in a list or the number of characters in a string value.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

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

prAdd

void prAdd(PublicAPI aTools,
           ClipboardProperty aProperty,
           java.lang.String aMethodName,
           int aIndex,
           PRObjectWrapper aValue)
Called when adding an element to an object list. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Page List property that is being added to
aMethodName - the name of the Page List property that is being added to
aIndex - 0-based index of the new element being added. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.
aValue - wrapper currently attached to the Page being added to the Page List. May be null.

prAdd

void prAdd(PublicAPI aTools,
           ClipboardProperty aProperty,
           java.lang.String aMethodName,
           int aIndex,
           java.lang.String aValue)
Called when adding a String to a list. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property List property that is being added to
aMethodName - the name of the Java Property List property that is being added to
aIndex - 0-based index of the new element being added. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.
aValue - New String value being added to the list

prClear

void prClear(PublicAPI aTools,
             ClipboardProperty aProperty,
             java.lang.String aMethodName)
Called when a Java Property List property is being cleared. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property List property that is being cleared
aMethodName - the name of the Java Property List property that is being cleared

prCopy

PRObjectWrapper prCopy()
Called when a Page that has an attached object is copied. The page copy will have the results of this method attached to it. It is up to the implementor whether to copy the wrapper, return this, or even return null.

Returns:
a copy of this object or null

prGet

java.lang.String prGet(PublicAPI aTools,
                       ClipboardProperty aProperty,
                       java.lang.String aMethodName)
Called when retrieving a Java Property's value. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property whose value is being retrieved
aMethodName - the name of the Java Property
Returns:
the value of the property. null values will be converted to an empty string ("") before being returned as a clipboard property value

prGet

java.lang.String prGet(PublicAPI aTools,
                       ClipboardProperty aProperty,
                       java.lang.String aMethodName,
                       int aIndex)
Called when retrieving a Java Property List element's value. Do not attempt to store references to the aTools or aProperty objects within your object.Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property List whose element value is being retrieved
aMethodName - the name of the Java Property List
aIndex - 0-based index into the list. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.
Returns:
the value of the element in the list. null values will be converted to an empty string ("") before being returned as a clipboard property value

prGetNew

PRObjectWrapper prGetNew(PublicAPI aTools,
                         ClipboardProperty aProperty,
                         java.lang.String aMethodName)
Called when retrieving a new element to be added to a list. The PegaRULES engine will typically follow this call with a prAdd() using adding this new element to the list. Do not attempt to store references to the aTools or aProperty objects within your object.Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property List to which this element value will be added
aMethodName - the name of the Java Property List
Returns:
the new object

prGetObject

PRObjectWrapper prGetObject(PublicAPI aTools,
                            ClipboardProperty aProperty,
                            java.lang.String aMethodName)
Called when retrieving an embedded object from this object. This object will typically be attached to the given Page property by PegaRULES. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Page property whose object we are trying to retrieve
aMethodName - the name of the Page property
Returns:
the object that should be attached to the Page property

prGetObject

PRObjectWrapper prGetObject(PublicAPI aTools,
                            ClipboardProperty aProperty,
                            java.lang.String aMethodName,
                            int aIndex)
Called when retrieving an embedded object from a list contained in this object. This object will typically be attached to the given Page property by PegaRULES. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Page List property containing the element whose object we are trying to retrieve
aMethodName - the name of the Page List property
aIndex - 0-based index into the list. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.
Returns:
the object that should be attached to the Page property element in the list

prGetWrappedObject

java.lang.Object prGetWrappedObject()
Used to get the object contained in this wrapper. The returned object can be this if the object implements PRObjectWrapper itself.

Returns:
the object contained in this wrapper

prRemove

void prRemove(PublicAPI aTools,
              ClipboardProperty aProperty,
              java.lang.String aMethodName,
              int aIndex)
Remove an element from a Page List or Java Property List. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the List property containing the element we are trying to remove
aMethodName - the name of the List property
aIndex - 0-based index into the list. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.

prSet

boolean prSet(PublicAPI aTools,
              ClipboardProperty aProperty,
              java.lang.String aMethodName,
              java.lang.String aValue)
Called when a Java Property's value is being set. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property whose value is being set
aMethodName - the name of the Java Property
aValue - the new value
Returns:
true if the value was set successfully

prSet

boolean prSet(PublicAPI aTools,
              ClipboardProperty aProperty,
              java.lang.String aMethodName,
              int aIndex,
              java.lang.String aValue)
Called when a Java Property List element's value is being set. Implementors of this method should be prepared to handle a value of aIndex equal to the size of the list (ie., a position one place past the end of the list). When this index value is received, the implementor should extend the list by one and return the new entry. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property List whose element is being set
aMethodName - the name of the Java Property List
aIndex - 0-based index into the list. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.
aValue - the new value
Returns:
true if the value was set successfully

prSet

boolean prSet(PublicAPI aTools,
              ClipboardProperty aProperty,
              java.lang.String aMethodName,
              PRObjectWrapper aValue)
Called when an embedded object is being set. Typically this means a new or copied Java Page has been embedded into another Java Page. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Page property whose object is being set
aMethodName - the name of the Page property
aValue - the new object
Returns:
true if the object was set successfully

prSet

boolean prSet(PublicAPI aTools,
              ClipboardProperty aProperty,
              java.lang.String aMethodName,
              int aIndex,
              PRObjectWrapper aValue)
Called when an embedded object in a list is being set. Typically this means a new or copied Java Page has been embedded into another Java Page. Implementors of this method should be prepared to handle a value of aIndex equal to the size of the list (ie., a position one place past the end of the list). When this index value is received, the implementor should extend the list by one and return the new entry. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Page List property whose element's object is being set
aMethodName - the name of the Page List property
aIndex - 0-based index into the list. Caution! PegaRULES lists are 1-based. Add 1 to this index if you consult the ClipboardProperty object.
aValue - the new object
Returns:
true if the object was set successfully

prSize

int prSize(PublicAPI aTools,
           ClipboardProperty aProperty,
           java.lang.String aMethodName)
Returns the number of elements in a list or the number of characters in a string value. Do not attempt to store references to the aTools or aProperty objects within your object. Doing so will interfere with PegaRULES memory management and may lead to corruption.

Parameters:
aTools - public tools available in the current activity's context. This may be null if there is no context (during system initialization).
aProperty - the Java Property or Java Property List property we are querying
aMethodName - the name of the property
Returns:
the number of elements in a list property or the number of characters in a string property value


Copyright © 2012 Pegasystems Inc. All Rights Reserved.