if (arguments.length > 0 && "-pdelaunch".equals(arguments[0])) { String [] oldArguments = arguments; arguments = new String [arguments.length - 1]; System.arraycopy(oldArguments, 1, arguments, 0, arguments.length); }
  public Object run(Object object)   {    try    {      // If there are no arguments...      //      String[] arguments = (String[])object;      if (arguments.length == 0)       {        // Serialize the Purchase Order schema sample.        //        System.out.println("<!-- ** PurchaseOrderSchema ** -->");        XSDSchema xsdPurchaseOrderSchema = XSDPrototypicalSchema.getPurchaseOrderSchema();        if (xsdPurchaseOrderSchema.getElement() == null)        {          xsdPurchaseOrderSchema.updateElement();        }        XSDResourceImpl.serialize(System.out, xsdPurchaseOrderSchema.getElement());        // Serialize the prototypical schema sample.        //        System.out.println("<!-- ** PrototypicalSchema ** -->");        XSDSchema xsdSchema = XSDPrototypicalSchema.getPrototypicalSchema();        if (xsdSchema.getElement() == null)        {          xsdSchema.updateElement();        }        XSDResourceImpl.serialize(System.out, xsdSchema.getElement());        System.out.println("===== clone =====");        XSDSchema clonedSchema = (XSDSchema)xsdSchema.cloneConcreteComponent(true, true);        clonedSchema.setElement(null);        clonedSchema.updateElement();        XSDResourceImpl.serialize(System.out, clonedSchema.getElement());        System.out.println("===== clone schema for schema =====");        XSDSchema clonedSchemaForSchema = (XSDSchema)clonedSchema.getSchemaForSchema().cloneConcreteComponent(true, true);        clonedSchemaForSchema.setElement(null);        clonedSchemaForSchema.updateElement();        XSDResourceImpl.serialize(System.out, clonedSchemaForSchema.getElement());      }      else if (arguments[0].equals("-printExample"))      {        XSDPrototypicalSchema xsdPrototypicalSchema = XSDPrototypicalSchema.getInstance();        // Iterate over the schema arguments.        //        for (int i = 1; i < arguments.length; ++i)        {          xsdPrototypicalSchema.printSchema(arguments[i]);        }      }      else if (arguments[0].equals("-createExample"))      {        Document document = (Document)XSDPrototypicalSchema.getPurchaseOrderSchema().getDocument().cloneNode(true);        XSDSchema xsdSchema = XSDPrototypicalSchema.getInstance().createSchema(document.getDocumentElement());        if (xsdSchema != null)        {          if (xsdSchema.getElement() == null)          {            xsdSchema.updateElement();          }          XSDResourceImpl.serialize(System.out, xsdSchema.getElement());        }      }      else if (arguments[0].equals("-saveExample"))      {        XSDPrototypicalSchema.getInstance().savePurchaseOrderSchema(arguments[1]);      }      else if (arguments[0].equals("-traceLoad"))      {        for (int i = 1; i < arguments.length; ++i)        {          XSDPrototypicalSchema.getInstance().traceLoading(arguments[i]);        }      }      else if (arguments[0].equals("-clone"))      {        XSDPrototypicalSchema.getInstance().printComponent          (System.out,           XSDPrototypicalSchema.getInstance().cloneComponent             (XSDPrototypicalSchema.getPurchaseOrderSchema(), false));        XSDPrototypicalSchema.getInstance().printComponent          (System.out,           XSDPrototypicalSchema.getInstance().cloneComponent             (XSDPrototypicalSchema.getPurchaseOrderSchema(), true));      }      else if (arguments[0].equals("-crossReferenceExample"))      {        XSDPrototypicalSchema.getInstance().crossReferenceTest(System.out);      }      else if (arguments[0].equals("-validate"))      {        // Iterate over the schema arguments.        //        for (int i = 1; i < arguments.length; ++i)        {          validate(arguments[i]);        }      }      else      {        // Iterate over the schema arguments.        //        for (int i = 0; i < arguments.length; ++i)        {          System.out.println("<!-- << " + arguments[i] + " >> -->");          loadAndPrint(arguments[i]);        }      }      return new Integer(0);    }    catch (Exception exception)    {      exception.printStackTrace();      return new Integer(1);    }  }