IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.automaton.html
Class HtmlIndexedCollection

java.lang.Object
  extended by com.ibm.btt.base.DataElement
      extended by com.ibm.btt.base.DataCollection
          extended by com.ibm.btt.base.IndexedCollection
              extended by com.ibm.btt.automaton.html.HtmlIndexedCollection
All Implemented Interfaces:
DSECloneable, TypedData, java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class HtmlIndexedCollection
extends IndexedCollection

This is a special untyped IndexedCollection (i.e. with no descriptor) to validate fields coming from a HTML browser. The infrastructure finds out that certain data elements coming in the request data belong to an IndexedCollection. Then, a Vector of DataFields are passed to this instance of HtmlIndexedCollection in order to validate that the DataFields contain elements that have been defined in the IndexedCollection. The actual object inside the DataFields is a final object inside the data structure defined inside the IndexedCollection. Since this structure may be complex, it may contain nested KeyedCollections with as many DataElements inside. This means that the DataFields that the infrastructure is trying to validate will contain as name the full qualified path name, so this HtmlIndexedCollection may search for the actual final DataField in the created DataElement inside the IndexedCollection.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.base.IndexedCollection
defaultName, elements
 
Fields inherited from class com.ibm.btt.base.DataElement
description, name, parameters, state
 
Constructor Summary
HtmlIndexedCollection()
          HtmlIndexedCollection constructor
HtmlIndexedCollection(java.lang.String aName)
          HtmlIndexedCollection constructor
 
Method Summary
 void updateErrorInfo(java.lang.Object inputObject, DSETypeException e)
          Update the ErrorInfo attribute with the contents of the Exception
 java.lang.Object validate(DataField toValidate)
          Validates the object passed (that must be a DataField) and if successful, the object is returned, otherwise an appropriate exception is thrown.
 java.lang.Object validate(IndexedCollection iColl)
          Validates the object passed (that must be an indexed collection) and if successful, the object is returned, otherwise an appropriate exception is thrown.
 java.lang.Object validate(java.lang.Object toValidate)
          Validates the object passed (that must be an indexed collection or a vector) and if successful, the object is returned, otherwise an appropriate exception is thrown.
 java.lang.Object validate(Vector elements)
          Validates the set of objects passed (that must be DataField's) and if successful, the set is returned, otherwise an appropriate exception is thrown.
 
Methods inherited from class com.ibm.btt.base.IndexedCollection
addElement, addElement, clone, createElement, createElementSharingDescriptors, getDataElement, getElementAt, getElementAt, getElements, getElementSubTag, getEnumeration, getValue, initializeFrom, nestedQualifiedElements, readExternal, removeAll, removeElementAt, removeElementAt, setDataElement, setElements, setElementSubTag, setValue, size, toString, toStrings, toTags, tryGetElementAt, tryGetElementAt, tryGetValueAt, trySetValueAt, writeExternal
 
Methods inherited from class com.ibm.btt.base.DataCollection
getValueAt, nestedElements, nestedElements, nestedFields, nestedKeyedCollections, setValueAt, validate
 
Methods inherited from class com.ibm.btt.base.DataElement
externalizer, getCompositeKey, getDescription, getDescriptor, getErrorInfo, getExternalizer, getKey, getName, getParameter, getParameters, getState, getTagName, isAmended, isCached, isSerializable, readExternal, readObject, removeExternal, setAmended, setCompositeKey, setDescription, setDescriptor, setErrorInfo, setExternalizer, setIsCached, setName, setParameter, setParameters, setSerializable, setState, validateObject, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlIndexedCollection

public HtmlIndexedCollection()
HtmlIndexedCollection constructor


HtmlIndexedCollection

public HtmlIndexedCollection(java.lang.String aName)
                      throws java.io.IOException
HtmlIndexedCollection constructor

Parameters:
aName - java.lang.String
Throws:
java.io.IOException
Method Detail

updateErrorInfo

public void updateErrorInfo(java.lang.Object inputObject,
                            DSETypeException e)
Update the ErrorInfo attribute with the contents of the Exception

Parameters:
inputObject - Object
e - DSETypeException

validate

public java.lang.Object validate(java.lang.Object toValidate)
                          throws DSETypeException
Validates the object passed (that must be an indexed collection or a vector) and if successful, the object is returned, otherwise an appropriate exception is thrown.

Overrides:
validate in class IndexedCollection
Parameters:
toValidate - Object
descriptor - PropertyDescription
Returns:
java.lang.Object
Throws:
DSETypeException - Thrown if the validation is unsuccessful.

validate

public java.lang.Object validate(DataField toValidate)
                          throws DSETypeException
Validates the object passed (that must be a DataField) and if successful, the object is returned, otherwise an appropriate exception is thrown. The DataField contains the name of the final DataField that must be created in the IndexedCollection. The format of the name should be: index+"."+"path to the final DataField" This method will: - Create as many elements in the iColl as needed to have an element at the index passed as the name of the element. - Let the new created DataField to validate the input value - If validation succeeds, the field is kept in the IColl - Otherwise, the ErrorInfo object of the IColl is updated with the Exception contents and the DataField is removed (only if it was created)

Parameters:
toValidate - DataField
Returns:
java.lang.Object
Throws:
DSETypeException - Thrown if the validation is unsuccessful.

validate

public java.lang.Object validate(IndexedCollection iColl)
                          throws DSETypeException
Validates the object passed (that must be an indexed collection) and if successful, the object is returned, otherwise an appropriate exception is thrown.

Parameters:
iColl - Object
Throws:
DSETypeException - Thrown if the validation is unsuccessful.

validate

public java.lang.Object validate(Vector elements)
                          throws DSETypeException
Validates the set of objects passed (that must be DataField's) and if successful, the set is returned, otherwise an appropriate exception is thrown. The DataField's contain the name of the final DataField that must be created in the IndexedCollection. The format of the name should be: index+"."+"path to the final DataField" This method will: - Create the elements inside this IColl, unless they already exist - Let the new created DataFields to validate the input value - If validation succeeds, the fields are kept in the IColl - Otherwise, the ErrorInfo object of the IColl is updated with the Exception contents and the DataFields are removed (only if they were created)

Parameters:
elements - Vector
Returns:
java.lang.Object
Throws:
DSETypeException - Thrown if the validation is unsuccessful.

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009