Examples of NodeFactory


Examples of ca.nengo.model.impl.NodeFactory

            /*
             * Advanced properties, these may not necessarily be configued, so
             */
            ApproximatorFactory approxFactory = (ApproximatorFactory) prop.getValue(pApproximator);
            NodeFactory nodeFactory = (NodeFactory) prop.getValue(pNodeFactory);
            Sign encodingSign = (Sign) prop.getValue(pEncodingSign);
            Float encodingDistribution = (Float) prop.getValue(pEncodingDistribution);
            Float radius = (Float) prop.getValue(pRadius);
            Float noise = (Float) prop.getValue(pNoise);

View Full Code Here

Examples of com.projity.grouping.core.NodeFactory

      int subprojectLevel=getChildrenSubprojectLevel(parent);

      int childCount=p.getChildCount();
      if (position>childCount){
        NodeFactory nodeFactory=NodeFactory.getInstance();
        for (int i=childCount;i<position;i++){
          Node node=nodeFactory.createVoidNode();
          setSubprojectLevel(node,subprojectLevel);
          p.add(node);
        }
      }
View Full Code Here

Examples of fr.esrf.tangoatk.widget.dnd.NodeFactory

  }
   
   
   
    protected void addAttributes(DefaultMutableTreeNode top, AttributeList attributes) {
    NodeFactory nodeFactory = NodeFactory.getInstance();
  IAttribute attribute;
  DefaultMutableTreeNode node;
  for (int j = 0; j < attributes.size(); j++) {
      attribute = (IAttribute)attributes.get(j);
      node = new DefaultMutableTreeNode(nodeFactory.getNode4Entity(attribute));
      top.add(node);
  } // end of for ()
    }
View Full Code Here

Examples of macromedia.asc.parser.NodeFactory

    public int ExplicitVar( Context cx, ObjectValue ob, String name, Namespaces namespaces, TypeValue type, int expected_id, int method_id , int var_id )
    {
        int slot_id = super.ExplicitVar(cx,ob,name,namespaces,type,expected_id,-1/*method_id*/,-1/*var_id*/);
        ob.getSlot(cx,slot_id).addType(type.getDefaultTypeInfo());
        Slot slot = ob.getSlot(cx,slot_id);
        NodeFactory nf = cx.getNodeFactory();
        slot.setBaseNode(nf.memberExpression(null,nf.getExpression(nf.identifier(classname.toString(),0))));
        return slot_id;
    }
View Full Code Here

Examples of nu.xom.NodeFactory

  StaxBuilder(XMLInputFactory inputFactory, NodeFactory factory) {
    super(new DummyXMLReader(), false, factory);
    if (inputFactory == null)
      throw new IllegalArgumentException("XMLInputFactory must not be null");   
    this.inputFactory = inputFactory;
    if (factory == null) factory = new NodeFactory();
    this.factory = factory;
  }
View Full Code Here

Examples of nu.xom.NodeFactory

  public Document deserialize(InputStream input, NodeFactory factory)
      throws BinaryParsingException, IOException {
   
    if (input == null)
      throw new IllegalArgumentException("input stream must not be null");
    if (factory == null) factory = new NodeFactory();
   
    // read document header
    if (page == null) page = new ArrayByteList(256);
    page.clear();
    if (!page.ensureRemaining(input, 4 + 1 + 1 + 4))
View Full Code Here

Examples of nu.xom.NodeFactory

   */
  public StaxParser(XMLStreamReader reader, NodeFactory factory) {
    if (reader == null)
      throw new IllegalArgumentException("reader must not be null")
    this.reader = reader;
    if (factory == null) factory = new NodeFactory();
    this.factory = factory;
    if (DEBUG) System.err.println("StAX parser=" + reader.getClass().getName());
    if (!isNamespaceAware(reader))
      throw new IllegalArgumentException("reader must be namespace aware");
  }
View Full Code Here

Examples of nu.xom.NodeFactory

        addAttributes(elem);
        return elem.getAttribute(0).copy();
      }
      case XMLStreamConstants.START_DOCUMENT:
      case XMLStreamConstants.END_DOCUMENT:
        return new NodeFactory().startMakingDocument();
      case XMLStreamConstants.PROCESSING_INSTRUCTION:
        return new ProcessingInstruction(
            reader.getPITarget(), reader.getPIData());
      case XMLStreamConstants.COMMENT:
        return new Comment(reader.getText());
      case XMLStreamConstants.SPACE:
      case XMLStreamConstants.CDATA:
      case XMLStreamConstants.ENTITY_REFERENCE:
      case XMLStreamConstants.CHARACTERS:
        return readText();
      case XMLStreamConstants.DTD: {
        Nodes nodes = null;
        try {
          nodes = readDocType(new NodeFactory());
        } catch (XMLStreamException e) {
          StaxUtil.wrapException(e);
        }
        if (nodes.size() > 0) return nodes.get(0);
        return null; // unsupported extended DTD API
View Full Code Here

Examples of nu.xom.NodeFactory

    if (args.length == 0) { // simply convert from System.in to System.out
      InputStream in = new BufferedInputStream(System.in);
      if (codec.isBnuxDocument(in)) {
        StreamingSerializer ser = factory.createXMLSerializer(System.out, "UTF-8");
        NodeFactory redirector = XOMUtil.getRedirectingNodeFactory(ser);
        codec.deserialize(in, redirector);
      } else { // it's an XML document (or rubbish)
        StreamingSerializer ser = factory.createBinaryXMLSerializer(System.out, compressionLevel);
        NodeFactory redirector = XOMUtil.getRedirectingNodeFactory(ser);
        new Builder(redirector).build(in);
      }
      return;
    }
   
    for (int run=0; run < runs; run++) {
      long s = System.currentTimeMillis();
      for (int i=0; i < args.length; i++) {
        long start, end;
        String fileName = args[i];
        File file = new File(fileName);
        if (file.isDirectory()) continue; // ignore
        System.out.print(fileName + " --> ");
        InputStream in = new FileInputStream(file);       
        OutputStream out = null;
       
        if (fileName.endsWith(".bnux")) {
          NodeFactory redirector = null;
          if (readOnly) {
            redirector = XOMUtil.getNullNodeFactory();
          } else {
            String destFileName = fileName.substring(0, fileName.length() - ".bnux".length());
            System.out.print(destFileName);
            out = new FileOutputStream(destFileName);
            StreamingSerializer ser = factory.createXMLSerializer(out, "UTF-8");
            redirector = XOMUtil.getRedirectingNodeFactory(ser);
          }
         
          start = System.currentTimeMillis();
         
          codec.deserialize(in, redirector); // perform conversion       
        }
        else { // it's a textual XML document
          NodeFactory redirector = null;
          if (readOnly) {
            redirector = XOMUtil.getNullNodeFactory();
          } else {
            String destFileName = fileName + ".bnux";
            System.out.print(destFileName);
View Full Code Here

Examples of nu.xom.NodeFactory

    if (mode.indexOf("pool") >= 0) {
      builder = BuilderPool.GLOBAL_POOL.getBuilder(false);
    }
   
    if (mode.equals("xom-V")) {
      builder = new Builder(new NodeFactory() {});
    } else if (mode.equals("xom-V-pool")) {
      builder = new BuilderFactory() {
        protected Builder newBuilder(XMLReader parser, boolean validate) {
          return new Builder(parser, false, new NodeFactory() {});    
        }
      }.createBuilder(false);
    }
   
    if (mode.equals("xom-NNF")) {
      builder = new Builder(XOMUtil.getNullNodeFactory());
    } else if (mode.equals("xom-NNF-pool")) {
      builder = new BuilderFactory() {
        protected Builder newBuilder(XMLReader parser, boolean validate) {
          return new Builder(parser, false, XOMUtil.getNullNodeFactory());    
        }
      }.createBuilder(false);
    }
   
    // saxon
    context = null;
    saxonSerializer = null;
    if (mode.equals("saxon")) {
      context = new StaticQueryContext(new Configuration());
      saxonSerializer = createIdentityTransform(
          new String[] {"net.sf.saxon.TransformerFactoryImpl"});
    }
   
    // DOM
    domBuilder = null;
    domSerializer = null;
    if (mode.equals("dom")) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      try {
        factory.setAttribute("http://apache.org/xml/features/dom/defer-node-expansion", Boolean.FALSE);
      } catch (IllegalArgumentException e) {
        // crimson does not implement this attribute
      }
      domBuilder = factory.newDocumentBuilder();
      domSerializer = createIdentityTransform(new String[] {
          "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl",
          "org.apache.xalan.processor.TransformerFactoryImpl"});
      System.err.println(domSerializer.getClass().getName());
    }
   
    // FastInfoSet
    fiBuilder = null
    fiSerializer = null;
    fiMethod = null;
    if (mode.startsWith("fi")) {
      NodeFactory factory = null;
      if (mode.indexOf("NNF") >= 0) factory = XOMUtil.getNullNodeFactory();
      XMLReader parser = (XMLReader) Class.forName("com.sun.xml.fastinfoset.sax.SAXDocumentParser").newInstance();
      fiBuilder = new Builder(parser, false, factory);
     
      if (mode.indexOf("stax") >= 0) {
        fiSerializer = (XMLStreamWriter) Class.forName("com.sun.xml.fastinfoset.stax.StAXDocumentSerializer").newInstance();       
      } else {
        fiSerializer = (ContentHandler) Class.forName("com.sun.xml.fastinfoset.sax.SAXDocumentSerializer").newInstance();
      }
     
      if (mode.startsWith("fi1")) { // enable "full indexing"
        Method method;
        method = fiSerializer.getClass().getMethod(
            "setAttributeValueSizeLimit", new Class[] {Integer.TYPE});
        method.invoke(fiSerializer, new Object[] {new Integer(Integer.MAX_VALUE)});
        method = fiSerializer.getClass().getMethod(
            "setCharacterContentChunkSizeLimit", new Class[] {Integer.TYPE});
        method.invoke(fiSerializer, new Object[] {new Integer(Integer.MAX_VALUE)});
      }
     
      fiMethod = fiSerializer.getClass().getMethod(
          "setOutputStream", new Class[] { OutputStream.class});
     
      if (mode.indexOf("stax") >= 0) {
        fistaxReader = (XMLStreamReader) Class.forName("com.sun.xml.fastinfoset.stax.StAXDocumentParser").newInstance();
        fistaxMethod = fistaxReader.getClass().getMethod(
            "setInputStream", new Class[] { InputStream.class});
      }
    }   
   
    // StAX
    staxBuilder = null;
    if (mode.indexOf("stax") >= 0) {
      NodeFactory factory = null;
      if (mode.indexOf("NNF") >= 0) factory = XOMUtil.getNullNodeFactory();
      staxBuilder = StaxUtil.createBuilder(staxInputFactory, factory);
   
  }
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.