Package org.apache.cxf.tools.common

Examples of org.apache.cxf.tools.common.ToolContext


       
        boolean isWsdlList = context.optionSet(ToolConstants.CFG_WSDLLIST);

        if (isWsdlList) {
            try {
                ToolContext initialContextState = context.makeCopy();
                String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
                wsdlURL = URIParserUtil.getAbsoluteURI(wsdlURL);

                URL url = new URL(wsdlURL);
                InputStream is = (InputStream)url.getContent();
                BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                String tempLine = null;
                while ((tempLine = reader.readLine()) != null) {                   
                    ToolContext freshContext = initialContextState.makeCopy();
                    freshContext.put(ToolConstants.CFG_WSDLURL, tempLine);
                    setContext(freshContext);
                    buildToolContext();
                   
                    processWsdl();
                }
View Full Code Here


        //ErrorVisitor errors = new ErrorVisitor();
        try {
            super.execute(exitOnFinish);
            //checkParams(errors);
            if (!hasInfoOption()) {
                ToolContext env = new ToolContext();
                env.setParameters(getParametersMap(new HashSet()));
                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
                }
               
                if (env.get(ToolConstants.CFG_SOURCEDIR) == null) {
                    env.put(ToolConstants.CFG_SOURCEDIR, ".");
                }
               
                if (isVerboseOn()) {
                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                }
                String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
                if (ft == null || ToolConstants.JAXWS_FRONTEND.equals(ft)) {
                    ft = ToolConstants.JAXWS_FRONTEND;
                } else {
                    ft = ToolConstants.SIMPLE_FRONTEND;
                    //use aegis databinding for simple front end by default
                    env.put(ToolConstants.CFG_DATABINDING, ToolConstants.AEGIS_DATABINDING);
                }
                env.put(ToolConstants.CFG_FRONTEND, ft);
                processWSDL(env, ft);
            }
        } catch (ToolException ex) {
            if (ex.getCause() instanceof BadUsageException) {
                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
View Full Code Here

        List<String> list = wsdlOption.generateCommandLine(outputDirFile, basedir, wsdlURI, getLog()
            .isDebugEnabled());
        String[] args = (String[])list.toArray(new String[list.size()]);
        getLog().debug("Calling wsdl2java with args: " + Arrays.toString(args));
        try {
            new WSDLToJava(args).run(new ToolContext());
        } catch (Throwable e) {
            getLog().debug(e);
            throw new MojoExecutionException(e.getMessage(), e);
        }
        try {
View Full Code Here

        boolean isWsdlList = context.optionSet(ToolConstants.CFG_WSDLLIST);

        if (isWsdlList) {
            BufferedReader reader = null;
            try {
                ToolContext initialContextState = context.makeCopy();
                String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
                wsdlURL = URIParserUtil.getAbsoluteURI(wsdlURL);

                URL url = new URL(wsdlURL);
                InputStream is = (InputStream)url.getContent();
                reader = new BufferedReader(new InputStreamReader(is));
                String tempLine = null;
                while ((tempLine = reader.readLine()) != null) {                   
                    ToolContext freshContext = initialContextState.makeCopy();
                    freshContext.put(ToolConstants.CFG_WSDLURL, tempLine);
                    setContext(freshContext);
                    buildToolContext();
                   
                    processWsdl();
                }
View Full Code Here

            if (bus == null) {
                bus = BusFactory.newInstance().createBus();
                BusFactory.setThreadDefaultBus(bus);
            }
            try {
                new WSDLToJava(args).run(new ToolContext());
            } catch (Throwable e) {
                getLog().debug(e);
                throw new MojoExecutionException(e.getMessage(), e);
           
        }
View Full Code Here

    protected File classDir;

    @Before
    public void setUpResource() throws Exception {
        super.setUp();
        env = new ToolContext();
        cp = System.getProperty("java.class.path");
        URL url = getClass().getResource(".");
        output = new File(url.toURI());
        System.setProperty("java.class.path", getClassPath());
        output = new File(output, "/generated/");
View Full Code Here

    JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
    String classPath = "";
    private WSDLHelper wsdlHelper = new WSDLHelper();
    @Before
    public void startUp() throws Exception {
        env = new ToolContext();
        env.put(ToolConstants.CFG_WSDL, ToolConstants.CFG_WSDL);

        classPath = System.getProperty("java.class.path");
        System.setProperty("java.class.path", getClassPath());
    }
View Full Code Here

        System.setProperty("java.class.path", classPath);
    }

    @Test
    public void testGetWSDLVersion() {
        processor.setEnvironment(new ToolContext());
        assertEquals(WSDLConstants.WSDLVersion.WSDL11, processor.getWSDLVersion());
    }
View Full Code Here

    JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
    String classPath = "";
    private WSDLHelper wsdlHelper = new WSDLHelper();
    @Before
    public void startUp() throws Exception {
        env = new ToolContext();
        env.put(ToolConstants.CFG_WSDL, ToolConstants.CFG_WSDL);

        classPath = System.getProperty("java.class.path");
        System.setProperty("java.class.path", getClassPath());
    }
View Full Code Here

        System.setProperty("java.class.path", classPath);
    }

    @Test
    public void testGetWSDLVersion() {
        processor.setEnvironment(new ToolContext());
        assertEquals(WSDLConstants.WSDLVersion.WSDL11, processor.getWSDLVersion());
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.common.ToolContext

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.