本文整理匯總了Java中org.pentaho.di.core.annotations.Step類的典型用法代碼示例。如果您正苦於以下問題:Java Step類的具體用法?Java Step怎麽用?Java Step使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Step類屬於org.pentaho.di.core.annotations包,在下文中一共展示了Step類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testStepAnnotations
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Test
public void testStepAnnotations() {
// PDI Plugin Annotation-based Classloader checks
Step stepAnnotation = KafkaConsumerMeta.class.getAnnotation(Step.class);
assertNotNull(stepAnnotation);
assertFalse(Utils.isEmpty(stepAnnotation.id()));
assertFalse(Utils.isEmpty(stepAnnotation.name()));
assertFalse(Utils.isEmpty(stepAnnotation.description()));
assertFalse(Utils.isEmpty(stepAnnotation.image()));
assertFalse(Utils.isEmpty(stepAnnotation.categoryDescription()));
assertFalse(Utils.isEmpty(stepAnnotation.i18nPackageName()));
assertFalse(Utils.isEmpty(stepAnnotation.documentationUrl()));
assertFalse(Utils.isEmpty(stepAnnotation.casesUrl()));
assertEquals(KafkaConsumerMeta.class.getPackage().getName(), stepAnnotation.i18nPackageName());
hasi18nValue(stepAnnotation.i18nPackageName(), stepAnnotation.name());
hasi18nValue(stepAnnotation.i18nPackageName(), stepAnnotation.description());
hasi18nValue(stepAnnotation.i18nPackageName(), stepAnnotation.documentationUrl());
hasi18nValue(stepAnnotation.i18nPackageName(), stepAnnotation.casesUrl());
}
示例2: PluginLoader
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
private PluginLoader()
{
tests.put(Job.class, new ResolverUtil.AnnotatedWith(Job.class));
tests.put(Step.class, new ResolverUtil.AnnotatedWith(Step.class));
locs = new HashSet<PluginLocation>();
plugins = new HashMap<Class<? extends Annotation>, Set<? extends Plugin>>();// HashSet<Plugin>();
// initialize map
plugins.put(Job.class, new HashSet<JobPlugin>());
plugins.put(Step.class, new HashSet<StepPlugin>());
}
示例3: getDefinedPlugins
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
public <E extends Plugin> Collection<E> getDefinedPlugins(Class<E> pluginType)
throws KettleConfigException
{
Class type = pluginType == JobPlugin.class ? Job.class : Step.class;
for (Map.Entry<Class<? extends Annotation>, Set<? extends Plugin>> entry : this.plugins.entrySet())
{
if (entry.getKey() == type)
{
return (Collection<E>) entry.getValue();
}
}
throw new KettleConfigException("Invalid plugin type: " + type);
}
示例4: load
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@SuppressWarnings("unchecked") //this is ok here because we defined T above.
public Collection<T> load() throws KettleConfigException
{
// saving old value for change the loglevel to BASIC to avoid i18n messages, see below
int oldLogLevel=LogWriter.getInstance().getLogLevel();
ResolverUtil<StepPluginMeta> resolver = new ResolverUtil<StepPluginMeta>();
// If there is a system wide property set with name KETTLE_PLUGIN_PACKAGES we search those packages as well
//
String allPackages = packages;
String extraPackages = System.getProperty(Const.KETTLE_PLUGIN_PACKAGES);
if (!Const.isEmpty(extraPackages)) {
allPackages+=","+extraPackages;
}
resolver.find(new ResolverUtil.AnnotatedWith(Step.class), allPackages != null ? allPackages.split(",") : new String[] {});
Collection<StepPluginMeta> steps = new LinkedHashSet<StepPluginMeta>(resolver.size());
for (Class<?> clazz : resolver.getClasses())
{
Step step = clazz.getAnnotation(Step.class);
String[] stepName = step.name();
if (stepName.length == 1 && stepName[0].equals("")) // default
stepName = new String[] { clazz.getName() };
// The package name to get the descriptions or tool tip from...
//
String packageName = step.i18nPackageName();
if (Const.isEmpty(packageName)) packageName = org.pentaho.di.trans.step.Messages.class.getPackage().getName();
// An alternative package to get the description or tool tip from...
//
String altPackageName = clazz.getPackage().getName();
// Determine the i18n description of the step description (name)
//
LogWriter.getInstance().setLogLevel(LogWriter.LOG_LEVEL_BASIC); // avoid i18n messages for missing locale
String description = BaseMessages.getString(packageName, step.description());
if (description.startsWith("!") && description.endsWith("!")) description=Messages.getString(step.description());
LogWriter.getInstance().setLogLevel(oldLogLevel); // restore loglevel, when the last alternative fails, log it when loglevel is detailed
if (description.startsWith("!") && description.endsWith("!")) description=BaseMessages.getString(altPackageName, step.description());
// Determine the i18n tool tip text for the step (the extended description)
//
LogWriter.getInstance().setLogLevel(LogWriter.LOG_LEVEL_BASIC); // avoid i18n messsages for missing locale
String tooltip = BaseMessages.getString(packageName, step.tooltip());
if (tooltip.startsWith("!") && tooltip.endsWith("!")) tooltip=Messages.getString(step.tooltip());
LogWriter.getInstance().setLogLevel(oldLogLevel); // restore loglevel, when the last alternative fails, log it when loglevel is detailed
if (tooltip.startsWith("!") && tooltip.endsWith("!")) tooltip=BaseMessages.getString(altPackageName, step.tooltip());
// If the step should have a separate category, this is the place to calculate that
// This calculation is only used if the category is USER_DEFINED
//
String category;
if (step.category()!=StepCategory.CATEGORY_USER_DEFINED) {
category = StepCategory.BRIDGE_ANNOTATION_CATEGORY_NUMBERS[step.category()].getName();
}
else {
LogWriter.getInstance().setLogLevel(LogWriter.LOG_LEVEL_BASIC); // avoid i18n messsages for missing locale
category = BaseMessages.getString(packageName, step.categoryDescription());
if (category.startsWith("!") && category.endsWith("!")) category=Messages.getString(step.categoryDescription());
LogWriter.getInstance().setLogLevel(oldLogLevel); // restore loglevel, when the last alternative fails, log it when loglevel is detailed
if (category.startsWith("!") && category.endsWith("!")) category=BaseMessages.getString(altPackageName, step.categoryDescription());
}
steps.add(new StepPluginMeta(clazz, stepName, description, tooltip, step.image(), category));
}
return (Collection<T>)steps;
}
示例5: StepPluginType
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
private StepPluginType() {
super(Step.class, "STEP", "Step");
populateFolders("steps");
}
示例6: extractCategory
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractCategory(Annotation annotation) {
return ((Step) annotation).categoryDescription();
}
示例7: extractDesc
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractDesc(Annotation annotation) {
return ((Step) annotation).description();
}
示例8: extractID
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractID(Annotation annotation) {
return ((Step) annotation).id();
}
示例9: extractName
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractName(Annotation annotation) {
return ((Step) annotation).name();
}
示例10: extractImageFile
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractImageFile(Annotation annotation) {
return ((Step) annotation).image();
}
示例11: extractSeparateClassLoader
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected boolean extractSeparateClassLoader(Annotation annotation) {
return ((Step) annotation).isSeparateClassLoaderNeeded();
}
示例12: extractI18nPackageName
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractI18nPackageName(Annotation annotation) {
return ((Step) annotation).i18nPackageName();
}
示例13: extractDocumentationUrl
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractDocumentationUrl(Annotation annotation) {
return ((Step)annotation).documentationUrl();
}
示例14: extractCasesUrl
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractCasesUrl(Annotation annotation) {
return ((Step)annotation).casesUrl();
}
示例15: extractForumUrl
import org.pentaho.di.core.annotations.Step; //導入依賴的package包/類
@Override
protected String extractForumUrl(Annotation annotation) {
return ((Step)annotation).forumUrl();
}