Package org.objectweb.celtix.tools.common

Examples of org.objectweb.celtix.tools.common.ToolException


   
    public FileWriterUtil(String targetDir) throws ToolException {
        target = new File(targetDir);
        if (!(target.exists()) || !(target.isDirectory())) {
            Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, target);
            throw new ToolException(msg);
        }
    }
View Full Code Here


                    if (JavaType.Style.IN.equals(style)) {
                        String paramName = ProcessorUtil.mangleNameToVariableName(mimeContent.getPart());
                        JavaParameter jp = jm.getParameter(paramName);
                        if (jp == null) {
                            Message message = new Message("MIMEPART_CANNOT_MAP", LOG, mimeContent.getPart());
                            throw new ToolException(message);
                        }
                        if (!jp.getClassName().equals(mimeJavaType)) {
                            // jp.setType(mimeJavaType);
                            jp.setClassName(mimeJavaType);
                        }
                    } else if (JavaType.Style.OUT.equals(style)) {
                        if (mimeParts.size() > 2) {
                            // more than 1 mime:content part (1 root soap body),
                            // javaReturn will be set to void and
                            // all output parameter will be treated as the
                            // holder class
                            String paramName = ProcessorUtil.mangleNameToVariableName(mimeContent.getPart());
                            JavaParameter jp = jm.getParameter(paramName);
                            if (jp == null) {
                                Message message = new Message("MIMEPART_CANNOT_MAP", LOG, mimeContent
                                    .getPart());
                                throw new ToolException(message);
                            } else {
                                if (!jp.getClassName().equals(mimeJavaType)) {
                                    // jp.setType(mimeJavaType);
                                    jp.setClassName(mimeJavaType);
                                    jp.setHolderClass(mimeJavaType);
View Full Code Here

            if (m.getName().startsWith("check")) {
                try {
                    res = (Boolean)m.invoke(this, new Object[] {});
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new ToolException(e);
                }
                if (!res.booleanValue()) {
                    return false;
                }
            }
View Full Code Here

    public LineNumDOMParser(XMLParserConfiguration arg0) throws ToolException {
        super(arg0);
        try {
            setFeature(DEFER_NODE_EXPANSION, false);
        } catch (SAXNotSupportedException e) {
            throw new ToolException(e);
        } catch (SAXNotRecognizedException e) {
            throw new ToolException(e);
        }
    }
View Full Code Here

    public boolean validate(String wsdlsource, String[] schemas, boolean deep) throws ToolException {
        String systemId = null;
        try {
            systemId = getWsdlUrl(wsdlsource);
        } catch (IOException ioe) {
            throw new ToolException(ioe);
        }

        return validate(new InputSource(systemId), schemas, deep);

    }
View Full Code Here

            setExternalSchemaLocations(schemas);
            StackTraceErrorHandler handler = setErrorHandler();
            schemaValidatedDoc = doValidation(wsdlsource, deep);
            //
            if (!handler.isValid()) {
                ToolException ex = new ToolException(handler.getErrorMessages());
                throw ex;
            }

            WSDLFactory wsdlFactory;
            try {
                wsdlFactory = WSDLFactory.newInstance();
                WSDLReader reader = wsdlFactory.newWSDLReader();
                reader.setFeature("javax.wsdl.verbose", false);
                WSDLExtensionRegister register = new WSDLExtensionRegister(wsdlFactory , reader);
                register.registerExtenstions();
                def = reader.readWSDL(wsdlsource.getSystemId());
            } catch (WSDLException e) {
                throw new ToolException("Can not create wsdl definition for " + wsdlsource.getSystemId());
            }
           
            WSDLElementReferenceValidator wsdlRefValiadtor = new WSDLElementReferenceValidator(def, this);
            isValid = wsdlRefValiadtor.isValid();
           
            if (!isValid) {
                throw new ToolException(this.getErrorMessage());
            }
           
            isValid = true;

        } catch (IOException ioe) {
            throw new ToolException("Can not get the wsdl " + wsdlsource.getSystemId() , ioe);
        } catch (SAXException saxEx) {
            throw new ToolException(saxEx);

        }
        return isValid;
    }
View Full Code Here

            /*
             * if (!handler.isValid()) { ToolException ex = new
             * ToolException(handler.getErrorMessages()); throw ex; }
             */
        } catch (Exception e) {
            ToolException ex = new ToolException(e);
            throw ex;
        }
        return doc;
    }
View Full Code Here

        } catch (SAXException sax) {
            Throwable embedded = sax.getException();
            if (embedded == null) {
                embedded = sax;
            }
            throw new ToolException(sax.getMessage());
        }
    }
View Full Code Here

                .get(ToolConstants.CFG_WSDLURL), schemas, false);

            if (!schemaValidator.isValid()) {             
                this.addErrorMessage(schemaValidator.getErrorMessage());
                isValid = false;
                throw new ToolException(this.getErrorMessage());
              
            } else {
                this.def = schemaValidator.def;
            }
        } else {
            throw new ToolException("Schema dir should be defined before validate wsdl");
        }

       
        validators.add(new UniqueBodyPartsValidator(this.def));
        validators.add(new WSIBPValidator(this.def));
        validators.add(new MIMEBindingValidator(this.def));
        validators.add(new XMLFormatValidator(this.def));
       
        for (AbstractValidator validator : validators) {
            if (!validator.isValid()) {            
                addErrorMessage(validator.getErrorMessage());
                isValid = false;
                throw new ToolException(this.getErrorMessage());
            }
        }
       
        return isValid;
    }
View Full Code Here

        for (int i = 0; i < bindingFiles.length; i++) {
            try {
                addBinding(bindingFiles[i]);
            } catch (XMLStreamException xse) {
                Message msg = new Message("STAX_PASER_ERROR", LOG);
                throw new ToolException(msg, xse);
            }
        }
       
        for (Element jaxwsBinding : jaxwsBindings) {
            buildTargetNodeMap(jaxwsBinding, "/");
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.tools.common.ToolException

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.