Examples of ConsoleErrorReporter


Examples of com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter

        defHolderDecl = this.apEnv.getTypeDeclaration(HOLDER_CLASSNAME);
        if (options == null) {
            options = new WsgenOptions();
            out = new PrintStream(new ByteArrayOutputStream());
            class Listener extends WsimportListener {
                ConsoleErrorReporter cer = new ConsoleErrorReporter(out);

                @Override
                public void generatedFile(String fileName) {
                    message(fileName);
                }

                @Override
                public void message(String msg) {
                    out.println(msg);
                }

                @Override
                public void error(SAXParseException exception) {
                    cer.error(exception);
                }

                @Override
                public void fatalError(SAXParseException exception) {
                    cer.fatalError(exception);
                }

                @Override
                public void warning(SAXParseException exception) {
                    cer.warning(exception);
                }

                @Override
                public void info(SAXParseException exception) {
                    cer.info(exception);
                }
            }

            final Listener listener = new Listener();
            receiver = new ErrorReceiverFilter(new Listener()) {
View Full Code Here

Examples of com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter

/**
* @author Vivek Pandey
*/
public class DefaultAuthTester {
    public static void main(String[] args) throws BadCommandLineException {
        DefaultAuthenticator da = new MyAuthenticator(new ConsoleErrorReporter(System.out), new File("c:\\Users\\vivekp\\.metro\\auth"));
               
        PasswordAuthentication pa = da.getPasswordAuthentication();
        if(pa!= null && pa.getUserName().equals("vivek") && Arrays.equals(pa.getPassword(), "test".toCharArray()))
            System.out.println("Success!");
        else
View Full Code Here

Examples of com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter

        this.container = container;
    }

    public boolean run(String[] args) {
        class Listener extends WsimportListener {
            ConsoleErrorReporter cer = new ConsoleErrorReporter(out == null ? new PrintStream(new NullStream()) : out);

            @Override
            public void generatedFile(String fileName) {
                message(fileName);
            }

            @Override
            public void message(String msg) {
                out.println(msg);
            }

            @Override
            public void error(SAXParseException exception) {
                cer.error(exception);
            }

            @Override
            public void fatalError(SAXParseException exception) {
                cer.fatalError(exception);
            }

            @Override
            public void warning(SAXParseException exception) {
                cer.warning(exception);
            }

            @Override
            public void debug(SAXParseException exception) {
                cer.debug(exception);
            }

            @Override
            public void info(SAXParseException exception) {
                cer.info(exception);
            }

            public void enableDebugging(){
                cer.enableDebugging();
            }
        }
        final Listener listener = new Listener();
        ErrorReceiverFilter receiver = new ErrorReceiverFilter(listener) {
            public void info(SAXParseException exception) {
View Full Code Here

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

Examples of com.sun.tools.xjc.ConsoleErrorReporter

    };

    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

Examples of com.sun.tools.xjc.ConsoleErrorReporter

    };

    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

Examples of com.sun.tools.xjc.ConsoleErrorReporter

    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

Examples of com.sun.tools.xjc.ConsoleErrorReporter

    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

Examples of com.sun.tools.xjc.ConsoleErrorReporter

   * 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

Examples of com.sun.tools.xjc.ConsoleErrorReporter

    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
TOP
Copyright © 2018 www.massapi.com. 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.