|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.transform.Map
biz.c24.io.api.transform.Transform
public abstract class Transform
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 |
---|
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Transform(DataType[] inputTypes, DataType[] outputTypes)
inputTypes
- The input types.outputTypes
- The output types.protected Transform(DataType[] inputTypes, DataType[] outputTypes, Element[] inputElements, Element[] outputElements)
Method Detail |
---|
public boolean isValidateInputs()
public void setValidateInputs(boolean validateInputs)
validateInputs
- Whether to validate the inputs.public boolean isValidateOutputs()
public void setValidateOutputs(boolean validateOutputs)
validateOutputs
- Whether to validate the outputs.public abstract Object[][] transform(Object[][] input) throws ValidationException
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.
input
- An array of data objects (ComplexDataObject, String, Date, Number, Boolean etc) to be converted.
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
.public ComplexDataObject[][] transform(ComplexDataObject[][] input) throws ValidationException
transform(Object[][])
instead.
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.
input
- An array of data objects to be converted.
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
.public ComplexDataObject[] transform(ComplexDataObject[] input) throws ValidationException
transform(Object[][])
instead.
inDataObject
and returns the result.
input
- An array of data objects to be converted.
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
.public Element getInput(int index)
index
.
index
- The index to get.
public void setInput(int index, Element inputElement)
index
.
index
- The index to set.inputElement
- The input.public int getInputCount()
public Element getOutput(int index)
index
.
index
- The index to get.
public void setOutput(int index, Element outputElement)
index
.
index
- The index to set.outputElement
- The output.public int getOutputCount()
public boolean isInputRequired(int index)
index
is required.AbsentDataException
to be thrown from the transform(Object[][])
method.
index
- The index of the input to query.
public void setInputRequired(int index, boolean required)
index
is requried.
index
- The index of the input to set.required
- Whether the input is required.public boolean isOutputRequired(int index)
index
is required.AbsentDataException
to be thrown from the transform(Object[][])
method.
index
- The index of the output to query.
public void setOutputRequired(int index, boolean required)
index
is requried.
index
- The index of the output to set.required
- Whether the output is required.public String[] getPossibleInputElementDecls(int index)
index
.
index
- The index of the input to query.
public void setPossibleInputElementDecls(int index, String[] possibleInputElementDecls)
index
.
index
- The index of the input to query.possibleInputElementDecls
- The array of classnames.public String[] getPossibleOutputElementDecls(int index)
index
.
index
- The index of the output to query.
public void setPossibleOutputElementDecls(int index, String[] possibleOutputElementDecls)
index
.
index
- The index of the output to query.possibleOutputElementDecls
- The array of classnames.public ValidationManager getValidationManager()
protected void checkRequiredInputs(Object[][] inputs) throws ValidationException
ValidationException
protected void checkRequiredInputs(Object[][] inputs, boolean[] requiredInputs, DataType[] inputTypes) throws ValidationException
ValidationException
protected void checkRequiredOutputs(Object[][] outputs) throws ValidationException
ValidationException
protected void checkRequiredOutputs(Object[][] outputs, boolean[] requiredOutputs, DataType[] outputTypes) throws ValidationException
ValidationException
protected Element resolveElement(Element e, String str)
protected ComplexDataObject complexValue(Object value)
protected Object[] arrayValue(Object[] original, Object value, boolean complex)
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)
protected void initAttribute(Object[] ancestorParam, String parentName, String childName, Object child, boolean instantiate)
protected Object[][] init(Object[][] inArr)
inArr
- The array of input objects.
protected Object[][] init(DataType[] inType, DataType[] outType)
public boolean isStopFirstError()
public void setStopFirstError(boolean value)
public void printErrorMessage(String message)
public ArrayList<Object> getErrors()
public int getErrorsCount()
public String getName()
index
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |