You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ni...@apache.org on 2009/10/23 22:27:46 UTC
svn commit: r829207 - in
/commons/sandbox/validator2/branches/alternative/validation-framework/src:
main/java/org/apache/commons/validation/
main/java/org/apache/commons/validation/framework/
main/java/org/apache/commons/validation/framework/metadata/ ...
Author: niallp
Date: Fri Oct 23 20:27:44 2009
New Revision: 829207
URL: http://svn.apache.org/viewvc?rev=829207&view=rev
Log:
Validator2 Framework - add skeleton implementations
Added:
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/
- copied from r825568, commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validator/
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java (with props)
commons/sandbox/validator2/branches/alternative/validation-framework/src/test/java/org/apache/commons/validation/
- copied from r825568, commons/sandbox/validator2/branches/alternative/validation-framework/src/test/java/org/apache/commons/validator/
Removed:
commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validator/
commons/sandbox/validator2/branches/alternative/validation-framework/src/test/java/org/apache/commons/validator/
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import java.io.InputStream;
+
+import javax.validation.Configuration;
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.ValidatorFactory;
+import javax.validation.spi.BootstrapState;
+
+/**
+ * {@link Configuration} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ConfigurationImpl implements Configuration<ConfigurationImpl>{
+
+ private final BootstrapState state;
+
+ /**
+ * Construct a new configuration instance.
+ *
+ * @param state The bootstrap state
+ */
+ public ConfigurationImpl(BootstrapState state) {
+ this.state = state;
+ }
+
+ /**
+ * @see Configuration#addMapping(InputStream)
+ */
+ public ConfigurationImpl addMapping(InputStream input) {
+ return this;
+ }
+
+ /**
+ * @see Configuration#addProperty(String, String)
+ */
+ public ConfigurationImpl addProperty(String name, String value) {
+ return this;
+ }
+
+ /**
+ * @see Configuration#buildValidatorFactory()
+ */
+ public ValidatorFactory buildValidatorFactory() {
+ return null;
+ }
+
+ /**
+ * @see Configuration#constraintValidatorFactory(ConstraintValidatorFactory)
+ */
+ public ConfigurationImpl constraintValidatorFactory(
+ ConstraintValidatorFactory factory) {
+ return this;
+ }
+
+ /**
+ * @see Configuration#getDefaultConstraintValidatorFactory()
+ */
+ public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
+ return null;
+ }
+
+ /**
+ * @see Configuration#getDefaultMessageInterpolator()
+ */
+ public MessageInterpolator getDefaultMessageInterpolator() {
+ return null;
+ }
+
+ /**
+ * @see Configuration#getDefaultTraversableResolver()
+ */
+ public TraversableResolver getDefaultTraversableResolver() {
+ return null;
+ }
+
+ /**
+ * @see Configuration#ignoreXmlConfiguration()
+ */
+ public ConfigurationImpl ignoreXmlConfiguration() {
+ return this;
+ }
+
+ /**
+ * @see Configuration#messageInterpolator(MessageInterpolator)
+ */
+ public ConfigurationImpl messageInterpolator(MessageInterpolator interpolator) {
+ return this;
+ }
+
+ /**
+ * @see Configuration#traversableResolver(TraversableResolver)
+ */
+ public ConfigurationImpl traversableResolver(TraversableResolver resolver) {
+ return this;
+ }
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConfigurationImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import javax.validation.ConstraintValidatorContext;
+
+/**
+ * {@link ConstraintValidatorContext} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ConstraintValidatorContextImpl implements ConstraintValidatorContext {
+
+ /**
+ * @see ConstraintValidatorContext#buildConstraintViolationWithTemplate(String)
+ */
+ public ConstraintViolationBuilder buildConstraintViolationWithTemplate(String template) {
+ return new ConstraintViolationBuilderImpl();
+ }
+
+ /**
+ * @see ConstraintValidatorContext#disableDefaultConstraintViolation()
+ */
+ public void disableDefaultConstraintViolation() {
+ }
+
+ /**
+ * @see ConstraintValidatorContext#getDefaultConstraintMessageTemplate()
+ */
+ public String getDefaultConstraintMessageTemplate() {
+ return null;
+ }
+
+ /**
+ * {@link ConstraintViolationBuilder} implementation.
+ */
+ private class ConstraintViolationBuilderImpl implements ConstraintViolationBuilder {
+
+ /**
+ * @see ConstraintViolationBuilder#addConstraintViolation()
+ */
+ public ConstraintValidatorContext addConstraintViolation() {
+ return ConstraintValidatorContextImpl.this;
+ }
+
+ /**
+ * @see ConstraintViolationBuilder#addNode(String)
+ */
+ public NodeBuilderDefinedContext addNode(String name) {
+ return new NodeBuilderDefinedContextImpl();
+ }
+
+ /**
+ * {@link NodeBuilderCustomizableContext} implementation.
+ */
+ private class NodeBuilderCustomizableContextImpl implements NodeBuilderCustomizableContext {
+
+ /**
+ * @see NodeBuilderCustomizableContext#addConstraintViolation()
+ */
+ public ConstraintValidatorContext addConstraintViolation() {
+ return ConstraintValidatorContextImpl.this;
+ }
+
+ /**
+ * @see NodeBuilderCustomizableContext#addNode(String)
+ */
+ public NodeBuilderCustomizableContext addNode(String name) {
+ return this;
+ }
+
+ /**
+ * @see NodeBuilderCustomizableContext#inIterable()
+ */
+ public NodeContextBuilder inIterable() {
+ return new NodeContextBuilderImpl();
+ }
+
+ }
+
+ /**
+ * {@link NodeBuilderDefinedContext} implementation.
+ */
+ private class NodeBuilderDefinedContextImpl implements NodeBuilderDefinedContext {
+
+ /**
+ * @see NodeBuilderDefinedContext#addConstraintViolation()
+ */
+ public ConstraintValidatorContext addConstraintViolation() {
+ return ConstraintValidatorContextImpl.this;
+ }
+
+ /**
+ * @see NodeBuilderDefinedContext#addNode(String)
+ */
+ public NodeBuilderCustomizableContext addNode(String name) {
+ return new NodeBuilderCustomizableContextImpl();
+ }
+
+ }
+
+ /**
+ * {@link NodeContextBuilder} implementation.
+ */
+ private class NodeContextBuilderImpl implements NodeContextBuilder {
+
+ /**
+ * @see NodeContextBuilder#addConstraintViolation()
+ */
+ public ConstraintValidatorContext addConstraintViolation() {
+ return ConstraintValidatorContextImpl.this;
+ }
+
+ /**
+ * @see NodeContextBuilder#addNode(String)
+ */
+ public NodeBuilderCustomizableContext addNode(String name) {
+ return new NodeBuilderCustomizableContextImpl();
+ }
+
+ /**
+ * @see NodeContextBuilder#atIndex(Integer)
+ */
+ public NodeBuilderDefinedContext atIndex(Integer index) {
+ return new NodeBuilderDefinedContextImpl();
+ }
+
+ /**
+ * @see NodeContextBuilder#atKey(Object)
+ */
+ public NodeBuilderDefinedContext atKey(Object key) {
+ return new NodeBuilderDefinedContextImpl();
+ }
+
+ }
+
+
+ }
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorContextImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.ValidationException;
+
+/**
+ * {@link ConstraintValidatorFactory} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ConstraintValidatorFactoryImpl implements ConstraintValidatorFactory {
+
+ /**
+ * Create the specified {@link ConstraintValidator} instance.
+ *
+ * @param type The class of the {@link ConstraintValidator} to create
+ * @see ConstraintValidatorFactory#getInstance(Class)
+ */
+ public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> type) {
+ if (type == null) {
+ throw new ValidationException("No type specified");
+ }
+ try {
+ return type.newInstance();
+ } catch (Exception e) {
+ throw new ValidationException("Error creating '" + type.getName() + "'", e);
+ }
+ }
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintValidatorFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.Path;
+import javax.validation.metadata.ConstraintDescriptor;
+
+/**
+ * {@link ConstraintViolation} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ConstraintViolationImpl<T> implements ConstraintViolation<T> {
+
+ private final ConstraintDescriptor<?> descriptor;
+ private final Object invalidValue;
+ private final Object leafBean;
+ private final String message;
+ private final String messageTemplate;
+ private final Path propertyPath;
+ private final T rootBean;
+ private final Class<T> rootBeanClass;
+
+ /**
+ * Construct a new instance.
+ */
+ public ConstraintViolationImpl(
+ ConstraintDescriptor<?> descriptor,
+ Object invalidValue,
+ Object leafBean,
+ String message,
+ String messageTemplate,
+ Path propertyPath,
+ T rootBean,
+ Class<T> rootBeanClass) {
+ this.descriptor = descriptor;
+ this.invalidValue = invalidValue;
+ this.leafBean = leafBean;
+ this.message = message;
+ this.messageTemplate = messageTemplate;
+ this.propertyPath = propertyPath;
+ this.rootBean = rootBean;
+ this.rootBeanClass = rootBeanClass;
+ }
+
+ /**
+ * Return the Constraint Descriptor.
+ *
+ * @return the constraint descriptor
+ */
+ public ConstraintDescriptor<?> getConstraintDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Return the Invalid Value.
+ *
+ * @return the Invalid Valu
+ */
+ public Object getInvalidValue() {
+ return invalidValue;
+ }
+
+ /**
+ * Return the Leaf Bean.
+ *
+ * @return the Leaf Bean
+ */
+ public Object getLeafBean() {
+ return leafBean;
+ }
+
+ /**
+ * Return the Messag.
+ *
+ * @return the Messag
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Return the Message Template.
+ *
+ * @return the Message Template
+ */
+ public String getMessageTemplate() {
+ return messageTemplate;
+ }
+
+ /**
+ * Return the Property Path.
+ *
+ * @return the Property Path
+ */
+ public Path getPropertyPath() {
+ return propertyPath;
+ }
+
+ /**
+ * Return the Root Bean.
+ *
+ * @return the Root Bean
+ */
+ public T getRootBean() {
+ return rootBean;
+ }
+
+ /**
+ * Return the Root Bean Class.
+ *
+ * @return the Root Bean Class
+ */
+ public Class<T> getRootBeanClass() {
+ return rootBeanClass;
+ }
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ConstraintViolationImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import java.util.Locale;
+
+import javax.validation.MessageInterpolator;
+import javax.validation.metadata.ConstraintDescriptor;
+
+/**
+ * {@link MessageInterpolator} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class MessageInterpolatorImpl implements MessageInterpolator {
+
+ /**
+ * @see MessageInterpolator#interpolate(String, MessageInterpolator.Context)
+ */
+ public String interpolate(String template, Context context) {
+ return interpolate(template, context, Locale.getDefault());
+ }
+
+ /**
+ * @see MessageInterpolator#interpolate(String, MessageInterpolator.Context, Locale)
+ */
+ public String interpolate(String template, Context context, Locale locale) {
+ return null;
+ }
+
+ /**
+ * {@link Context} implementation.
+ */
+ public static class ContextImpl implements Context {
+
+ private final ConstraintDescriptor<?> descriptor;
+ private final Object validatedValue;
+
+ /**
+ * Construct a new Context instance.
+ *
+ * @param descriptor The constraint descriptor
+ * @param validatedValue The validated value
+ */
+ public ContextImpl(ConstraintDescriptor<?> descriptor, Object validatedValue) {
+ this.descriptor = descriptor;
+ this.validatedValue = validatedValue;
+ }
+
+ /**
+ * Return the constraint descriptor.
+ *
+ * @return The constraint descriptor
+ */
+ public ConstraintDescriptor<?> getConstraintDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Return the validated value.
+ *
+ * @return The validated value
+ */
+ public Object getValidatedValue() {
+ return validatedValue;
+ }
+
+ }
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/MessageInterpolatorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import java.util.Iterator;
+
+import javax.validation.Path;
+
+/**
+ * {@link Path} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class PathImpl implements Path {
+
+ /**
+ * Get an iterator of the nodes of this path.
+ *
+ * @return an iterator of the nodes of this path
+ */
+ public Iterator<Node> iterator() {
+ return null;
+ }
+
+ /**
+ * {@link Node} implementation.
+ */
+ public static class NodeImpl implements Node {
+
+ private final String name;
+ private final Integer index;
+ private final Object key;
+
+ /**
+ * Construct a new Node implementation.
+ *
+ * @param name The name
+ */
+ public NodeImpl(String name) {
+ this(name, null, null);
+ }
+
+ /**
+ * Construct a new Node implementation.
+ *
+ * @param name The name
+ * @param index The index
+ * @param key The key
+ */
+ public NodeImpl(String name, Integer index, Object key) {
+ this.index = index;
+ this.key = key;
+ this.name = name;
+ }
+
+ /**
+ * Return the index.
+ *
+ * @return the index
+ */
+ public Integer getIndex() {
+ return index;
+ }
+
+ /**
+ * Return the key.
+ *
+ * @return the key
+ */
+ public Object getKey() {
+ return key;
+ }
+
+ /**
+ * Return the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Return is in iterable.
+ *
+ * @return is in iterable
+ */
+ public boolean isInIterable() {
+ return (index != null || key != null);
+ }
+ }
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/PathImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import java.lang.annotation.ElementType;
+
+import javax.validation.Path;
+import javax.validation.TraversableResolver;
+import javax.validation.Path.Node;
+
+/**
+ * {@link TraversableResolver} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class TraversableResolverImpl implements TraversableResolver {
+
+ /**
+ * @see TraversableResolver#isCascadable(Object, Node, Class, Path, ElementType)
+ */
+ public boolean isCascadable(Object object, Node property,
+ Class<?> beanType, Path path, ElementType elementType) {
+ return true;
+ }
+
+ /**
+ * @see TraversableResolver#isReachable(Object, Node, Class, Path, ElementType)
+ */
+ public boolean isReachable(Object object, Node property, Class<?> beanType,
+ Path path, ElementType elementType) {
+ return true;
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/TraversableResolverImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.Validator;
+import javax.validation.ValidatorContext;
+import javax.validation.ValidatorFactory;
+
+/**
+ * {@link ValidatorContext} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ValidatorContextImpl implements ValidatorContext {
+
+ private ConstraintValidatorFactory factory;
+ private MessageInterpolator interpolator;
+ private TraversableResolver resolver;
+
+ public ValidatorContextImpl(ValidatorFactory validatorFactory) {
+ this.factory = validatorFactory.getConstraintValidatorFactory();
+ this.interpolator = validatorFactory.getMessageInterpolator();
+ this.resolver = validatorFactory.getTraversableResolver();
+ }
+
+ public ValidatorContext constraintValidatorFactory(ConstraintValidatorFactory factory) {
+ this.factory = factory;
+ return this;
+ }
+
+ public Validator getValidator() {
+ return new ValidatorImpl();
+ }
+
+ public ValidatorContext messageInterpolator(MessageInterpolator interpolator) {
+ this.interpolator = interpolator;
+ return this;
+ }
+
+ public ValidatorContext traversableResolver(TraversableResolver resolver) {
+ this.resolver = resolver;
+ return this;
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorContextImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.Validator;
+import javax.validation.ValidatorContext;
+import javax.validation.ValidatorFactory;
+import javax.validation.spi.ConfigurationState;
+
+/**
+ * {@link ValidatorFactory} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ValidatorFactoryImpl implements ValidatorFactory {
+
+ private final ConfigurationState state;
+
+ /**
+ * Construct a new validator factory instance.
+ */
+ public ValidatorFactoryImpl(ConfigurationState state) {
+ this.state = state;
+ }
+
+ /**
+ * @see ValidatorFactory#getConstraintValidatorFactory()
+ */
+ public ConstraintValidatorFactory getConstraintValidatorFactory() {
+ return state.getConstraintValidatorFactory();
+ }
+
+ /**
+ * @see ValidatorFactory#getMessageInterpolator()
+ */
+ public MessageInterpolator getMessageInterpolator() {
+ return state.getMessageInterpolator();
+ }
+
+ /**
+ * @see ValidatorFactory#getTraversableResolver()
+ */
+ public TraversableResolver getTraversableResolver() {
+ return state.getTraversableResolver();
+ }
+
+ /**
+ * @see ValidatorFactory#getValidator()
+ */
+ public Validator getValidator() {
+ return usingContext().getValidator();
+ }
+
+ /**
+ * @throws UnsupportedOperationException
+ * @see ValidatorFactory#unwrap(Class)
+ */
+ public <T> T unwrap(Class<T> type) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @see ValidatorFactory#usingContext()
+ */
+ public ValidatorContext usingContext() {
+ return new ValidatorContextImpl(this);
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework;
+
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
+import javax.validation.metadata.BeanDescriptor;
+
+/**
+ * {@link Validator} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ValidatorImpl implements Validator {
+
+ /**
+ * @see Validator#getConstraintsForClass(Class)
+ */
+ public BeanDescriptor getConstraintsForClass(Class<?> type) {
+ return null;
+ }
+
+ /**
+ * @throws UnsupportedOperationException
+ * @see Validator#unwrap(Class)
+ */
+ public <T> T unwrap(Class<T> type) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @see Validator#validate(Object, Class...)
+ */
+ public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) {
+ return null;
+ }
+
+ /**
+ * @see Validator#validateProperty(Object, String, Class...)
+ */
+ public <T> Set<ConstraintViolation<T>> validateProperty(T object, String name, Class<?>... groups) {
+ return null;
+ }
+
+ /**
+ * @see Validator#validateValue(Class, String, Object, Class...)
+ */
+ public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType,
+ String name, Object value, Class<?>... groups) {
+ return null;
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/ValidatorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework.metadata;
+
+import java.util.Set;
+
+import javax.validation.metadata.BeanDescriptor;
+import javax.validation.metadata.PropertyDescriptor;
+
+
+/**
+ * {@link BeanDescriptor} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class BeanDescriptorImpl extends ElementDescriptorImpl implements BeanDescriptor {
+
+ /**
+ * @see BeanDescriptor#getConstrainedProperties()
+ */
+ public Set<PropertyDescriptor> getConstrainedProperties() {
+ return null;
+ }
+
+ /**
+ * @see BeanDescriptor#getConstraintsForProperty(String)
+ */
+ public PropertyDescriptor getConstraintsForProperty(String name) {
+ return null;
+ }
+
+ /**
+ * @see BeanDescriptor#isBeanConstrained()
+ */
+ public boolean isBeanConstrained() {
+ return false;
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/BeanDescriptorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework.metadata;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.Payload;
+import javax.validation.metadata.ConstraintDescriptor;
+
+/**
+ * {@link ConstraintDescriptor} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ConstraintDescriptorImpl<T extends Annotation> implements ConstraintDescriptor<T> {
+
+ /**
+ * @see ConstraintDescriptor#getAnnotation()
+ */
+ public T getAnnotation() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintDescriptor#getAttributes()
+ */
+ public Map<String, Object> getAttributes() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintDescriptor#getComposingConstraints()
+ */
+ public Set<ConstraintDescriptor<?>> getComposingConstraints() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintDescriptor#getConstraintValidatorClasses()
+ */
+ public List<Class<? extends ConstraintValidator<T, ?>>> getConstraintValidatorClasses() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintDescriptor#getGroups()
+ */
+ public Set<Class<?>> getGroups() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintDescriptor#getPayload()
+ */
+ public Set<Class<? extends Payload>> getPayload() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintDescriptor#isReportAsSingleViolation()
+ */
+ public boolean isReportAsSingleViolation() {
+ return false;
+ }
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ConstraintDescriptorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework.metadata;
+
+import java.lang.annotation.ElementType;
+import java.util.Set;
+
+import javax.validation.metadata.ConstraintDescriptor;
+import javax.validation.metadata.ElementDescriptor;
+import javax.validation.metadata.Scope;
+
+/**
+ * {@link ElementDescriptor} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ElementDescriptorImpl implements ElementDescriptor {
+
+ /**
+ * @see ElementDescriptor#findConstraints()
+ */
+ public ConstraintFinder findConstraints() {
+ return null;
+ }
+
+ /**
+ * @see ElementDescriptor#getConstraintDescriptors()
+ */
+ public Set<ConstraintDescriptor<?>> getConstraintDescriptors() {
+ return null;
+ }
+
+ /**
+ * @see ElementDescriptor#getElementClass()
+ */
+ public Class<?> getElementClass() {
+ return null;
+ }
+
+ /**
+ * @see ElementDescriptor#hasConstraints()
+ */
+ public boolean hasConstraints() {
+ return false;
+ }
+
+ /**
+ * {@link ConstraintFinder} implementation.
+ */
+ public static class ConstraintFinderImpl implements ConstraintFinder {
+
+ /**
+ * @see ConstraintFinder#declaredOn(ElementType...)
+ */
+ public ConstraintFinder declaredOn(ElementType... types) {
+ return null;
+ }
+
+ /**
+ * @see ConstraintFinder#getConstraintDescriptors()
+ */
+ public Set<ConstraintDescriptor<?>> getConstraintDescriptors() {
+ return null;
+ }
+
+ /**
+ * @see ConstraintFinder#hasConstraints()
+ */
+ public boolean hasConstraints() {
+ return false;
+ }
+
+ /**
+ * @see ConstraintFinder#lookingAt(Scope)
+ */
+ public ConstraintFinder lookingAt(Scope scope) {
+ return null;
+ }
+
+ /**
+ * @see ConstraintFinder#unorderedAndMatchingGroups(Class...)
+ */
+ public ConstraintFinder unorderedAndMatchingGroups(Class<?>... groups) {
+ return null;
+ }
+
+ }
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/ElementDescriptorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework.metadata;
+
+import javax.validation.metadata.PropertyDescriptor;
+
+/**
+ * {@link PropertyDescriptor} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class PropertyDescriptorImpl extends ElementDescriptorImpl implements PropertyDescriptor {
+
+ /**
+ * @see PropertyDescriptor#getPropertyName()
+ */
+ public String getPropertyName() {
+ return null;
+ }
+
+ /**
+ * @see PropertyDescriptor#isCascaded()
+ */
+ public boolean isCascaded() {
+ return false;
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/metadata/PropertyDescriptorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework.spi;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Set;
+
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.spi.ConfigurationState;
+
+/**
+ * {@link ConfigurationState} implementation.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ConfigurationStateImpl implements ConfigurationState {
+
+ /**
+ * @see ConfigurationState#getConstraintValidatorFactory()
+ */
+ public ConstraintValidatorFactory getConstraintValidatorFactory() {
+ return null;
+ }
+
+ /**
+ * @see ConfigurationState#getMappingStreams()
+ */
+ public Set<InputStream> getMappingStreams() {
+ return null;
+ }
+
+ /**
+ * @see ConfigurationState#getMessageInterpolator()
+ */
+ public MessageInterpolator getMessageInterpolator() {
+ return null;
+ }
+
+ /**
+ * @see ConfigurationState#getProperties()
+ */
+ public Map<String, String> getProperties() {
+ return null;
+ }
+
+ /**
+ * @see ConfigurationState#getTraversableResolver()
+ */
+ public TraversableResolver getTraversableResolver() {
+ return null;
+ }
+
+ /**
+ * @see ConfigurationState#isIgnoreXmlConfiguration()
+ */
+ public boolean isIgnoreXmlConfiguration() {
+ return false;
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ConfigurationStateImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java?rev=829207&view=auto
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java (added)
+++ commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java Fri Oct 23 20:27:44 2009
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.validation.framework.spi;
+
+import javax.validation.Configuration;
+import javax.validation.ValidatorFactory;
+import javax.validation.spi.BootstrapState;
+import javax.validation.spi.ConfigurationState;
+import javax.validation.spi.ValidationProvider;
+
+import org.apache.commons.validation.framework.ConfigurationImpl;
+import org.apache.commons.validation.framework.ValidatorFactoryImpl;
+
+
+/**
+ * {@link ValidationProvider implementation}.
+ *
+ * @version $Revision$ $Date$
+ * @since 1.0
+ */
+public class ValidationProviderImpl implements ValidationProvider<ConfigurationImpl> {
+
+ /**
+ * @see ValidationProvider#buildValidatorFactory(ConfigurationState)
+ */
+ public ValidatorFactory buildValidatorFactory(ConfigurationState state) {
+ return new ValidatorFactoryImpl(state);
+ }
+
+ /**
+ * @see ValidationProvider#createGenericConfiguration(BootstrapState)
+ */
+ public Configuration<?> createGenericConfiguration(BootstrapState state) {
+ return new ConfigurationImpl(state);
+ }
+
+ /**
+ * @see ValidationProvider#createSpecializedConfiguration(BootstrapState)
+ */
+ public ConfigurationImpl createSpecializedConfiguration(BootstrapState state) {
+ return new ConfigurationImpl(state);
+ }
+
+
+}
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/validator2/branches/alternative/validation-framework/src/main/java/org/apache/commons/validation/framework/spi/ValidationProviderImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL