Examples of TreeBuilder


Examples of de.odysseus.el.tree.TreeBuilder

  public static void main(String... args) throws NoSuchMethodException {
    // this is the method we want to invoke
    Method method = String.class.getMethod("matches", String.class);

    // create our customized builder
    TreeBuilder builder = new Builder(Builder.Feature.METHOD_INVOCATIONS);

    // create our factory which uses our customized builder
    ExpressionFactory f = new ExpressionFactoryImpl(new TreeStore(builder, new Cache(10)));

    // create our resolver
View Full Code Here

Examples of de.odysseus.el.tree.TreeBuilder

  /**
   * Sample usage: enable resolving <code>null</code> properties.
   */
  public static void main(String... args) throws NoSuchMethodException {
    // create our customized builder
    TreeBuilder builder = new Builder(Builder.Feature.NULL_PROPERTIES);

    // create our factory which uses our customized builder
    ExpressionFactory f = new ExpressionFactoryImpl(new TreeStore(builder, new Cache(10)));

    // create our context
View Full Code Here

Examples of de.odysseus.el.tree.TreeBuilder

      if (Boolean.valueOf(properties.getProperty("javax.el.varArgs"))) {
        features.add(Builder.Feature.VARARGS);
      }
    }
   
    TreeBuilder builder = createTreeBuilder(properties, features.toArray(new Builder.Feature[0]));

    // create cache
    int cacheSize = defaultCacheSize;
    if (properties != null && properties.containsKey("javax.el.cacheSize")) {
      try {
View Full Code Here

Examples of net.opentsdb.tree.TreeBuilder

                new ArrayList<TreeBuilder>(trees.size());
                for (Tree tree : trees) {
                  if (!tree.getEnabled()) {
                    continue;
                  }
                  final TreeBuilder builder = new TreeBuilder(tsdb, tree);
                  tree_builders.add(builder);
                }
               
                for (TreeBuilder builder : tree_builders) {
                  builder_calls.add(builder.processTimeseriesMeta(meta));
                }
                return Deferred.group(builder_calls)
                  .addCallback(new TreeBuilderBufferCB());
              } else {
                return Deferred.fromResult(false);
View Full Code Here

Examples of net.paoding.rose.web.impl.mapping.TreeBuilder

        MappingNode mappingTree = new MappingNode(rootMapping);
        LinkedEngine rootEngine = new LinkedEngine(null, new RootEngine(instructionExecutor),
                mappingTree);
        mappingTree.getMiddleEngines().addEngine(ReqMethod.ALL, rootEngine);

        TreeBuilder treeBuilder = new TreeBuilder();
        treeBuilder.create(mappingTree, modules);

        return mappingTree;
    }
View Full Code Here

Examples of net.paoding.rose.web.impl.mapping.TreeBuilder

        MappingNode mappingTree = new MappingNode(rootMapping);
        LinkedEngine rootEngine = new LinkedEngine(null, new RootEngine(instructionExecutor),
                mappingTree);
        mappingTree.getMiddleEngines().addEngine(ReqMethod.ALL, rootEngine);

        TreeBuilder treeBuilder = new TreeBuilder();
        treeBuilder.create(mappingTree, modules);

        return mappingTree;
    }
View Full Code Here

Examples of net.sf.saxon.tree.TreeBuilder

        }
    }

    private static class LinkedTree extends TreeModel {
        public Builder makeBuilder() {
            return new TreeBuilder();
        }
View Full Code Here

Examples of net.sf.saxon.tree.TreeBuilder

            throw err;
        }

        try {
            DocumentImpl oldRoot = (DocumentImpl)getDocumentRoot();
            TreeBuilder builder = new TreeBuilder();
            builder.setPipelineConfiguration(pss.getConfiguration().makePipelineConfiguration());
            builder.setNodeFactory(nodeFactory);
            builder.setSystemId(this.getSystemId());

            builder.open();
            builder.startDocument(0);

            int st = StandardNames.XSL_STYLESHEET;
            builder.startElement(st, StandardNames.XS_UNTYPED, 0, 0);
            builder.namespace(NamespaceConstant.XSLT_CODE, 0);
            builder.attribute(pool.allocate("", "", "version"), StandardNames.XS_UNTYPED_ATOMIC, version, 0, 0);
            builder.startContent();

            int te = StandardNames.XSL_TEMPLATE;
            builder.startElement(te, StandardNames.XS_UNTYPED, 0, 0);
            builder.attribute(pool.allocate("", "", "match"), StandardNames.XS_UNTYPED_ATOMIC, "/", 0, 0);
            builder.startContent();

            builder.graftElement(this);

            builder.endElement();
            builder.endElement();
            builder.endDocument();
            builder.close();

            DocumentImpl newRoot = (DocumentImpl)builder.getCurrentRoot();
            newRoot.graftLocationMap(oldRoot);
            return newRoot;
        } catch (XPathException err) {
            //TransformerConfigurationException e = new TransformerConfigurationException(err);
            err.setLocator(this);
View Full Code Here

Examples of net.sf.saxon.tree.TreeBuilder

        setPipelineConfiguration(config.makePipelineConfiguration());

        nodeFactory = config.getStyleNodeFactory();

        builder = new TreeBuilder();
        builder.setPipelineConfiguration(getPipelineConfiguration());
        builder.setNodeFactory(nodeFactory);
        builder.setLineNumbering(true);

        StartTagBuffer startTagBuffer = new StartTagBuffer();
View Full Code Here

Examples of net.sf.saxon.tree.TreeBuilder

     *     module
     */
    public DocumentImpl loadStylesheetModule(Source styleSource, StyleNodeFactory nodeFactory)
    throws XPathException {

        TreeBuilder styleBuilder = new TreeBuilder();
        PipelineConfiguration pipe = config.makePipelineConfiguration();
        pipe.setURIResolver(compilerInfo.getURIResolver());
        styleBuilder.setPipelineConfiguration(pipe);
        styleBuilder.setSystemId(styleSource.getSystemId());
        styleBuilder.setNodeFactory(nodeFactory);
        styleBuilder.setLineNumbering(true);

        StartTagBuffer startTagBuffer = new StartTagBuffer();

        UseWhenFilter useWhenFilter = new UseWhenFilter(startTagBuffer);
        useWhenFilter.setUnderlyingReceiver(styleBuilder);

        startTagBuffer.setUnderlyingReceiver(useWhenFilter);

        StylesheetStripper styleStripper = new StylesheetStripper();
        styleStripper.setUnderlyingReceiver(startTagBuffer);

        CommentStripper commentStripper = new CommentStripper();
        commentStripper.setUnderlyingReceiver(styleStripper);

        // build the stylesheet document

        DocumentImpl doc;

        Sender sender = new Sender(pipe);
        AugmentedSource aug = AugmentedSource.makeAugmentedSource(styleSource);
        aug.setSchemaValidationMode(Validation.STRIP);
        aug.setDTDValidationMode(Validation.STRIP);
        aug.setLineNumbering(true);
        if (aug.getXMLReader() == null && Configuration.getPlatform().isJava()) {
            XMLReader styleParser = config.getStyleParser();
            aug.setXMLReader(styleParser);
            sender.send(aug, commentStripper, new ParseOptions());
            config.reuseStyleParser(styleParser);
        } else {
            sender.send(aug, commentStripper, new ParseOptions());
        }
        doc = (DocumentImpl)styleBuilder.getCurrentRoot();
        styleBuilder.reset();

        if (aug.isPleaseCloseAfterUse()) {
            aug.close();
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.