本文整理汇总了Java中org.pentaho.di.core.Props.isInitialized方法的典型用法代码示例。如果您正苦于以下问题:Java Props.isInitialized方法的具体用法?Java Props.isInitialized怎么用?Java Props.isInitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.Props
的用法示例。
在下文中一共展示了Props.isInitialized方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SQLModelGenerator
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
public SQLModelGenerator( String modelName, String connectionName, int[] columnTypes, String[] columnNames,
String query, Boolean securityEnabled, List<String> users, List<String> roles, int defaultAcls, String createdBy ) {
if ( !Props.isInitialized() ) {
Props.init( Props.TYPE_PROPERTIES_EMPTY );
}
this.query = query;
this.connectionName = connectionName;
this.columnTypes = columnTypes;
this.columnNames = columnNames;
this.modelName = modelName;
this.securityEnabled = securityEnabled;
this.users = users;
this.roles = roles;
this.defaultAcls = defaultAcls;
this.createdBy = createdBy;
}
示例2: getStringProperty
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
public static String getStringProperty(String name, String defaultValue ) {
String value = Props.isInitialized() ? Props.getInstance().getProperty(name) : null;
if( value == null ) {
value = defaultValue;
}
return value;
}
示例3: init
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
@BeforeClass
public static void init() throws Exception {
KettleClientEnvironment.init();
PluginRegistry.addPluginType( StepPluginType.getInstance() );
PluginRegistry.init();
if ( !Props.isInitialized() ) {
Props.init( 0 );
}
}
示例4: getLongProperty
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
public static long getLongProperty(String name, long defaultValue ) {
String valueStr = Props.isInitialized() ? Props.getInstance().getProperty(name) : null;
try {
long value = Long.parseLong(valueStr);
return value;
} catch (NumberFormatException e) {
// the value for this property is not a valid number
}
return defaultValue;
}
示例5: testToLegacy
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
@Test
public void testToLegacy() throws ObjectAlreadyExistsException {
if ( !Props.isInitialized() ) {
Props.init( Props.TYPE_PROPERTIES_EMPTY );
}
SchemaMeta meta = ThinModelConverter.convertToLegacy( domain );
String locale = Locale.getDefault().toString();
// verify conversion worked.
BusinessModel model = meta.findModel( "MODEL_1" );
assertNotNull( model );
String local = model.getName( locale );
assertEquals( "newdatasource", model.getName( locale ) );
BusinessCategory cat = model.getRootCategory().findBusinessCategory( Settings.getBusinessCategoryIDPrefix() + "newdatasource" );
assertNotNull( cat );
assertEquals( "newdatasource", cat.getName( locale ) );
assertEquals( 1, cat.getBusinessColumns().size() );
// this tests the inheritance of physical cols made it through
BusinessColumn col = cat.getBusinessColumn( 0 );
assertEquals( "CUSTOMERNAME", col.getName( locale ) );
assertNotNull( col.getBusinessTable() );
assertEquals( "LOGICAL_TABLE_1", col.getBusinessTable().getId() );
assertEquals( col.getDataType(), DataTypeSettings.STRING );
assertEquals( "select customername from customers where customernumber < 171", col.getBusinessTable().getTargetTable() );
assertEquals( "select customername from customers where customernumber < 171", col.getPhysicalColumn().getTable().getTargetTable() );
assertEquals( "CUSTOMERNAME", col.getPhysicalColumn().getFormula() );
assertEquals( false, col.getPhysicalColumn().isExact() );
}
示例6: init
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
@BeforeClass
public static void init() throws Exception {
if ( !KettleClientEnvironment.isInitialized() ) {
KettleClientEnvironment.init();
}
PluginRegistry.addPluginType( StepPluginType.getInstance() );
PluginRegistry.init();
if ( !Props.isInitialized() ) {
Props.init( 0 );
}
}
示例7: getStringProperty
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
public static String getStringProperty( String name, String defaultValue ) {
String value = Props.isInitialized() ? Props.getInstance().getProperty( name ) : null;
if ( value == null ) {
value = defaultValue;
}
return value;
}
示例8: getLongProperty
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
public static long getLongProperty( String name, long defaultValue ) {
String valueStr = Props.isInitialized() ? Props.getInstance().getProperty( name ) : null;
try {
long value = Long.parseLong( valueStr );
return value;
} catch ( NumberFormatException e ) {
// the value for this property is not a valid number
}
return defaultValue;
}
示例9: getUsedArguments
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
/**
* Gets the arguments (and their values) used by this transformation. If argument values are supplied by parameter,
* the values will used for the arguments. If the values are null or empty, the method will attempt to use argument
* values from a previous execution.
*
* @param arguments
* the values for the arguments
* @return A row with the used arguments (and their values) in it.
*/
public Map<String, String> getUsedArguments( String[] arguments ) {
Map<String, String> transArgs = new HashMap<>();
for ( int i = 0; i < nrSteps(); i++ ) {
StepMetaInterface smi = getStep( i ).getStepMetaInterface();
Map<String, String> stepArgs = smi.getUsedArguments(); // Get the command line arguments that this step uses.
if ( stepArgs != null ) {
transArgs.putAll( stepArgs );
}
}
// OK, so perhaps, we can use the arguments from a previous execution?
String[] saved = Props.isInitialized() ? Props.getInstance().getLastArguments() : null;
// Set the default values on it...
// Also change the name to "Argument 1" .. "Argument 10"
//
for ( String argument : transArgs.keySet() ) {
String value = "";
int argNr = Const.toInt( argument, -1 );
if ( arguments != null && argNr > 0 && argNr <= arguments.length ) {
value = Const.NVL( arguments[argNr - 1], "" );
}
if ( value.length() == 0 ) { // try the saved option...
if ( argNr > 0 && argNr < saved.length && saved[argNr] != null ) {
value = saved[argNr - 1];
}
}
transArgs.put( argument, value );
}
return transArgs;
}
示例10: getUsedArguments
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
/**
* Get the arguments used by this transformation.
*
* @param arguments
* @return A row with the used arguments in it.
*/
public Map<String, String> getUsedArguments(String[] arguments)
{
Map<String, String> transArgs = new HashMap<String, String>();
for (int i = 0; i < nrSteps(); i++)
{
StepMetaInterface smi = getStep(i).getStepMetaInterface();
Map<String, String> stepArgs = smi.getUsedArguments(); // Get the command line arguments that this step uses.
if (stepArgs != null)
{
transArgs.putAll(stepArgs);
}
}
// OK, so perhaps, we can use the arguments from a previous execution?
String[] saved = Props.isInitialized() ? Props.getInstance().getLastArguments() : null;
// Set the default values on it...
// Also change the name to "Argument 1" .. "Argument 10"
//
for (String argument : transArgs.keySet())
{
String value = "";
int argNr = Const.toInt(argument, -1);
if (arguments!=null && argNr > 0 && argNr <= arguments.length)
{
value = Const.NVL(arguments[argNr-1], "");
}
if (value.length()==0) // try the saved option...
{
if (argNr > 0 && argNr < saved.length && saved[argNr] != null)
{
value = saved[argNr-1];
}
}
transArgs.put(argument, value);
}
return transArgs;
}
示例11: getUsedArguments
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
/**
* Gets the arguments (and their values) used by this transformation. If argument values are
* supplied by parameter, the values will used for the arguments. If the values are null or empty,
* the method will attempt to use argument values from a previous execution.
*
* @param arguments the values for the arguments
* @return A row with the used arguments (and their values) in it.
*/
public Map<String, String> getUsedArguments(String[] arguments)
{
Map<String, String> transArgs = new HashMap<String, String>();
for (int i = 0; i < nrSteps(); i++)
{
StepMetaInterface smi = getStep(i).getStepMetaInterface();
Map<String, String> stepArgs = smi.getUsedArguments(); // Get the command line arguments that this step uses.
if (stepArgs != null)
{
transArgs.putAll(stepArgs);
}
}
// OK, so perhaps, we can use the arguments from a previous execution?
String[] saved = Props.isInitialized() ? Props.getInstance().getLastArguments() : null;
// Set the default values on it...
// Also change the name to "Argument 1" .. "Argument 10"
//
for (String argument : transArgs.keySet())
{
String value = "";
int argNr = Const.toInt(argument, -1);
if (arguments!=null && argNr > 0 && argNr <= arguments.length)
{
value = Const.NVL(arguments[argNr-1], "");
}
if (value.length()==0) // try the saved option...
{
if (argNr > 0 && argNr < saved.length && saved[argNr] != null)
{
value = saved[argNr-1];
}
}
transArgs.put(argument, value);
}
return transArgs;
}
示例12: InlineEtlModelGenerator
import org.pentaho.di.core.Props; //导入方法依赖的package包/类
public InlineEtlModelGenerator() {
if ( !Props.isInitialized() ) {
Props.init( Props.TYPE_PROPERTIES_EMPTY );
}
}