本文整理匯總了Java中org.aikodi.chameleon.input.ModelFactory類的典型用法代碼示例。如果您正苦於以下問題:Java ModelFactory類的具體用法?Java ModelFactory怎麽用?Java ModelFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ModelFactory類屬於org.aikodi.chameleon.input包,在下文中一共展示了ModelFactory類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: create
import org.aikodi.chameleon.input.ModelFactory; //導入依賴的package包/類
/**
* Create a JLo language object with the following plugins attached:
* <ul>
* <li>Syntax: JLoSyntax</li>
* <li>ModelFactory: JLoModelFactory</li>
* <li>Factory: JLoFactory</li>
* <li>ObjectOrientedFactory: JLoFactory</li>
* <li>ProjectConfigurator: JLoConfigLoader</li>
* </ul>
* @return
*/
public JLo create() {
JLo result = new JLo();
result.setPlugin(ModelFactory.class, new JLoModelFactory());
// result.setPlugin(ModelFactory.class, new OldJLoModelFactory());
result.setPlugin(Syntax.class, new JLoSyntax());
JLoFactory factory = new JLoFactory();
result.setPlugin(Factory.class, factory);
result.setPlugin(ObjectOrientedFactory.class, factory);
result.setPlugin(ExpressionFactory.class, new JavaExpressionFactory());
result.setPlugin(ProjectConfigurator.class, new JLoProjectConfigurator(Java7LanguageFactory.javaBaseJar()));
return result;
}
示例2: create
import org.aikodi.chameleon.input.ModelFactory; //導入依賴的package包/類
/**
* {@inheritDoc}
*
* <p>The resulting language object has the following plugins:</p>
* <ol>
* <li>{@link ModelFactory} : {@link JavaModelFactory}</li>
* <li>{@link Syntax} : {@link Java7Syntax}</li>
* <li>{@link Factory} : {@link Java7Factory}</li>
* <li>{@link ObjectOrientedFactory} : {@link Java7Factory}</li>
* <li>{@link ExpressionFactory} : {@link JavaExpressionFactory}</li>
* <li>{@link ProjectConfigurator} : {@link JavaProjectConfigurator}</li>
* </ol>
*/
public Java7 create() throws ConfigException {
Java7 result = new Java7();
result.setPlugin(ModelFactory.class, new JavaModelFactory());
result.setPlugin(Syntax.class, new Java7Syntax());
// FIXME: Stupid and inefficient
result.setPlugin(Factory.class, new Java7Factory());
result.setPlugin(ObjectOrientedFactory.class, new Java7Factory());
result.setPlugin(ExpressionFactory.class, new JavaExpressionFactory());
JarFile jarName = javaBaseJar();
result.setPlugin(ProjectConfigurator.class, new JavaProjectConfigurator(jarName));
return result;
}