< prev index next >

src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java

Print this page




 545         if (args[i].equals("-disableXmlSecurity")) {
 546             disableXmlSecurity = true;
 547             return 1;
 548         }
 549         if (args[i].equals("-contentForWildcard")) {
 550             contentForWildcard = true;
 551             return 1;
 552         }
 553         if (args[i].equals("-XautoNameResolution")) {
 554             automaticNameConflictResolution = true;
 555             return 1;
 556         }
 557         if (args[i].equals("-b")) {
 558             addFile(requireArgument("-b",args,++i),bindFiles,".xjb");
 559             return 2;
 560         }
 561         if (args[i].equals("-dtd")) {
 562             schemaLanguage = Language.DTD;
 563             return 1;
 564         }
 565         if (args[i].equals("-relaxng")) {
 566             schemaLanguage = Language.RELAXNG;
 567             return 1;
 568         }
 569         if (args[i].equals("-relaxng-compact")) {
 570             schemaLanguage = Language.RELAXNG_COMPACT;
 571             return 1;
 572         }
 573         if (args[i].equals("-xmlschema")) {
 574             schemaLanguage = Language.XMLSCHEMA;
 575             return 1;
 576         }
 577         if (args[i].equals("-wsdl")) {
 578             schemaLanguage = Language.WSDL;
 579             return 1;
 580         }
 581         if (args[i].equals("-extension")) {
 582             compatibilityMode = EXTENSION;
 583             return 1;
 584         }
 585         if (args[i].equals("-target")) {
 586             String token = requireArgument("-target",args,++i);
 587             target = SpecVersion.parse(token);
 588             if(target==null)
 589                 throw new BadCommandLineException(Messages.format(Messages.ILLEGAL_TARGET_VERSION,token));
 590             return 2;
 591         }
 592         if (args[i].equals("-httpproxyfile")) {


 852                 URL url = resources.nextElement();
 853                 addBindFile(new InputSource(url.toExternalForm()));
 854             }
 855         } catch (IOException e) {
 856             throw new BadCommandLineException(
 857                     Messages.format(Messages.FAILED_TO_LOAD,jar,e.getMessage()), e);
 858         }
 859     }
 860 
 861 
 862     /**
 863      * Guesses the schema language.
 864      */
 865     public Language guessSchemaLanguage() {
 866 
 867         // otherwise, use the file extension.
 868         // not a good solution, but very easy.
 869         if ((grammars != null) && (grammars.size() > 0)) {
 870             String name = grammars.get(0).getSystemId().toLowerCase();
 871 
 872             if (name.endsWith(".rng"))
 873                 return Language.RELAXNG;
 874             if (name.endsWith(".rnc"))
 875                 return Language.RELAXNG_COMPACT;
 876             if (name.endsWith(".dtd"))
 877                 return Language.DTD;
 878             if (name.endsWith(".wsdl"))
 879                 return Language.WSDL;
 880         }
 881 
 882         // by default, assume XML Schema
 883         return Language.XMLSCHEMA;
 884     }
 885 
 886     /**
 887      * Creates a configured CodeWriter that produces files into the specified directory.
 888      */
 889     public CodeWriter createCodeWriter() throws IOException {
 890         return createCodeWriter(new FileCodeWriter( targetDir, readOnly, encoding ));
 891     }
 892 
 893     /**
 894      * Creates a configured CodeWriter that produces files into the specified directory.
 895      */




 545         if (args[i].equals("-disableXmlSecurity")) {
 546             disableXmlSecurity = true;
 547             return 1;
 548         }
 549         if (args[i].equals("-contentForWildcard")) {
 550             contentForWildcard = true;
 551             return 1;
 552         }
 553         if (args[i].equals("-XautoNameResolution")) {
 554             automaticNameConflictResolution = true;
 555             return 1;
 556         }
 557         if (args[i].equals("-b")) {
 558             addFile(requireArgument("-b",args,++i),bindFiles,".xjb");
 559             return 2;
 560         }
 561         if (args[i].equals("-dtd")) {
 562             schemaLanguage = Language.DTD;
 563             return 1;
 564         }








 565         if (args[i].equals("-xmlschema")) {
 566             schemaLanguage = Language.XMLSCHEMA;
 567             return 1;
 568         }
 569         if (args[i].equals("-wsdl")) {
 570             schemaLanguage = Language.WSDL;
 571             return 1;
 572         }
 573         if (args[i].equals("-extension")) {
 574             compatibilityMode = EXTENSION;
 575             return 1;
 576         }
 577         if (args[i].equals("-target")) {
 578             String token = requireArgument("-target",args,++i);
 579             target = SpecVersion.parse(token);
 580             if(target==null)
 581                 throw new BadCommandLineException(Messages.format(Messages.ILLEGAL_TARGET_VERSION,token));
 582             return 2;
 583         }
 584         if (args[i].equals("-httpproxyfile")) {


 844                 URL url = resources.nextElement();
 845                 addBindFile(new InputSource(url.toExternalForm()));
 846             }
 847         } catch (IOException e) {
 848             throw new BadCommandLineException(
 849                     Messages.format(Messages.FAILED_TO_LOAD,jar,e.getMessage()), e);
 850         }
 851     }
 852 
 853 
 854     /**
 855      * Guesses the schema language.
 856      */
 857     public Language guessSchemaLanguage() {
 858 
 859         // otherwise, use the file extension.
 860         // not a good solution, but very easy.
 861         if ((grammars != null) && (grammars.size() > 0)) {
 862             String name = grammars.get(0).getSystemId().toLowerCase();
 863 




 864             if (name.endsWith(".dtd"))
 865                 return Language.DTD;
 866             if (name.endsWith(".wsdl"))
 867                 return Language.WSDL;
 868         }
 869 
 870         // by default, assume XML Schema
 871         return Language.XMLSCHEMA;
 872     }
 873 
 874     /**
 875      * Creates a configured CodeWriter that produces files into the specified directory.
 876      */
 877     public CodeWriter createCodeWriter() throws IOException {
 878         return createCodeWriter(new FileCodeWriter( targetDir, readOnly, encoding ));
 879     }
 880 
 881     /**
 882      * Creates a configured CodeWriter that produces files into the specified directory.
 883      */


< prev index next >