Class ValueMetaFactory
- java.lang.Object
-
- org.pentaho.di.core.row.value.ValueMetaFactory
-
public class ValueMetaFactory extends Object
This class will hand out value meta objects from the plugin registry.- Author:
- matt
-
-
Field Summary
Fields Modifier and Type Field Description static PluginRegistry
pluginRegistry
-
Constructor Summary
Constructors Constructor Description ValueMetaFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
cloneInfo(ValueMetaInterface source, ValueMetaInterface target)
static ValueMetaInterface
cloneValueMeta(ValueMetaInterface source)
static ValueMetaInterface
cloneValueMeta(ValueMetaInterface source, int targetType)
static ValueMetaInterface
createValueMeta(int type)
static ValueMetaInterface
createValueMeta(String name, int type)
static ValueMetaInterface
createValueMeta(String name, int type, int length, int precision)
static String[]
getAllValueMetaNames()
static int
getIdForValueMeta(String valueMetaName)
static String
getValueMetaName(int type)
static String[]
getValueMetaNames()
static List<ValueMetaInterface>
getValueMetaPluginClasses()
static ValueMetaInterface
guessValueMetaInterface(Object object)
This method makes attempt to guess kettle value meta interface based on Object class.
-
-
-
Field Detail
-
pluginRegistry
public static PluginRegistry pluginRegistry
-
-
Method Detail
-
createValueMeta
public static ValueMetaInterface createValueMeta(String name, int type, int length, int precision) throws KettlePluginException
- Throws:
KettlePluginException
-
createValueMeta
public static ValueMetaInterface createValueMeta(String name, int type) throws KettlePluginException
- Throws:
KettlePluginException
-
createValueMeta
public static ValueMetaInterface createValueMeta(int type) throws KettlePluginException
- Throws:
KettlePluginException
-
cloneValueMeta
public static ValueMetaInterface cloneValueMeta(ValueMetaInterface source) throws KettlePluginException
- Throws:
KettlePluginException
-
cloneValueMeta
public static ValueMetaInterface cloneValueMeta(ValueMetaInterface source, int targetType) throws KettlePluginException
- Throws:
KettlePluginException
-
cloneInfo
public static void cloneInfo(ValueMetaInterface source, ValueMetaInterface target) throws KettlePluginException
- Throws:
KettlePluginException
-
getValueMetaNames
public static String[] getValueMetaNames()
-
getAllValueMetaNames
public static String[] getAllValueMetaNames()
-
getValueMetaName
public static String getValueMetaName(int type)
-
getIdForValueMeta
public static int getIdForValueMeta(String valueMetaName)
-
getValueMetaPluginClasses
public static List<ValueMetaInterface> getValueMetaPluginClasses() throws KettlePluginException
- Throws:
KettlePluginException
-
guessValueMetaInterface
public static ValueMetaInterface guessValueMetaInterface(Object object)
This method makes attempt to guess kettle value meta interface based on Object class. This may be the case when we somehow obtain an Object as a result of any calculation, and we are trying to assign some ValueMeta for it.
As an example - we have target value meta Number (which is java Double under the hood) and value as a BigDecimal.
This BigDecimal can be converted to a Double value.
we haveValueMetaInterface.convertData(ValueMetaInterface, Object)
call for this where is ValueMetaInterface object is our target value meta, Object is a BigDecimal - so we need to pass ValueMetaBigNumber as a first parameter, value Object as a second and as the result we will have target Double (ValueMetaNumber) value so we can safely put it into output rowset.Something similar we had for ValueMetaBase.getValueFromSQLType(...) to guess value meta for java sql type.
Currently this method does not have support for plugin value meta. Hope if this approach will be found usable this may be implemented later.
- Parameters:
object
- object to guess applicable ValueMetaInterface.- Returns:
- See Also:
if the kettle value meta is recognized, null otherwise.
-
-