Пример #1
0
  protected void initFromNode(org.w3c.dom.Node doc, int options) throws Schema2BeansException {
    if (doc == null) {
      doc = GraphManager.createRootElementNode("deployment-plan"); // NOI18N
      if (doc == null)
        throw new Schema2BeansException(
            Common.getMessage("CantCreateDOMRoot_msg", "deployment-plan"));
    }
    Node n = GraphManager.getElementNode("deployment-plan", doc); // NOI18N
    if (n == null)
      throw new Schema2BeansException(
          Common.getMessage(
              "DocRootNotInDOMGraph_msg", "deployment-plan", doc.getFirstChild().getNodeName()));

    this.graphManager.setXmlDocument(doc);

    // Entry point of the createBeans() recursive calls
    this.createBean(n, this.graphManager());
    this.initialize(options);
  }
Пример #2
0
 // Special deserializer: read XML as deserialization
 private void readObject(java.io.ObjectInputStream in)
     throws java.io.IOException, ClassNotFoundException {
   try {
     init(comparators, runtimeVersion);
     String strDocument = in.readUTF();
     // System.out.println("strDocument='"+strDocument+"'");
     ByteArrayInputStream bais = new ByteArrayInputStream(strDocument.getBytes());
     Document doc = GraphManager.createXmlDocument(bais, false);
     initOptions(Common.NO_DEFAULT_VALUES);
     initFromNode(doc, Common.NO_DEFAULT_VALUES);
   } catch (Schema2BeansException e) {
     throw new RuntimeException(e);
   }
 }
Пример #3
0
 public static DeploymentPlan createGraph(java.io.InputStream in, boolean validate)
     throws org.netbeans.modules.schema2beans.Schema2BeansException {
   Document doc = GraphManager.createXmlDocument(in, validate);
   return createGraph(doc);
 }