Package org.codehaus.spice.configkit

Examples of org.codehaus.spice.configkit.ConfigValidator


                final String message = "Unable to locate schema with publicID=" +
                    publicId;
                throw new IllegalStateException( message );
            }

            final ConfigValidator validator =
                ConfigValidatorFactory.create( inputSource, c_resolver );
            final ValidationResult result = validator.validate( input,
                                                                (ContentHandler)handler );
            processValidationResults( result, logger );
        }
        return handler.getConfiguration();
    }
View Full Code Here


        }

        //Get the uri of configuration schema type
        try
        {
            final ConfigValidator validator = ComponentConfigUtil
              .getComponentConfigValidator( classname,
                                                          classLoader,
                                                          schema.getLocation(),
                                                          schema.getType() );
            if( null == validator )
            {
                final String message =
                    "Missing schema for component " +
                    component.getTemplate().getName() +
                    " of type " +
                    classname +
                    " with schema " +
                    schema.getLocation() +
                    " of type " +
                    schema.getType();
                getLogger().warn( message );
                return false;
            }
            final Configuration configuration = component.getTemplate()
                .getConfiguration();
            final DefaultConfiguration newConfiguration =
                new DefaultConfiguration( "root",
                                          configuration.getPath(),
                                          configuration.getLocation() );
            ConfigUtil.copy( newConfiguration, configuration );
            final Element element = ConfigurationUtil.toElement(
                newConfiguration );
            final ValidationResult result = validator.validate( element );
            ConfigurationBuilder.processValidationResults( result,
                                                           getLogger() );
            return true;
        }
        catch( Exception e )
View Full Code Here

TOP

Related Classes of org.codehaus.spice.configkit.ConfigValidator

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.