AR System Java API

com.bmc.arsys.api
Class ARQualifierHelper

java.lang.Object
  extended by com.bmc.arsys.api.ARQualifierHelper
All Implemented Interfaces:
Serializable, Cloneable

public class ARQualifierHelper
extends Object
implements Cloneable, Serializable

The ARQualifierHelper class is the optimized way to get QualifierInfo. All the previous parseQualification 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.parseQualification(getControlStructObject(), szQual);
 
 
In this example, the generateFieldMaps() method generates a field mapping and the parseQualification() method parses a string and returns an object.

See Also:
Serialized Form

Constructor Summary
ARQualifierHelper()
          Constructor
 
Method Summary
 void clear()
          Release all variable object references.
 Object clone()
          Clone implementation that returns an Object with data cloned from self.
 boolean equals(Object obj)
           
 void generateFieldMaps(List<Field> localFieldList, int vuiId, String historyTag, List<Field> remoteFieldList)
          Generates the field maps for qualification parser.
 String getEnumAliasFromValue(String fldid, int enumValue)
           
 String getEnumValueFromAlias(String fldid, String alias)
           
 Field getField(String fieldStr)
          Get the Field for the given field name
 Field getLocalField(String token)
          Returns the local field for token.
 HashMap<String,Field> getLocalFieldIdMap()
          Returns the field Id HashMap.
 HashMap<String,Field> getLocalFieldLabelMap()
          Returns the hashmap for the field label.
 Field getRemoteField(String token)
          Returns the remote field for token.
 HashMap<String,Field> getRemoteFieldIdMap()
          Returns the field ID HashMap.
 HashMap<String,Field> getRemoteFieldNameMap()
          Returns the HashMap for the field name.
 int getVuiId()
          Returns the vuiId.
 int hashCode()
           
 QualifierInfo parseQualification(String localeString, String queryString)
           
 QualifierInfo parseQualification(String localeString, String queryString, String timezone)
          Parses the qualification string and returns the QualifierInfo object
 void setLocalFieldIdMap(Map<String,Field> fldidmap)
          Allows the field ID HashMap to be set.
 void setLocalFieldLabelMap(Map<String,Field> fldmap, int vuiId)
          Allows the fieldlabel HashMap to be set.
 void setRemoteFieldIdMap(Map<String,Field> fldidmap)
          Allows the field ID HashMap to be set.
 void setRemoteFieldNameMap(Map<String,Field> fldmap)
          Allows the fieldname HashMap to be set.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ARQualifierHelper

public ARQualifierHelper()
Constructor

Method Detail

parseQualification

public QualifierInfo parseQualification(String localeString,
                                        String queryString)
                                 throws ARException
Throws:
ARException

parseQualification

public QualifierInfo parseQualification(String localeString,
                                        String queryString,
                                        String timezone)
                                 throws ARException
Parses the qualification string and returns the QualifierInfo object

Parameters:
localeString -
queryString -
timezone -
Returns:
QualifierInfo
Throws:
ARException

generateFieldMaps

public void generateFieldMaps(List<Field> localFieldList,
                              int vuiId,
                              String historyTag,
                              List<Field> remoteFieldList)
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 int getVuiId()
Returns the vuiId.


getLocalFieldLabelMap

public HashMap<String,Field> getLocalFieldLabelMap()
Returns the hashmap for the field label.


setLocalFieldLabelMap

public void setLocalFieldLabelMap(Map<String,Field> fldmap,
                                  int 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 HashMap<String,Field> getRemoteFieldNameMap()
Returns the HashMap for the field name.


setRemoteFieldNameMap

public void setRemoteFieldNameMap(Map<String,Field> 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 HashMap<String,Field> getLocalFieldIdMap()
Returns the field Id HashMap.


setLocalFieldIdMap

public void setLocalFieldIdMap(Map<String,Field> 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 HashMap<String,Field> getRemoteFieldIdMap()
Returns the field ID HashMap.


setRemoteFieldIdMap

public void setRemoteFieldIdMap(Map<String,Field> 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(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(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 Object clone()
             throws CloneNotSupportedException
Clone implementation that returns an Object with data cloned from self.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getEnumValueFromAlias

public String getEnumValueFromAlias(String fldid,
                                    String alias)

getEnumAliasFromValue

public String getEnumAliasFromValue(String fldid,
                                    int enumValue)

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.


toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getField

public Field getField(String fieldStr)
Get the Field for the given field name

Parameters:
fieldStr -

AR System Java API

© Copyright 2006, 2007 BMC Software, Inc.