예제 #1
0
 protected int unknownArgument(String[] args, String arg, int argNum) {
   if (arg == "-t") {
     arg = args[++argNum];
     if (arg.equalsIgnoreCase("parse")) setTraceParse(true);
     else if (arg.equalsIgnoreCase("gen")) setTraceGen(true);
     else if (arg.equalsIgnoreCase("dot")) setTraceDot(true);
     else {
       if (!arg.equalsIgnoreCase("all"))
         --argNum; // unknown value, trace all, and rethink that option
       setTraceParse(true);
       setTraceGen(true);
       setTraceMisc(true);
       setTraceDot(true);
     }
   } else if (arg == "-version") {
     messageOut.println("schema2beans - " + Version.getVersion());
     System.exit(0);
   } else if (arg == "-xmlschema") setSchemaTypeNum(XML_SCHEMA);
   else if (arg == "-dtd") setSchemaTypeNum(DTD);
   else if (arg == "-premium") buyPremium();
   else if (arg == "-strict") useStrict();
   else if (arg == "-basebean") {
     setOutputType(OUTPUT_TRADITIONAL_BASEBEAN);
   } else if (arg == "-javabeans") setOutputType(OUTPUT_JAVABEANS);
   else if (arg == "-commoninterface") setGenerateCommonInterface(COMMON_BEAN);
   else if (arg == "-nocommoninterface") setGenerateCommonInterface(null);
   else {
     messageOut.println("Unknown argument: " + arg);
     messageOut.println("Use -help.");
     System.exit(1);
   }
   return argNum;
 }
예제 #2
0
 public Config() {
   setOutputStreamProvider(new DefaultOutputStreamProvider(this));
   setSchemaTypeNum(DTD);
   setMessageOut(System.out);
   // Make the default type be boolean
   setDefaultElementType("{http://www.w3.org/2001/XMLSchema}boolean");
   /*
   attributesAsProperties = false;
   indexedPropertyType = "java.util.ArrayList";
   inputURI = null;
   mddFile = null;
   scalarException = true;
   dumpToString = false;
   vetoable = false;
   standalone = false;
   auto = false;
   mddIn = null;*/
 }
예제 #3
0
 public void setSchemaType(int type) {
   setSchemaTypeNum(type);
 }
예제 #4
0
 public Config(OutputStreamProvider out) {
   setOutputStreamProvider(out);
   setSchemaTypeNum(DTD);
   setMessageOut(System.out);
 }