Search in sources :

Example 11 with BadUsageException

use of org.apache.cxf.tools.common.toolspec.parser.BadUsageException in project cxf by apache.

the class IDLToWSDL method execute.

public void execute(boolean exitOnFinish) {
    IDLToWSDLProcessor idlProcessor = new IDLToWSDLProcessor();
    ProcessorEnvironment env = null;
    try {
        super.execute(exitOnFinish);
        if (!hasInfoOption()) {
            env = new ProcessorEnvironment();
            env.setParameters(getParametersMap(getArrayKeys()));
            if (isVerboseOn()) {
                env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
            }
            env.put(ToolConstants.CFG_CMD_ARG, args);
            initialise(env);
            validate(env);
            idlProcessor.setEnvironment(env);
            idlProcessor.process();
        }
    } catch (ToolException ex) {
        err.println("Error : " + ex.getMessage());
        if (ex.getCause() instanceof BadUsageException) {
            printUsageException(TOOL_NAME, (BadUsageException) ex.getCause());
        }
        err.println();
        if (isVerboseOn()) {
            ex.printStackTrace(err);
        }
        throw ex;
    } catch (Exception ex) {
        err.println("Error : " + ex.getMessage());
        err.println();
        if (isVerboseOn()) {
            ex.printStackTrace(err);
        }
        throw new ToolException(ex.getMessage(), ex.getCause());
    }
}
Also used : BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException) ProcessorEnvironment(org.apache.cxf.tools.corba.common.ProcessorEnvironment) ToolException(org.apache.cxf.tools.common.ToolException) ToolException(org.apache.cxf.tools.common.ToolException) BadUsageException(org.apache.cxf.tools.common.toolspec.parser.BadUsageException) IDLToWSDLProcessor(org.apache.cxf.tools.corba.processors.idl.IDLToWSDLProcessor)

Aggregations

ToolException (org.apache.cxf.tools.common.ToolException)11 BadUsageException (org.apache.cxf.tools.common.toolspec.parser.BadUsageException)11 ToolContext (org.apache.cxf.tools.common.ToolContext)7 CommandDocument (org.apache.cxf.tools.common.toolspec.parser.CommandDocument)3 HashSet (java.util.HashSet)2 Message (org.apache.cxf.common.i18n.Message)2 ErrorVisitor (org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor)2 ProcessorEnvironment (org.apache.cxf.tools.corba.common.ProcessorEnvironment)2 File (java.io.File)1 Processor (org.apache.cxf.tools.common.Processor)1 IDLToWSDLProcessor (org.apache.cxf.tools.corba.processors.idl.IDLToWSDLProcessor)1 WSDLToCorbaProcessor (org.apache.cxf.tools.corba.processors.wsdl.WSDLToCorbaProcessor)1 JavaToJSProcessor (org.apache.cxf.tools.java2js.processor.JavaToJSProcessor)1 WSDLToServiceProcessor (org.apache.cxf.tools.misc.processor.WSDLToServiceProcessor)1 WSDLToSoapProcessor (org.apache.cxf.tools.misc.processor.WSDLToSoapProcessor)1 WSDLToXMLProcessor (org.apache.cxf.tools.misc.processor.WSDLToXMLProcessor)1 XSDToWSDLProcessor (org.apache.cxf.tools.misc.processor.XSDToWSDLProcessor)1 WSDL11Validator (org.apache.cxf.tools.validator.internal.WSDL11Validator)1