Package com.google.gxp.compiler.base

Examples of com.google.gxp.compiler.base.Root


  public BoundTree apply(ReparentedTree reparentedTree) {
    Set<Callable> requirements = Sets.newHashSet();
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(reparentedTree.getAlerts());

    Root oldRoot = reparentedTree.getRoot();
    ServiceDirectory serviceDirectory =
        new ScopedServiceDirectory(alertSetBuilder,
                                   baseServiceDirectory,
                                   oldRoot.getName().getPackageName(),
                                   oldRoot.getImports());

    Root newRoot = oldRoot.acceptVisitor(
        new Visitor(alertSetBuilder, schemaFactory, serviceDirectory, requirements));

    return new BoundTree(reparentedTree.getSourcePosition(), alertSetBuilder.buildAndClear(),
                         newRoot, requirements);
  }
View Full Code Here


*/
public class Validator implements Function<EscapedTree, ValidatedTree> {

  public ValidatedTree apply(EscapedTree tree) {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(tree.getAlerts());
    Root root = tree.getRoot().acceptVisitor(new Visitor(alertSetBuilder));

    return new ValidatedTree(tree.getSourcePosition(), alertSetBuilder.buildAndClear(), root);
  }
View Full Code Here

   *
   * @throws IllegalArgumentException if {@code templateName} is not fully
   * qualified (ie: does not have a package name)
   */
  public Callable getCallable(TemplateName templateName) {
    Root root = getRoot(templateName);
    return (root == null) ? null : root.getCallable();
  }
View Full Code Here

   *
   * @throws IllegalArgumentException if {@code templateName} is not fully
   * qualified (ie: does not have a package name)
   */
  public InstanceCallable getInstanceCallable(TemplateName templateName) {
    Root root = getRoot(templateName);
    return (root == null) ? null : root.getInstanceCallable();
  }
View Full Code Here

   *
   * @throws IllegalArgumentException if {@code templateName} is not fully
   * qualified (ie: does not have a package name)
   */
  public Implementable getImplementable(TemplateName templateName) {
    Root root = getRoot(templateName);
    return (root == null) ? null : root.getImplementable();
  }
View Full Code Here

*/
public class ContentFlattener implements Function<ValidatedTree, ContentFlattenedTree> {

  public ContentFlattenedTree apply(ValidatedTree tree) {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(tree.getAlerts());
    Root root = tree.getRoot().acceptVisitor(new Visitor(alertSetBuilder));

    return new ContentFlattenedTree(tree.getSourcePosition(), alertSetBuilder.buildAndClear(),
                                    root);
  }
View Full Code Here

                             Collections.<FormalTypeParameter>emptyList(),
                             collapse(input, null, null));
    BoundTree inTree = new BoundTree(pos(), AlertSet.EMPTY, root,
                                     Collections.<Callable>emptySet());
    SpaceCollapsedTree outTree = COLLAPSER.apply(inTree);
    Root newRoot = outTree.getRoot();
    assertTrue(newRoot + " is not a Template",
               newRoot instanceof Template);
    Template newTemplate = (Template)newRoot;
    assertEquals(expected, newTemplate.getContent());
  }
View Full Code Here

*/
public class PlaceholderInserter implements Function<SpaceCollapsedTree, PlaceholderInsertedTree> {

  public PlaceholderInsertedTree apply(SpaceCollapsedTree tree) {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(tree.getAlerts());
    Root root = tree.getRoot().acceptVisitor(new Visitor(alertSetBuilder));

    return new PlaceholderInsertedTree(tree.getSourcePosition(), alertSetBuilder.buildAndClear(),
                                       root);
  }
View Full Code Here

    Parts parts = groupParts(alertSetBuilder, parseTree, noAttrs, children);

    // Throw out all but the first Root. The parse phase should have
    // already complained about there being too many roots.
    List<Root> roots = parts.getRoots();
    Root root = roots.isEmpty()
        ? new NullRoot(parseTree, TemplateName.parseFullyQualifiedDottedName(className))
        : roots.get(0);
    return new ReparentedTree(parseTree.getSourcePosition(),
                              alertSetBuilder.buildAndClear(),
                              root);
View Full Code Here

public class MessageExtractor implements Function<I18nCheckedTree, MessageExtractedTree> {

  public MessageExtractedTree apply(I18nCheckedTree tree) {
    List<ExtractedMessage> messages = Lists.newArrayList();
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(tree.getAlerts());
    Root root = tree.getRoot().acceptVisitor(new OutsideMessageVisitor(alertSetBuilder, messages));

    return new MessageExtractedTree(tree.getSourcePosition(), alertSetBuilder.buildAndClear(),
                                    root, messages);
  }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.base.Root

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.