7.0 Action Request System Java API

com.remedy.arsys.api
Class ARQualifierHelper

java.lang.Object
  extended bycom.remedy.arsys.api.ARQualifierHelper
All Implemented Interfaces:
java.lang.Cloneable

public class ARQualifierHelper
extends java.lang.Object
implements java.lang.Cloneable

The ARQualifierHelper class is the optimized way to get QualifierInfo. All the previous getQualifier methods defined in the Proxy class scan the field list for a token to get the appropriate field object. With ARQualifierHelper, the JNI parser can call the getLocalField() or getRemoteField() functions and get the Field object for a token. Since ARQualifierHelper maintains the list of fields as a HashMap, it can return the Field object in log(n) times, where n is the number of fields. The generateFieldMaps() function generates the field label and field ID maps in a way appropriate for the JNI parser. If the end application already has these field maps, it can set these field maps using the setFieldLabelMap() and and setFieldIdMap() calls. The following Java code snippet is an example of how to use ARQualifierHelper to return field objects:

ARQualifierHelper qualHelper = new ARQualifierHelper();
          qualHelper.generateFieldMaps(fieldList, vuiId, remoteFieldList);
          qual = qualHelper.getQualifier(getControlStructObject(), szQual);
 
In this example, the generateFieldMaps() method generates a field mapping and the getQualifier() method parses a string and returns an object.


Constructor Summary
ARQualifierHelper()
          Constructor
 
Method Summary
 void clear()
          Release all variable object references.
 java.lang.Object clone()
          Clone implementation that returns an Object with data cloned from self.
protected  void finalize()
          Clears up all variable object references if it is called, even through there is no guarantee to be called.
 void generateFieldMaps(Field[] localFieldArray, long vuiId, java.lang.String historyTag, Field[] remoteFieldArray)
          Generates the field maps for qualification parser.
 Field getLocalField(java.lang.String token)
          Returns the local field for token.
 java.util.HashMap getLocalFieldIdMap()
          Returns the field Id HashMap.
 java.util.HashMap getLocalFieldLabelMap()
          Returns the hashmap for the field label.
 QualifierInfo getQualifier(ARServerUser ctx, java.lang.String queryString)
          Parses string and returns vuiId object.
 Field getRemoteField(java.lang.String token)
          Returns the remote field for token.
 java.util.HashMap getRemoteFieldIdMap()
          Returns the field ID HashMap.
 java.util.HashMap getRemoteFieldNameMap()
          Returns the HashMap for the field name.
 long getVuiId()
          Returns the vuiId.
 void setLocalFieldIdMap(java.util.Map fldidmap)
          Allows the field ID HashMap to be set.
 void setLocalFieldLabelMap(java.util.Map fldmap, long vuiId)
          Allows the fieldlabel HashMap to be set.
 void setRemoteFieldIdMap(java.util.Map fldidmap)
          Allows the field ID HashMap to be set.
 void setRemoteFieldNameMap(java.util.Map fldmap)
          Allows the fieldname HashMap to be set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARQualifierHelper

public ARQualifierHelper()
Constructor

Method Detail

getQualifier

public QualifierInfo getQualifier(ARServerUser ctx,
                                  java.lang.String queryString)
                           throws ARException
Parses string and returns vuiId object.

Throws:
ARException

generateFieldMaps

public void generateFieldMaps(Field[] localFieldArray,
                              long vuiId,
                              java.lang.String historyTag,
                              Field[] remoteFieldArray)
Generates the field maps for qualification parser. The first map consists either of the field label or the field name. The second map consists of field IDs.


getVuiId

public long getVuiId()
Returns the vuiId.


getLocalFieldLabelMap

public java.util.HashMap getLocalFieldLabelMap()
Returns the hashmap for the field label.


setLocalFieldLabelMap

public void setLocalFieldLabelMap(java.util.Map fldmap,
                                  long vuiId)
Allows the fieldlabel HashMap to be set. fldmap is a HashMap that contains fields for a specific vui. The key is of type String and contains the field label or field name. The value is the Field object. vuiId specifies the vui. MAKE SURE the key is either the field label or field name. Changing the key will change the behavior of the parser.


getRemoteFieldNameMap

public java.util.HashMap getRemoteFieldNameMap()
Returns the HashMap for the field name.


setRemoteFieldNameMap

public void setRemoteFieldNameMap(java.util.Map fldmap)
Allows the fieldname HashMap to be set. fldmap is a HashMap that contains all the fields for a form. The key is of type String and contains the field name. The value is the Field object.


getLocalFieldIdMap

public java.util.HashMap getLocalFieldIdMap()
Returns the field Id HashMap.


setLocalFieldIdMap

public void setLocalFieldIdMap(java.util.Map fldidmap)
Allows the field ID HashMap to be set. fldidmap is a HashMap that contains fields for the form. The key is of type String and contains the field ID. The value is the Field object. This routine also sets the Status Field and Status-History field for use by the parser in the JNI layer. MAKE SURE the key is a String. Providing the key of any other type will not return the right Field object.


getRemoteFieldIdMap

public java.util.HashMap getRemoteFieldIdMap()
Returns the field ID HashMap.


setRemoteFieldIdMap

public void setRemoteFieldIdMap(java.util.Map fldidmap)
Allows the field ID HashMap to be set. fldidmap is a HashMap that contains fields for the form. The key is of type String and contains the field ID. The value is the Field object. This routine also sets the Status Field and Status-History field for use by the parser in the JNI layer. MAKE SURE the key is a String. Providing the key of any other type will not return the right Field object.


getLocalField

public Field getLocalField(java.lang.String token)
Returns the local field for token. First checks the field label. If that does not return, checks the field ID. This routine is called by the JNI parse layer.


getRemoteField

public Field getRemoteField(java.lang.String token)
Returns the remote field for token. First checks the field label. If that does not return, checks the field ID. This routine is called by the JNI parse layer.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone implementation that returns an Object with data cloned from self.

Throws:
java.lang.CloneNotSupportedException

clear

public void clear()
Release all variable object references. Since most of those references are JNI objects, gc will not reclaim them if we do not release them specificly. Client should call this in their finally block when done with this object.


finalize

protected void finalize()
                 throws java.lang.Throwable
Clears up all variable object references if it is called, even through there is no guarantee to be called. Basically, the finalize method calls clear(). Client should call this in their finally block when done with this object.

Throws:
java.lang.Throwable

7.0 Action Request System Java API