Package com.sun.tools.xjc

Examples of com.sun.tools.xjc.ErrorReceiver


        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here


        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here

  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

    /**
     * Performs error check
     */
    public void errorCheck() {
        ErrorReceiver er = Ring.get(ErrorReceiver.class);
        for (QName n : enumBaseTypes) {
            XSSchemaSet xs = Ring.get(XSSchemaSet.class);
            XSSimpleType st = xs.getSimpleType(n.getNamespaceURI(), n.getLocalPart());
            if(st==null) {
                er.error(loc,Messages.ERR_UNDEFINED_SIMPLE_TYPE.format(n));
                continue;
            }

            if(!SimpleTypeBuilder.canBeMappedToTypeSafeEnum(st)) {
                er.error(loc,Messages.ERR_CANNOT_BE_BOUND_TO_SIMPLETYPE.format(n));
                continue;
            }
        }
    }
View Full Code Here

        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here

        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here

        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here

    /**
     * Performs error check
     */
    public void errorCheck() {
        ErrorReceiver er = Ring.get(ErrorReceiver.class);
        for (QName n : enumBaseTypes) {
            XSSchemaSet xs = Ring.get(XSSchemaSet.class);
            XSSimpleType st = xs.getSimpleType(n.getNamespaceURI(), n.getLocalPart());
            if(st==null) {
                er.error(loc,Messages.ERR_UNDEFINED_SIMPLE_TYPE.format(n));
                continue;
            }

            if(!SimpleTypeBuilder.canBeMappedToTypeSafeEnum(st)) {
                er.error(loc,Messages.ERR_CANNOT_BE_BOUND_TO_SIMPLETYPE.format(n));
                continue;
            }
        }
    }
View Full Code Here

        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here

        } catch ( BadCommandLineException e ) {
            throw new IllegalArgumentException( "Unable to parse arguments",
                                                e );
        }

        ErrorReceiver errorReceiver = new JaxbErrorReceiver4Drools();

        Model model = ModelLoader.load( xjcOpts,
                                        new JCodeModel(),
                                        errorReceiver );
View Full Code Here

TOP

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

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.