use of org.whole.lang.visitors.IVisitor in project whole by wholeplatform.
the class CommonsUIDeployer method deploy.
public void deploy(ReflectionFactory platform) {
platform.addEditorKit(CommonsEditorKit.ID);
platform.addOperationFactory(CommonsLanguageKit.URI, ContentAssistOperation.ID, new IVisitorFactory() {
public IVisitor create(IOperation operation, int stage) {
return new CommonsUIContentAssistVisitor();
}
});
}
use of org.whole.lang.visitors.IVisitor in project whole by wholeplatform.
the class XmlLanguageDeployer method deploy.
public void deploy(ReflectionFactory platform) {
platform.addLanguageKit(new XmlLanguageKit());
platform.addOperationFactory(XmlLanguageKit.URI, GenericBuilderAdapterOperation.ID, new IBuilderFactory() {
public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
return new XmlGenericBuilderAdapter((IXmlBuilder) strategy, entityContext);
}
});
platform.addOperationFactory(XmlLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {
public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
return new XmlSpecificBuilderAdapter(strategy, entityContext);
}
});
platform.addOperationFactory(XmlLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {
public IVisitor create(IOperation operation, int stage) {
return new XmlPrettyPrinterVisitor((PrettyPrinterOperation) operation);
}
});
platform.addOperationFactory(XmlLanguageKit.URI, NormalizerOperation.ID, new IVisitorFactory() {
public IVisitor create(IOperation operation, int stage) {
return new XmlNormalizerVisitor();
}
});
platform.addPersistenceKit("org.whole.lang.xml.XmlBuilderEditor", XmlBuilderPersistenceKit.instance());
platform.addPersistenceKit("org.whole.lang.xml.XmlSourceEditor", XmlSourcePersistenceKit.instance());
}
use of org.whole.lang.visitors.IVisitor in project whole by wholeplatform.
the class ScriptsLanguageDeployer method deploy.
public void deploy(ReflectionFactory platform) {
platform.addLanguageKit(new ScriptsLanguageKit());
platform.addOperationFactory(ScriptsLanguageKit.URI, GenericBuilderAdapterOperation.ID, new IBuilderFactory() {
public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
return new ScriptsGenericBuilderAdapter((IScriptsBuilder) strategy, entityContext);
}
});
platform.addOperationFactory(ScriptsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {
public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
return new ScriptsSpecificBuilderAdapter(strategy, entityContext);
}
});
platform.addOperationFactory(ScriptsLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {
public IVisitor create(IOperation operation, int stage) {
if (stage == 0)
return new ScriptsInterpreterVisitor();
else
return null;
}
});
}
use of org.whole.lang.visitors.IVisitor in project whole by wholeplatform.
the class Matcher method findAncestor.
@SuppressWarnings("unchecked")
public static <E extends IEntity> E findAncestor(E pattern, IEntity model, IBindingManager bindings) {
IVisitor mv = GenericMatcherFactory.instance.matchInScope(pattern);
mv.setBindings(bindings);
return (E) findAncestor(mv, model);
}
use of org.whole.lang.visitors.IVisitor in project whole by wholeplatform.
the class Matcher method findAncestorOrSelf.
@SuppressWarnings("unchecked")
public static <E extends IEntity> E findAncestorOrSelf(E pattern, IEntity model, IBindingManager bindings) {
IVisitor mv = GenericMatcherFactory.instance.matchInScope(pattern);
mv.setBindings(bindings);
return (E) findAncestorOrSelf(mv, model);
}
Aggregations