Package org.apache.cxf.tools.common.toolspec.parser

Examples of org.apache.cxf.tools.common.toolspec.parser.CommandDocument


    protected static InputStream getResourceAsStream(String file) {
        return WSDLToJavaContainer.class.getResourceAsStream(file);
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter("wsdlurl")) {
            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here


        context.put(ToolConstants.CFG_SUPPRESS_WARNINGS, true);
        setNamespaceJavascriptPrefixes(context);
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter("wsdlurl")) {
            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here

            throw new ToolException(ex.getMessage(), ex.getCause());
        }      
    }

    private void initialise(ProcessorEnvironment env) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (env.optionSet(ToolCorbaConstants.CFG_IDLFILE)) {
            String idl = doc.getParameter(ToolCorbaConstants.CFG_IDLFILE);
            env.put(ToolCorbaConstants.CFG_IDLFILE, idl);
        }
        if (env.optionSet(ToolCorbaConstants.CFG_TNS)) {
            env.put(ToolCorbaConstants.CFG_TNS, doc.getParameter(ToolCorbaConstants.CFG_TNS));
        }       
        if (env.optionSet(ToolConstants.CFG_OUTPUTDIR)) {
            env.put(ToolConstants.CFG_OUTPUTDIR, doc.getParameter(ToolConstants.CFG_OUTPUTDIR));
        }
        if (env.optionSet(ToolCorbaConstants.CFG_ADDRESS)) {
            env.put(ToolCorbaConstants.CFG_ADDRESS, doc.getParameter(ToolCorbaConstants.CFG_ADDRESS));
        }
       
        //need to add all the other options
    }
View Full Code Here

            }
        }
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter(ToolCorbaConstants.CFG_IDLFILE)) {
            errors.add(new ErrorVisitor.UserError("IDL file has to be specified"));
        }
        if ((doc.hasParameter(ToolCorbaConstants.CFG_SCHEMA))
            && (doc.hasParameter(ToolCorbaConstants.CFG_IMPORTSCHEMA))) {
            errors.add(new ErrorVisitor.UserError("Options -n & -T cannot be used together"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here

                if (isVerboseOn()) {
                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                }
                env.put(ToolConstants.CFG_CMD_ARG, args);

                CommandDocument doc = super.getCommandDocument();
                if (doc.hasParameter("corba")) {
                    env.put(ToolCorbaConstants.CFG_CORBA, Boolean.TRUE);
                }
                if (doc.hasParameter("idl")) {
                    env.put(ToolCorbaConstants.CFG_IDL, Boolean.TRUE);
                }

                initialise(env);
                validate(env);
View Full Code Here

            throw new ToolException(ex.getMessage(), ex.getCause());
        }      
    }

    private void initialise(ProcessorEnvironment env) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (env.optionSet(ToolConstants.CFG_BINDING)) {
            env.put(ToolConstants.CFG_BINDING, doc.getParameter("binding"));
        }
        if (env.optionSet(ToolConstants.CFG_PORTTYPE)) {
            env.put(ToolConstants.CFG_PORTTYPE, doc.getParameter("porttype"));
        }
        if (env.optionSet(ToolConstants.CFG_WSDLURL)) {
            String wsdlname = doc.getParameter("wsdlurl");
            env.put(ToolConstants.CFG_WSDLURL, wsdlname);
        }
        if (env.optionSet(ToolConstants.CFG_NAMESPACE)) {
            env.put(ToolConstants.CFG_NAMESPACE, doc.getParameter("namespace"));
        }
        if (env.optionSet(ToolConstants.CFG_OUTPUTFILE)) {
            String[] outputs = doc.getParameters("outputfile");
            for (int i = 0; i < outputs.length; i++) {
                if (outputs[i].endsWith(".wsdl")) {
                    env.put(ToolCorbaConstants.CFG_WSDLOUTPUT, outputs[i]);
                } else if (outputs[i].endsWith(".idl")) {
                    env.put(ToolCorbaConstants.CFG_IDLOUTPUT, outputs[i]);
                }
            }
        }
       
        if (env.optionSet(ToolConstants.CFG_OUTPUTDIR)) {
            env.put(ToolConstants.CFG_OUTPUTDIR, doc.getParameter("outputdir"));
        }
        // need to add wrapped

    }
View Full Code Here

            }
        }
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter("wsdlurl")) {
            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here

    protected static InputStream getResourceAsStream(String file) {
        return WSDLToJavaContainer.class.getResourceAsStream(file);
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter("wsdlurl")) {
            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here

    protected static InputStream getResourceAsStream(String file) {
        return WSDLToJavaContainer.class.getResourceAsStream(file);
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter("wsdlurl")) {
            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here

    protected static InputStream getResourceAsStream(String file) {
        return WSDLToJavaContainer.class.getResourceAsStream(file);
    }

    public void checkParams(ErrorVisitor errors) throws ToolException {
        CommandDocument doc = super.getCommandDocument();

        if (!doc.hasParameter("wsdlurl")) {
            errors.add(new ErrorVisitor.UserError("WSDL/SCHEMA URL has to be specified"));
        }
        if (errors.getErrors().size() > 0) {
            Message msg = new Message("PARAMETER_MISSING", LOG);
            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.common.toolspec.parser.CommandDocument

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.