本文整理汇总了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;
}