Package com.sun.tools.xjc

Examples of com.sun.tools.xjc.ConsoleErrorReporter


    this.options = options;
  }

  private void execute() {

    ConsoleErrorReporter receiver = new ConsoleErrorReporter();
    Model model = ModelLoader.load(options, new JCodeModel(), receiver);

    final ErrorReceiver errorReceiver = new ConsoleErrorReporter();

    // final Model model = outline.getModel();

    Map<String, PackageMapping> packageMappings = new HashMap<String, PackageMapping>();
    {
      List<CPluginCustomization> customizations = CustomizationUtils
          .findCustomizations(model,
              JsonixCustomizationsConstants.PACKAGE_MAPPING_NAME);

      for (CPluginCustomization customization : customizations) {
        try {
          final PackageMapping packageMapping = JsonixCustomizationsConstants
              .unmarshalPackageMapping(customization.element);
          // TODO check parameters
          packageMappings.put(packageMapping.getPackageName(),
              packageMapping);
        } catch (JAXBException jaxbex) {
          errorReceiver.error(new SAXParseException(
              "Could not unmarshal the customization element.",
              customization.locator, jaxbex));
        }
      }
    }

    MModelInfo<NType, NClass> mModel = new XJCCMInfoFactory(model)
        .createModel();

    final JsonixCompiler<NType, NClass> compiler = new JsonixCompiler<NType, NClass>(
        mModel, packageMappings);
    final Map<String, JsonixModule> modules = compiler.compile();

    for (JsonixModule module : modules.values()) {
      try {
        writePrograms(options.targetDir, module.directory,
            module.fileName, module.declarations,
            module.exportDeclarations);
      } catch (IOException ioex) {
        errorReceiver.error(new SAXParseException(MessageFormat.format(
            "Could not create the code for the module [{0}].",
            module.spaceName), null, ioex));
      }

    }
View Full Code Here


    };

    Options options = new Options();
    options.parseArguments(arguments);
    ConsoleErrorReporter receiver = new ConsoleErrorReporter();
    Model model = ModelLoader.load(options, new JCodeModel(), receiver);
    model.generateCode(options, receiver);
    com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
    model.codeModel.build(cw);
  }
View Full Code Here

    };

    Options options = new Options();
    options.parseArguments(arguments);
    ConsoleErrorReporter receiver = new ConsoleErrorReporter();
    Model model = ModelLoader.load(options, new JCodeModel(), receiver);
    model.generateCode(options, receiver);
    com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
    model.codeModel.build(cw);
  }
View Full Code Here

    public static void main(String[] args) throws IOException {
        InputSource[] sources = new InputSource[args.length];
        for (int i = 0; i < args.length; i++)
            sources[i] = new InputSource(new File(args[i]).toURL().toExternalForm());

        check(sources, new ConsoleErrorReporter(), null);
    }
View Full Code Here

    return wsOperation;
  }
 
  private void importTypes(Types types) {
    SchemaCompiler compiler = XJC.createSchemaCompiler();
    ErrorListener elForRun = new ConsoleErrorReporter();
    compiler.setErrorListener(elForRun);

    SchemaImpl impl = (SchemaImpl) types.getExtensibilityElements().get(0);
   
    S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
View Full Code Here

   * Import the Types from the WSDL definition using the same strategy that
   * Cxf uses taking advantage of JAXB
   */
  private void importTypes(Types types) {
    SchemaCompiler compiler = XJC.createSchemaCompiler();
    ErrorListener elForRun = new ConsoleErrorReporter();
    compiler.setErrorListener(elForRun);

    Element rootTypes = this.getRootTypes();
    this.createDefaultStructures(rootTypes);

View Full Code Here

    return wsOperation;
  }
 
  private void importTypes(Types types) {
    SchemaCompiler compiler = XJC.createSchemaCompiler();
    ErrorListener elForRun = new ConsoleErrorReporter();
    compiler.setErrorListener(elForRun);

    SchemaImpl impl = (SchemaImpl) types.getExtensibilityElements().get(0);
   
    S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
View Full Code Here

   * Import the Types from the WSDL definition using the same strategy that
   * Cxf uses taking advantage of JAXB
   */
  private void importTypes(Types types) {
    SchemaCompiler compiler = XJC.createSchemaCompiler();
    ErrorListener elForRun = new ConsoleErrorReporter();
    compiler.setErrorListener(elForRun);

    Element rootTypes = this.getRootTypes();
    this.createDefaultStructures(rootTypes);

View Full Code Here

    public static void main(String[] args) throws IOException {
        InputSource[] sources = new InputSource[args.length];
        for (int i = 0; i < args.length; i++)
            sources[i] = new InputSource(new File(args[i]).toURL().toExternalForm());

        check(sources, new ConsoleErrorReporter(), null);
    }
View Full Code Here

    public static void main(String[] args) throws IOException {
        InputSource[] sources = new InputSource[args.length];
        for (int i = 0; i < args.length; i++)
            sources[i] = new InputSource(new File(args[i]).toURL().toExternalForm());

        check(sources, new ConsoleErrorReporter(), null, true);
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.xjc.ConsoleErrorReporter

Copyright © 2018 www.massapicom. 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.