本文整理汇总了Java中org.pentaho.di.core.injection.Injection.name方法的典型用法代码示例。如果您正苦于以下问题:Java Injection.name方法的具体用法?Java Injection.name怎么用?Java Injection.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.injection.Injection
的用法示例。
在下文中一共展示了Injection.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addInjectionProperty
import org.pentaho.di.core.injection.Injection; //导入方法依赖的package包/类
protected void addInjectionProperty( Injection metaInj, BeanLevelInfo leaf ) {
if ( StringUtils.isBlank( metaInj.name() ) ) {
throw new RuntimeException( "Property name shouldn't be blank in the " + clazz );
}
String propertyName = calcPropertyName( metaInj, leaf );
if ( properties.containsKey( propertyName ) ) {
throw new RuntimeException( "Property '" + propertyName + "' already defined for " + clazz );
}
// probably hided
if ( hideProperties.contains( propertyName ) ) {
return;
}
Property prop = new Property( propertyName, metaInj.group(), leaf.createCallStack() );
properties.put( prop.name, prop );
Group gr = groupsMap.get( metaInj.group() );
if ( gr == null ) {
throw new RuntimeException( "Group '" + metaInj.group() + "' for property '" + metaInj.name()
+ "' is not defined " + clazz );
}
gr.groupProperties.add( prop );
}
示例2: calcPropertyName
import org.pentaho.di.core.injection.Injection; //导入方法依赖的package包/类
private String calcPropertyName( Injection metaInj, BeanLevelInfo leaf ) {
String name = metaInj.name();
while ( leaf != null ) {
if ( StringUtils.isNotBlank( leaf.prefix ) ) {
name = leaf.prefix + '.' + name;
}
leaf = leaf.parent;
}
if ( !name.equals( metaInj.name() ) && !metaInj.group().isEmpty() ) {
// group exist with prefix
throw new RuntimeException( "Group shouldn't be declared with prefix in " + clazz );
}
return name;
}