Package org.milyn.cdr

Examples of org.milyn.cdr.SmooksConfigurationException


    private String defaultValue;

    @Initialize
    public void initialize() throws SmooksConfigurationException {
        if(parentRelIndex >= 0) {
            throw new SmooksConfigurationException("param 'parentRelIndex' value must be negative.  Value is '" + parentRelIndex + "'.");
        }
    }
View Full Code Here


    public void setSourceObjects(List<Object> sourceObjects) throws SmooksConfigurationException {
        try {
            xstreamReader.setProperty(SaxWriter.SOURCE_OBJECT_LIST_PROPERTY, sourceObjects);
        } catch (SAXNotRecognizedException e) {
            throw new SmooksConfigurationException("Unable to set source Java Objects on the underlying XStream SaxWriter.", e);
        } catch (SAXNotSupportedException e) {
            throw new SmooksConfigurationException("Unable to set source Java Objects on the underlying XStream SaxWriter.", e);
        }
    }
View Full Code Here

    private static void assertNo2WayDependencies(DependencySpec spec, List<DependencySpec> dependancySpecs, Stack<DependencySpec> dependencyStack) {
        for(DependencySpec dependancy : dependancySpecs) {
            dependencyStack.push(dependancy);
            if(dependancy.isDependant(spec)) {
                dependencyStack.push(spec);
                throw new SmooksConfigurationException("Invalid 2-Way/Circular Visitor Producer/Consumer dependency detected in configuration.\n" + getDependencyStackTrace(dependencyStack));
            }

            // Recurse down ...
            assertNo2WayDependencies(spec, dependancy.dependants, dependencyStack);
            dependencyStack.pop();
View Full Code Here

            for(ContentHandlerConfigMap<? extends SAXVisitor> contentHandlerMap : contentHandlerMapList) {
                SmooksResourceConfiguration resourceConfig = contentHandlerMap.getResourceConfig();
                SelectorStep selectorStep = resourceConfig.getSelectorStep();

                if(selectorStep.accessesText()) {
                    throw new SmooksConfigurationException("Unsupported selector '" + selectorStep.getXPathExpression() + "' on resource '" + resourceConfig + "'.  The 'text()' XPath token is only supported on SAX Visitor implementations that implement the " + SAXVisitAfter.class.getName() + " interface only.  Class '" + resourceConfig.getResource() + "' implements other SAX Visitor interfaces.");
                }
            }
        }
    }
View Full Code Here

        String elementName = resourceConfig.getTargetElement();

        try {
            SelectorStep.setNamespaces(resourceConfig.getSelectorSteps(), NamespaceMappings.getMappings(applicationContext));
        } catch (SAXPathException e) {
            throw new SmooksConfigurationException("Error configuring resource selector.", e);
        }

        if(configure) {
            // And configure/initialize the instance...
            Configurator.processFieldContextAnnotation(visitor, applicationContext);
View Full Code Here

            return (visitor != null && visitor == writerOwner);
        }

        public SAXElement getParent() {
            if(!maintainElementStack) {
                throw new SmooksConfigurationException("Invalid Smooks configuration.  Call to 'SAXElement.getParent()' when the '" + Filter.MAINTAIN_ELEMENT_STACK + "' is set to 'false'.  You need to change this configuration, or modify the calling code.");
            }
            return super.getParent();
        }
View Full Code Here

            type = NumberType.RAW;
        } else {
            try {
                type = NumberType.valueOf(typeConfig);
            } catch(Exception e) {
                throw new SmooksConfigurationException("Unsupported Number type specification '" + typeConfig + "'.  Must be one of '" + NumberType.values() + "'.");
            }
        }

        if(type == NumberType.PERCENTAGE || (pattern != null && pattern.indexOf('%') != -1)) {
            type = NumberType.PERCENTAGE;
View Full Code Here

    public void setConfiguration(Properties config) throws SmooksConfigurationException {
        String className = config.getProperty(CLASS_PROPERTY_NAME);

        if(className == null) {
            throw new SmooksConfigurationException("Mandatory property '" + CLASS_PROPERTY_NAME + "' not specified.");
        }

        delegateDecoder = DataDecoder.Factory.create(className);

        //Set configuration in delegateDecoder.
View Full Code Here

        locale =  new Locale( languageCode.trim(), countryCode.trim() );
        }

      if ( verifyLocale ) {
        if ( !isLocalInstalled( locale ) ) {
          throw new SmooksConfigurationException( "Locale " + locale + " is not available on this system.");
            }
        }
       
      return locale;
    }
View Full Code Here

            if (schemaBytes == null) {
                synchronized (schemaCache) {
                    String schemaPath = catalog.get(namespaceURI);

                    if (schemaPath == null) {
                        throw new SmooksConfigurationException("Unknown EDI namespace '" + namespaceURI + "'.");
                    }
                    InputStream schemaStream = ClassUtil.getResourceAsStream(schemaPath, EclipseFragmentXMLValidator.class);
                    if (schemaStream == null) {
                        throw new SmooksConfigurationException("Unable to locate XSD classpath resource '" + schemaPath + "' for EDI namespace '" + namespaceURI + "'.");
                    }

                    try {
                        schemaBytes = new ByteArrayInputStream(StreamUtils.readStream(schemaStream));
                        schemaCache.put(namespaceURI, schemaBytes);
                    } catch (IOException e) {
                        throw new SmooksConfigurationException("Unable to read XSD classpath resource '" + schemaPath + "' for EDI namespace '" + namespaceURI + "'.");
                    } finally {
                        try {
                            schemaStream.close();
                        } catch (IOException e) {
                            logger.debug("Unexpected exception classing classpath resource stream for '" + schemaPath + "'.", e);
View Full Code Here

TOP

Related Classes of org.milyn.cdr.SmooksConfigurationException

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.