biz.c24.io.api.transform
Class Transform

java.lang.Object
  extended by biz.c24.io.api.transform.Map
      extended by biz.c24.io.api.transform.Transform

public abstract class Transform
extends Map

A transform from one group of data objects to another.


Nested Class Summary
protected  class Transform.DoubleKey
           
 
Nested classes/interfaces inherited from class biz.c24.io.api.transform.Map
Map.CollectionArgFunction, Map.FirstCollectionArgFunction, Map.Function
 
Field Summary
 
Fields inherited from class biz.c24.io.api.transform.Map
ABS, ADD, ADDCOMMENT, ADDNS, ADJUSTTIMEZONE, ADLER32, AFTER, ANCESTOR, AND, AND3, AND4, ARCCOS, ARCSIN, ARCTAN, ARCTAN2, BEFORE, BINARYSEARCH, BITWISEAND, BITWISECOMPLEMENT, BITWISEOR, BITWISEXOR, CALENDAR, CAST, CEIL, CHARAT, CHARFOR, CHARLIST, CHGDAYS, CHGHOURS, CHGMINS, CHGMONTHS, CHGMSECS, CHGSECS, CHGYEARS, COLLAPSEWHITESPACE, COMPARE, CONCAT, CONTAINS, CONVERTDATE, COS, CRC32, DATE2MSECS, DATEFROMSTRING, DATETOSTRING, DATETOSTRINGTZ, DELSUBSTRING, DESERIALIZE, DIFFERENCE, DIVIDE, E, ENDSWITH, EQUALS, EQUALSIGNORECASE, EVEN, EXISTS, EXP, FIRST, FLOOR, FROMBASE64, FROMBLOB, FROMBYTES, FROMCLOB, FROMHEX, FROMSTRING, GETBYTES, GETCLIENTPROPERTY, GETCLIENTPROPERTYKEYS, GETCOMMENTS, GETDAYS, GETHOURS, GETJVMPROPERTY, GETMINS, GETMONTHS, GETMSECS, GETNSPREFIX, GETNSPREFIXES, GETNSURI, GETNSURIS, GETPI, GETPIKEYS, GETSECS, GETTIMEZONEID, GETTRANSFORMPROPERTY, GETYEARS, GREATERTHAN, GREATERTHANOREQUAL, GZIP, IF, IFEXISTS, INDEXOF, INSERT, INSERTINDEX, INSTANCE, INTERSECTION, KEEPALPHA, KEEPALPHANUMERIC, KEEPNUMERIC, LAST, LASTINDEXOF, LASTPOSITIONOF, LENGTH, LESSTHAN, LESSTHANOREQUAL, LOG, LOGEVENT, MATCHES, MAX, MAXLIST, MIN, MINLIST, MOD, MULTIPLY, NOT, NOTEQUALS, NOTEXISTS, NOW, ODD, ONLY_NULL_LIST, OR, OR3, OR4, PAD, PARENT, PI, POSITIONOF, POW, PRODUCT, PUTCLIENTPROPERTY, PUTJVMPROPERTY, PUTPI, PUTTRANSFORMPROPERTY, RANDOM, REMOVE, REMOVECLIENTPROPERTY, REMOVECOMMENT, REMOVEINDEX, REMOVENSPREFIX, REMOVENSURI, REMOVEPI, REPLACEALL, REPLACECHAR, REPLACEFIRST, REPLACEWHITESPACE, REVERSE, ROOT, ROTATE, ROUND, SERIALIZE, SETDOCTYPENAME, SETDOCTYPEPUBLICID, SETDOCTYPESYSTEMID, SETNONAMESPACESCHEMALOCATION, SETSCHEMALOCATION, SETTIMEZONE, SHUFFLE, SIN, SIZE, SORT, SPLIT, SQRT, STARTSWITH, SUBLIST, SUBSTRING, SUBTRACT, SUM, TAN, TIME_ZONE_GMT, TOBASE64, TOBLOB, TOBYTES, TOCLOB, TODEGREES, TOHEX, TOLOWERCASE, TORADIANS, TOSTRING, TOUPPERCASE, TRIM, UNGZIP, UNION, UNPAD, UNZIP, WRAP, XOR, XPATH, ZIP
 
Constructor Summary
  Transform(DataType[] inputTypes, DataType[] outputTypes)
          Creates a new instance with the specified input and output types.
protected Transform(DataType[] inputTypes, DataType[] outputTypes, Element[] inputElements, Element[] outputElements)
           
 
Method Summary
protected  Object[] arrayValue(Object[] original, Object value, boolean complex)
           
protected  void checkRequiredInputs(Object[][] inputs)
           
protected  void checkRequiredInputs(Object[][] inputs, boolean[] requiredInputs, DataType[] inputTypes)
           
protected  void checkRequiredOutputs(Object[][] outputs)
           
protected  void checkRequiredOutputs(Object[][] outputs, boolean[] requiredOutputs, DataType[] outputTypes)
           
protected  ComplexDataObject complexValue(Object value)
           
 ArrayList<Object> getErrors()
           
 int getErrorsCount()
           
 Element getInput(int index)
          Returns the input at index.
 int getInputCount()
          Returns the count of the input types.
 String getName()
          Returns the transform name index.
 Element getOutput(int index)
          Returns the output element at index.
 int getOutputCount()
          Returns the count of the output elements.
 String[] getPossibleInputElementDecls(int index)
          Returns the possible element declaration classnames of the input at index.
 String[] getPossibleOutputElementDecls(int index)
          Returns the possible element declaration classnames of the output at index.
 ValidationManager getValidationManager()
           
protected  Object[][] init(DataType[] inType, DataType[] outType)
           
protected  Object[][] init(Object[][] inArr)
          Called by subclasses to initialize the transform and create the output objects.
protected  void initAttribute(Object[] ancestorParam, String parentName, String childName, Object child, boolean instantiate)
           
protected  void initElement(Object[] ancestorParam, String parentName, String childName, Object child, boolean instantiate)
           
protected  void initElement(Object[] ancestorParam, String parentName, String childName, Object child, boolean instantiate, boolean simple)
           
 boolean isInputRequired(int index)
          Returns whether the input at index is required.
 boolean isOutputRequired(int index)
          Returns whether the output at index is required.
 boolean isStopFirstError()
           
 boolean isValidateInputs()
          Returns whether the inputs will be validated before proceeding with the transformation.
 boolean isValidateOutputs()
          Returns whether the outputs will be validated before proceeding with the transformation.
 void printErrorMessage(String message)
           
protected  Element resolveElement(Element e, String str)
           
 void setInput(int index, Element inputElement)
          Sets the input at index.
 void setInputRequired(int index, boolean required)
          Sets whether the input at index is requried.
 void setOutput(int index, Element outputElement)
          Sets the output at index.
 void setOutputRequired(int index, boolean required)
          Sets whether the output at index is requried.
 void setPossibleInputElementDecls(int index, String[] possibleInputElementDecls)
          Sets the possible element declaration classnames of the input at index.
 void setPossibleOutputElementDecls(int index, String[] possibleOutputElementDecls)
          Sets the possible element declaration classnames of the output at index.
 void setStopFirstError(boolean value)
           
 void setValidateInputs(boolean validateInputs)
          Sets whether the inputs will be validated before proceeding with the transformation.
 void setValidateOutputs(boolean validateOutputs)
          Sets whether the outputs will be validated before proceeding with the transformation.
 ComplexDataObject[] transform(ComplexDataObject[] input)
          Deprecated. Please use transform(Object[][]) instead.
 ComplexDataObject[][] transform(ComplexDataObject[][] input)
          Deprecated. Please use transform(Object[][]) instead.
abstract  Object[][] transform(Object[][] input)
          Converts the two dimensional array of objects and returns the result.
 
Methods inherited from class biz.c24.io.api.transform.Map
appendObject, appendReturnObject, booleanOrValue, combinations, createInArr, createLogEntry, createLogEntry, createLogEntry, createLogEntry, createLogEntry, createOutArr, createOutArr, dateTimeAdder, dateTimeGetter, filter, filter, functionAbs, functionAdd, functionAddComment, functionAddNs, functionAdjustTimeZone, functionAdler32, functionAfter, functionAncestor, functionAnd, functionAnd3, functionAnd4, functionArcCos, functionArcSin, functionArcTan, functionArcTan2, functionBefore, functionBinarySearch, functionBitwiseAnd, functionBitwiseComplement, functionBitwiseOr, functionBitwiseXor, functionCast, functionCeil, functionCharAt, functionCharFor, functionChgDays, functionChgHours, functionChgMins, functionChgMonths, functionChgMsecs, functionChgSecs, functionChgYears, functionCollapseWhitespace, functionCompare, functionConcat, functionContains, functionConvertDate, functionCos, functionCRC32, functionDate2Msecs, functionDateFromString, functionDateToString, functionDateToStringTZ, functionDelSubstring, functionDeserialize, functionDifference, functionDivide, functionE, functionEndsWith, functionEquals, functionEqualsIgnoreCase, functionEven, functionExists, functionExp, functionFirst, functionFloor, functionFromBase64, functionFromBlob, functionFromBytes, functionFromClob, functionFromHex, functionFromString, functionGetBytes, functionGetClientProperty, functionGetClientPropertyKeys, functionGetComments, functionGetDays, functionGetHours, functionGetJvmProperty, functionGetMins, functionGetMonths, functionGetMsecs, functionGetNsPrefix, functionGetNsPrefixes, functionGetNsUri, functionGetNsUris, functionGetPi, functionGetPiKeys, functionGetSecs, functionGetTimeZoneId, functionGetTransformProperty, functionGetYears, functionGreaterThan, functionGreaterThanOrEqual, functionGzip, functionIf, functionIfExists, functionIndexOf, functionInsert, functionInsertIndex, functionInstance, functionIntersection, functionKeepAlpha, functionKeepAlphaNumeric, functionKeepNumeric, functionLast, functionLastIndexOf, functionLastPositionOf, functionLength, functionLessThan, functionLessThanOrEqual, functionLog, functionLogEvent, functionMatches, functionMax, functionMaxList, functionMin, functionMinList, functionMod, functionMultiply, functionNot, functionNotEquals, functionNotExists, functionNow, functionOdd, functionOr, functionOr3, functionOr4, functionPad, functionParent, functionPi, functionPositionOf, functionPow, functionProduct, functionPutClientProperty, functionPutJvmProperty, functionPutPi, functionPutTransformProperty, functionRandom, functionRemove, functionRemoveClientProperty, functionRemoveComment, functionRemoveIndex, functionRemoveNsPrefix, functionRemoveNsUri, functionRemovePi, functionReplaceAll, functionReplaceChar, functionReplaceFirst, functionReplaceWhitespace, functionReverse, functionRoot, functionRotate, functionRound, functionSerialize, functionSetDocTypeName, functionSetDocTypePublicId, functionSetDocTypeSystemId, functionSetNoNamespaceSchemaLocation, functionSetSchemaLocation, functionSetTimeZone, functionShuffle, functionSin, functionSize, functionSort, functionSplit, functionSqrt, functionStartsWith, functionSubList, functionSubstring, functionSubtract, functionSum, functionTan, functionToBase64, functionToBlob, functionToBytes, functionToCharList, functionToClob, functionToDegrees, functionToHex, functionToLowerCase, functionToRadians, functionToString, functionToUpperCase, functionTrim, functionUngzip, functionUnion, functionUnpad, functionUnzip, functionWrap, functionXor, functionXPath, functionZip, getLog, getMaps, getProperties, hashtable, multiTransform, newNumber, newNumber, nullList, parametersAddComment, parametersAddNs, parametersAdjustTimeZone, parametersAncestor, parametersBinarySearch, parametersCharAt, parametersChgDays, parametersChgHours, parametersChgMins, parametersChgMonths, parametersChgMsecs, parametersChgSecs, parametersChgYears, parametersContains, parametersDateFromString, parametersDateToString, parametersDateToStringTZ, parametersDelSubstring, parametersEndsWith, parametersFromBytes, parametersGetBytes, parametersGetClientProperty, parametersGetJvmProperty, parametersGetNsPrefix, parametersGetNsUri, parametersGetPi, parametersGetTransformProperty, parametersIf, parametersIfExists, parametersIndexOf, parametersInsert, parametersInsertIndex, parametersInstance, parametersLastIndexOf, parametersLastPositionOf, parametersLogEvent, parametersMatches, parametersPad, parametersPositionOf, parametersPutClientProperty, parametersPutJvmProperty, parametersPutPi, parametersPutTransformProperty, parametersRemove, parametersRemoveClientProperty, parametersRemoveComment, parametersRemoveIndex, parametersRemoveNsPrefix, parametersRemoveNsUri, parametersRemovePi, parametersReplaceAll, parametersReplaceChar, parametersReplaceFirst, parametersRotate, parametersSetDocTypeName, parametersSetDocTypePublicId, parametersSetDocTypeSystemId, parametersSetNoNamespaceSchemaLocation, parametersSetSchemaLocation, parametersSetTimeZone, parametersSplit, parametersStartsWith, parametersSubList, parametersSubstring, parametersToBytes, parametersUnpad, parametersWrap, parametersXPath, parametersZip, parseDate, register, resolve, resolve, resolveAttribute, resolveElement, setLog, setProperties, stop, transform, transform, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transform

public Transform(DataType[] inputTypes,
                 DataType[] outputTypes)
Creates a new instance with the specified input and output types.

Parameters:
inputTypes - The input types.
outputTypes - The output types.

Transform

protected Transform(DataType[] inputTypes,
                    DataType[] outputTypes,
                    Element[] inputElements,
                    Element[] outputElements)
Method Detail

isValidateInputs

public boolean isValidateInputs()
Returns whether the inputs will be validated before proceeding with the transformation.

Returns:
Whether to validate the inputs.

setValidateInputs

public void setValidateInputs(boolean validateInputs)
Sets whether the inputs will be validated before proceeding with the transformation.

Parameters:
validateInputs - Whether to validate the inputs.

isValidateOutputs

public boolean isValidateOutputs()
Returns whether the outputs will be validated before proceeding with the transformation.

Returns:
Whether to validate the outputs.

setValidateOutputs

public void setValidateOutputs(boolean validateOutputs)
Sets whether the outputs will be validated before proceeding with the transformation.

Parameters:
validateOutputs - Whether to validate the outputs.

transform

public abstract Object[][] transform(Object[][] input)
                              throws ValidationException
Converts the two dimensional array of objects and returns the result.

The first dimension of the input / output array corresponds to the number of different types used as input / output to the transform. The second dimension corresponds to the number of repeats of that input / ouput. So inArr[1][2] would correspond to the third repeat of the second input.

Parameters:
input - An array of data objects (ComplexDataObject, String, Date, Number, Boolean etc) to be converted.
Returns:
An array of data objects (ComplexDataObject, String, Date, Number, Boolean etc) which have been converted.
Throws:
AbsentDataException - If a required input is not supplied or a required output is not populated.
ValidationException - If the inputs and/or outputs are invalid and isValidateInputs() or isValidateOutputs() return true.

transform

public ComplexDataObject[][] transform(ComplexDataObject[][] input)
                                throws ValidationException
Deprecated. Please use transform(Object[][]) instead.

Converts the two dimensional array of objects and returns the result.

The first dimension of the input / output array corresponds to the number of different types used as input / output to the transform. The second dimension corresponds to the number of repeats of that input / ouput. So inArr[1][2] would correspond to the third repeat of the second input.

Parameters:
input - An array of data objects to be converted.
Returns:
An array of data objects which have been converted.
Throws:
AbsentDataException - If a required input is not supplied or a required output is not populated.
ValidationException - If the inputs and/or outputs are invalid and isValidateInputs() or isValidateOutputs() return true.

transform

public ComplexDataObject[] transform(ComplexDataObject[] input)
                              throws ValidationException
Deprecated. Please use transform(Object[][]) instead.

Converts inDataObject and returns the result.

Parameters:
input - An array of data objects to be converted.
Returns:
An array of data objects which have been converted.
Throws:
AbsentDataException - If a required input is not supplied or a required output is not populated.
ValidationException - If the inputs and/or outputs are invalid and isValidateInputs() or isValidateOutputs() return true.

getInput

public Element getInput(int index)
Returns the input at index.

Parameters:
index - The index to get.
Returns:
The input.

setInput

public void setInput(int index,
                     Element inputElement)
Sets the input at index.

Parameters:
index - The index to set.
inputElement - The input.

getInputCount

public int getInputCount()
Returns the count of the input types.

Returns:
The number of types.

getOutput

public Element getOutput(int index)
Returns the output element at index.

Parameters:
index - The index to get.
Returns:
The element.

setOutput

public void setOutput(int index,
                      Element outputElement)
Sets the output at index.

Parameters:
index - The index to set.
outputElement - The output.

getOutputCount

public int getOutputCount()
Returns the count of the output elements.

Returns:
The number of outputs.

isInputRequired

public boolean isInputRequired(int index)
Returns whether the input at index is required.
Required inputs that aren't supplied cause a AbsentDataException to be thrown from the transform(Object[][]) method.

Parameters:
index - The index of the input to query.
Returns:
Whether the input is required.

setInputRequired

public void setInputRequired(int index,
                             boolean required)
Sets whether the input at index is requried.

Parameters:
index - The index of the input to set.
required - Whether the input is required.

isOutputRequired

public boolean isOutputRequired(int index)
Returns whether the output at index is required.
Required outputs that aren't populated by the transform cause a AbsentDataException to be thrown from the transform(Object[][]) method.

Parameters:
index - The index of the output to query.
Returns:
Whether the output is required.

setOutputRequired

public void setOutputRequired(int index,
                              boolean required)
Sets whether the output at index is requried.

Parameters:
index - The index of the output to set.
required - Whether the output is required.

getPossibleInputElementDecls

public String[] getPossibleInputElementDecls(int index)
Returns the possible element declaration classnames of the input at index.

Parameters:
index - The index of the input to query.
Returns:
The class names.

setPossibleInputElementDecls

public void setPossibleInputElementDecls(int index,
                                         String[] possibleInputElementDecls)
Sets the possible element declaration classnames of the input at index.

Parameters:
index - The index of the input to query.
possibleInputElementDecls - The array of classnames.

getPossibleOutputElementDecls

public String[] getPossibleOutputElementDecls(int index)
Returns the possible element declaration classnames of the output at index.

Parameters:
index - The index of the output to query.
Returns:
The class names.

setPossibleOutputElementDecls

public void setPossibleOutputElementDecls(int index,
                                          String[] possibleOutputElementDecls)
Sets the possible element declaration classnames of the output at index.

Parameters:
index - The index of the output to query.
possibleOutputElementDecls - The array of classnames.

getValidationManager

public ValidationManager getValidationManager()

checkRequiredInputs

protected void checkRequiredInputs(Object[][] inputs)
                            throws ValidationException
Throws:
ValidationException

checkRequiredInputs

protected void checkRequiredInputs(Object[][] inputs,
                                   boolean[] requiredInputs,
                                   DataType[] inputTypes)
                            throws ValidationException
Throws:
ValidationException

checkRequiredOutputs

protected void checkRequiredOutputs(Object[][] outputs)
                             throws ValidationException
Throws:
ValidationException

checkRequiredOutputs

protected void checkRequiredOutputs(Object[][] outputs,
                                    boolean[] requiredOutputs,
                                    DataType[] outputTypes)
                             throws ValidationException
Throws:
ValidationException

resolveElement

protected Element resolveElement(Element e,
                                 String str)

complexValue

protected ComplexDataObject complexValue(Object value)

arrayValue

protected Object[] arrayValue(Object[] original,
                              Object value,
                              boolean complex)

initElement

protected void initElement(Object[] ancestorParam,
                           String parentName,
                           String childName,
                           Object child,
                           boolean instantiate)

initElement

protected void initElement(Object[] ancestorParam,
                           String parentName,
                           String childName,
                           Object child,
                           boolean instantiate,
                           boolean simple)

initAttribute

protected void initAttribute(Object[] ancestorParam,
                             String parentName,
                             String childName,
                             Object child,
                             boolean instantiate)

init

protected Object[][] init(Object[][] inArr)
Called by subclasses to initialize the transform and create the output objects.

Parameters:
inArr - The array of input objects.
Returns:
The array of output objects.

init

protected Object[][] init(DataType[] inType,
                          DataType[] outType)

isStopFirstError

public boolean isStopFirstError()

setStopFirstError

public void setStopFirstError(boolean value)

printErrorMessage

public void printErrorMessage(String message)

getErrors

public ArrayList<Object> getErrors()

getErrorsCount

public int getErrorsCount()

getName

public String getName()
Returns the transform name index.

Returns:
The transform name.


C24 Technologies © 2002-2012: All Rights Reserved.