/** * This is a factory method for this DefaultPackageName configuration. * The factory method is a best practice for the case where the * actual object construction is changed in the future. * * @param packageName the name of the package to be configured as default * * @return the actual type safe default package name configuration. */ public static DefaultPackageNameOption get( String packageName ) { return new DefaultPackageNameOption( packageName ); }
public <T extends KnowledgeBuilderOption> void setOption(T option) { if ( option instanceof DefaultDialectOption ) { this.defaultDialect = (DefaultDialectOption) option; } else if ( option instanceof AccumulateFunctionOption ) { this.accumulateFunctions.put( ((AccumulateFunctionOption) option).getName(), ((AccumulateFunctionOption) option).getFunction() ); } else if ( option instanceof DumpDirOption ) { this.dumpDirectory = ((DumpDirOption) option).getDirectory(); } else if ( option instanceof EvaluatorOption ) { this.evaluatorRegistry.addEvaluatorDefinition( (EvaluatorDefinition) ((EvaluatorOption)option).getEvaluatorDefinition() ); } else if ( option instanceof ProcessStringEscapesOption ) { this.processStringEscapes = ((ProcessStringEscapesOption) option).isProcessStringEscapes(); } else if ( option instanceof DefaultPackageNameOption ) { setDefaultPackageName( ((DefaultPackageNameOption) option).getPackageName() ); } else if ( option instanceof ClassLoaderCacheOption ) { setClassLoaderCacheEnabled( ((ClassLoaderCacheOption) option).isClassLoaderCacheEnabled() ); } else if ( option instanceof KBuilderSeverityOption ) { this.severityMap.put(((KBuilderSeverityOption) option).getName(), ((KBuilderSeverityOption) option).getSeverity()); } else if ( option instanceof PropertySpecificOption ) { propertySpecificOption = (PropertySpecificOption)option; } }
@SuppressWarnings("unchecked") public <T extends SingleValueKnowledgeBuilderOption> T getOption(Class<T> option) { if ( DefaultDialectOption.class.equals( option ) ) { return (T) this.defaultDialect; } else if ( DumpDirOption.class.equals( option ) ) { return (T) DumpDirOption.get( this.dumpDirectory ); } else if ( ProcessStringEscapesOption.class.equals( option ) ) { return (T) (this.processStringEscapes ? ProcessStringEscapesOption.YES : ProcessStringEscapesOption.NO); } else if ( DefaultPackageNameOption.class.equals( option ) ) { return (T) DefaultPackageNameOption.get( this.defaultPackageName ); } else if ( ClassLoaderCacheOption.class.equals( option ) ) { return (T) (this.classLoaderCache ? ClassLoaderCacheOption.ENABLED : ClassLoaderCacheOption.DISABLED); } else if ( PropertySpecificOption.class.equals( option ) ) { return (T)propertySpecificOption; } return null; }
return org.kie.internal.builder.conf.DefaultPackageNameOption.get(legacyOption.getPackageName());
/** * This is a factory method for this DefaultPackageName configuration. * The factory method is a best practice for the case where the * actual object construction is changed in the future. * * @param packageName the name of the package to be configured as default * * @return the actual type safe default package name configuration. */ public static DefaultPackageNameOption get( String packageName ) { return new DefaultPackageNameOption( packageName ); }
/** * This is a factory method for this DefaultPackageName configuration. * The factory method is a best practice for the case where the * actual object construction is changed in the future. * * @param packageName the name of the package to be configured as default * * @return the actual type safe default package name configuration. */ public static DefaultPackageNameOption get( String packageName ) { return new DefaultPackageNameOption( packageName ); }