code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public void iterableValue(String nodeName, Object value) {
valueContext.markCurrentPropertyAsIterable();
doValidate( value, nodeName );
} | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | iterableValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
@Override
public void indexedValue(String nodeName, int index, Object value) {
valueContext.markCurrentPropertyAsIterableAndSetIndex( index );
doValidate( value, nodeName );
} | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | indexedValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
@Override
public void keyedValue(String nodeName, Object key, Object value) {
valueContext.markCurrentPropertyAsIterableAndSetKey( key );
doValidate( value, nodeName );
} | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | keyedValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private void doValidate(Object value, String nodeName) {
// We need to convert the group before checking if the bean was processed or not
// as group defines the processed status.
Class<?> originalGroup = valueContext.getCurrentGroup();
Class<?> currentGroup = cascadingMetaData.convertGroup( originalGroup )... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | doValidate | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private void validateCascadedContainerElementsInContext(Object value, BaseBeanValidationContext<?> validationContext, ValueContext<?, ?> valueContext,
ContainerCascadingMetaData cascadingMetaData, ValidationOrder validationOrder) {
Iterator<Group> groupIterator = validationOrder.getGroupIterator();
while ( group... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateCascadedContainerElementsInContext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private BeanValueContext<?, Object> buildNewLocalExecutionContext(ValueContext<?, ?> valueContext, Object value) {
BeanValueContext<?, Object> newValueContext;
Contracts.assertNotNull( value, "value cannot be null" );
BeanMetaData<?> beanMetaData = beanMetaDataManager.getBeanMetaData( value.getClass() );
newVal... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | buildNewLocalExecutionContext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> Set<ConstraintViolation<T>> validateValueInContext(BaseBeanValidationContext<T> validationContext, Object value, PathImpl propertyPath,
ValidationOrder validationOrder) {
BeanValueContext<?, Object> valueContext = getValueContextForValueValidation( validationContext.getRootBeanClass(), propertyPath );
... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateValueInContext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> void validateParametersInContext(ExecutableValidationContext<T> validationContext,
Object[] parameterValues,
ValidationOrder validationOrder) {
BeanMetaData<T> beanMetaData = validationContext.getRootBeanMetaData();
Optional<ExecutableMetaData> executableMetaDataOptional = validationContext.getEx... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateParametersInContext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> void validateParametersForGroup(ExecutableValidationContext<T> validationContext, ExecutableMetaData executableMetaData, Object[] parameterValues,
Group group) {
Contracts.assertNotNull( executableMetaData, "executableMetaData may not be null" );
// TODO GM: define behavior with respect to redefined... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateParametersForGroup | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> void validateParametersForSingleGroup(ExecutableValidationContext<T> validationContext, Object[] parameterValues, ExecutableMetaData executableMetaData, Class<?> currentValidatedGroup) {
if ( !executableMetaData.getCrossParameterConstraints().isEmpty() ) {
ValueContext<T, Object> valueContext = getExec... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateParametersForSingleGroup | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> ValueContext<T, Object> getExecutableValueContext(T object, ExecutableMetaData executableMetaData, Validatable validatable, Class<?> group) {
ValueContext<T, Object> valueContext;
valueContext = ValueContexts.getLocalExecutionContextForExecutable(
validatorScopedContext.getParameterNameProvider(),
... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | getExecutableValueContext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <V, T> void validateReturnValueInContext(ExecutableValidationContext<T> validationContext, T bean, V value, ValidationOrder validationOrder) {
BeanMetaData<T> beanMetaData = validationContext.getRootBeanMetaData();
Optional<ExecutableMetaData> executableMetaDataOptional = validationContext.getExecutableMet... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateReturnValueInContext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> void validateReturnValueForGroup(BaseBeanValidationContext<T> validationContext, ExecutableMetaData executableMetaData, T bean, Object value,
Group group) {
Contracts.assertNotNull( executableMetaData, "executableMetaData may not be null" );
// TODO GM: define behavior with respect to redefined defa... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateReturnValueForGroup | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <T> void validateReturnValueForSingleGroup(BaseBeanValidationContext<T> validationContext, ExecutableMetaData executableMetaData, T bean, Object value, Class<?> oneGroup) {
// validate constraints at return value itself
ValueContext<?, Object> valueContext = getExecutableValueContext(
executableMetaData... | Validates all cascaded constraints for the given bean using the current group set in the execution context.
This method must always be called after validateConstraints for the same context.
@param validationContext The execution context
@param valueContext Collected information for single validation | validateReturnValueForSingleGroup | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <V> BeanValueContext<?, V> getValueContextForPropertyValidation(BaseBeanValidationContext<?> validationContext, PathImpl propertyPath) {
Class<?> clazz = validationContext.getRootBeanClass();
BeanMetaData<?> beanMetaData = validationContext.getRootBeanMetaData();
Object value = validationContext.getRootBe... | Returns a value context pointing to the given property path relative to the specified root class for a given
value.
@param validationContext The validation context.
@param propertyPath The property path for which constraints have to be collected.
@return Returns an instance of {@code ValueContext} which describes the... | getValueContextForPropertyValidation | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private <V> BeanValueContext<?, V> getValueContextForValueValidation(Class<?> rootBeanClass,
PathImpl propertyPath) {
Class<?> clazz = rootBeanClass;
BeanMetaData<?> beanMetaData = null;
PropertyMetaData propertyMetaData = null;
Iterator<Path.Node> propertyPathIter = propertyPath.iterator();
while ( prop... | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | getValueContextForValueValidation | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isValidationRequired(BaseBeanValidationContext<?> validationContext,
ValueContext<?, ?> valueContext,
MetaConstraint<?> metaConstraint) {
// check if this validation context is qualified to validate the current meta constraint.
// For instance, in the case of validateProperty()/validateValue()... | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isValidationRequired | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isReachable(BaseBeanValidationContext<?> validationContext, Object traversableObject, PathImpl path,
ConstraintLocationKind constraintLocationKind) {
if ( needToCallTraversableResolver( path, constraintLocationKind ) ) {
return true;
}
Path pathToObject = PathImpl.createCopyWithoutLeafNode(... | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isReachable | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean needToCallTraversableResolver(PathImpl path, ConstraintLocationKind constraintLocationKind) {
// as the TraversableResolver interface is designed right now it does not make sense to call it when
// there is no traversable object hosting the property to be accessed. For this reason we don't call the ... | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | needToCallTraversableResolver | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isCascadeRequired(BaseBeanValidationContext<?> validationContext, Object traversableObject, PathImpl path,
ConstraintLocationKind constraintLocationKind) {
if ( needToCallTraversableResolver( path, constraintLocationKind ) ) {
return true;
}
boolean isReachable = isReachable( validationCont... | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isCascadeRequired | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isClassLevelConstraint(ConstraintLocationKind constraintLocationKind) {
return ConstraintLocationKind.TYPE.equals( constraintLocationKind );
} | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isClassLevelConstraint | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isCrossParameterValidation(PathImpl path) {
return path.getLeafNode().getKind() == ElementKind.CROSS_PARAMETER;
} | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isCrossParameterValidation | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isParameterValidation(PathImpl path) {
return path.getLeafNode().getKind() == ElementKind.PARAMETER;
} | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isParameterValidation | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean isReturnValueValidation(PathImpl path) {
return path.getLeafNode().getKind() == ElementKind.RETURN_VALUE;
} | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | isReturnValueValidation | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private boolean shouldFailFast(BaseBeanValidationContext<?> validationContext) {
return validationContext.isFailFastModeEnabled() && !validationContext.getFailingConstraints().isEmpty();
} | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | shouldFailFast | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private PropertyMetaData getBeanPropertyMetaData(BeanMetaData<?> beanMetaData, Path.Node propertyNode) {
if ( !ElementKind.PROPERTY.equals( propertyNode.getKind() ) ) {
throw LOG.getInvalidPropertyPathException( beanMetaData.getBeanClass(), propertyNode.getName() );
}
return beanMetaData.getMetaDataFor( prope... | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | getBeanPropertyMetaData | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
private Object getCascadableValue(BaseBeanValidationContext<?> validationContext, Object object, Cascadable cascadable) {
return cascadable.getValue( object );
} | Returns a value context pointing to the given property path relative to the specified root class without a value.
<p>
We are only able to use the static types as we don't have the value.
</p>
@param rootBeanClass The class of the root bean.
@param propertyPath The property path for which constraints have to be collect... | getCascadableValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java | MIT |
public static <U extends Annotation> ConstraintTree<U> of(ConstraintValidatorManager constraintValidatorManager,
ConstraintDescriptorImpl<U> composingDescriptor, Type validatedValueType) {
if ( composingDescriptor.getComposingConstraintImpls().isEmpty() ) {
return new SimpleConstraintTree<>( constraintValidator... | The constraint descriptor for the constraint represented by this constraint tree. | of | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
public final boolean validateConstraints(ValidationContext<?> validationContext, ValueContext<?, ?> valueContext) {
List<ConstraintValidatorContextImpl> violatedConstraintValidatorContexts = new ArrayList<>( 5 );
validateConstraints( validationContext, valueContext, violatedConstraintValidatorContexts );
if ( !vi... | The constraint descriptor for the constraint represented by this constraint tree. | validateConstraints | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
public final ConstraintDescriptorImpl<A> getDescriptor() {
return descriptor;
} | The constraint descriptor for the constraint represented by this constraint tree. | getDescriptor | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
public final Type getValidatedValueType() {
return this.validatedValueType;
} | The constraint descriptor for the constraint represented by this constraint tree. | getValidatedValueType | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
private ValidationException getExceptionForNullValidator(Type validatedValueType, String path) {
if ( descriptor.getConstraintType() == ConstraintDescriptorImpl.ConstraintType.CROSS_PARAMETER ) {
return LOG.getValidatorForCrossParameterConstraintMustEitherValidateObjectOrObjectArrayException(
descriptor.getAn... | The constraint descriptor for the constraint represented by this constraint tree. | getExceptionForNullValidator | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
protected final ConstraintValidator<A, ?> getInitializedConstraintValidator(ValidationContext<?> validationContext, ValueContext<?, ?> valueContext) {
ConstraintValidator<A, ?> validator;
if ( validationContext.getConstraintValidatorManager().isPredefinedScope() ) {
validator = defaultInitializedConstraintValid... | The constraint descriptor for the constraint represented by this constraint tree. | getInitializedConstraintValidator | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
@SuppressWarnings("unchecked")
protected final <V> Optional<ConstraintValidatorContextImpl> validateSingleConstraint(
ValueContext<?, ?> valueContext,
ConstraintValidatorContextImpl constraintValidatorContext,
ConstraintValidator<A, V> validator) {
boolean isValid;
try {
V validatedValue = (V) valueCon... | @return an {@link Optional#empty()} if there is no violation or a corresponding {@link ConstraintValidatorContextImpl}
otherwise. | validateSingleConstraint | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( "ConstraintTree" );
sb.append( "{ descriptor=" ).append( descriptor );
sb.append( '}' );
return sb.toString();
} | @return an {@link Optional#empty()} if there is no violation or a corresponding {@link ConstraintValidatorContextImpl}
otherwise. | toString | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/engine/constraintvalidation/ConstraintTree.java | MIT |
public void add(ConstrainedElement constrainedElement) {
/*
* Make sure child annotation can override parent annotation with same type
*/
for (MetaConstraint<?> constraint: adaptConstraints(constrainedElement, constrainedElement.getConstraints())) {
if (!directConstraints.stream()
.filter(it->it.getDe... | Adds the given element to this builder. It must be checked with
{@link #accepts(ConstrainedElement)} before, whether this is allowed or
not.
@param constrainedElement The element to add. | add | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
protected Set<MetaConstraint<?>> getDirectConstraints() {
return directConstraints;
} | Creates a new, read-only {@link ConstraintMetaData} object with all
constraint information related to the method or property represented by
this builder.
@return A {@link ConstraintMetaData} object. | getDirectConstraints | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
public Set<MetaConstraint<?>> getContainerElementConstraints() {
return containerElementsConstraints;
} | Creates a new, read-only {@link ConstraintMetaData} object with all
constraint information related to the method or property represented by
this builder.
@return A {@link ConstraintMetaData} object. | getContainerElementConstraints | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
protected boolean isCascading() {
return isCascading;
} | Creates a new, read-only {@link ConstraintMetaData} object with all
constraint information related to the method or property represented by
this builder.
@return A {@link ConstraintMetaData} object. | isCascading | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
protected Class<?> getBeanClass() {
return beanClass;
} | Creates a new, read-only {@link ConstraintMetaData} object with all
constraint information related to the method or property represented by
this builder.
@return A {@link ConstraintMetaData} object. | getBeanClass | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
protected Set<MetaConstraint<?>> adaptOriginsAndImplicitGroups(Set<MetaConstraint<?>> constraints) {
Set<MetaConstraint<?>> adaptedConstraints = newHashSet();
for ( MetaConstraint<?> oneConstraint : constraints ) {
adaptedConstraints.add( adaptOriginAndImplicitGroup( oneConstraint ) );
}
return adaptedConst... | Adapts the given constraints to the given bean type. In case a constraint
is defined locally at the bean class the original constraint will be
returned without any modifications. If a constraint is defined in the
hierarchy (interface or super class) a new constraint will be returned
with an origin of {@link org.hiberna... | adaptOriginsAndImplicitGroups | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
private <A extends Annotation> MetaConstraint<A> adaptOriginAndImplicitGroup(MetaConstraint<A> constraint) {
ConstraintOrigin definedIn = definedIn( beanClass, constraint.getLocation().getDeclaringClass() );
if ( definedIn == ConstraintOrigin.DEFINED_LOCALLY ) {
return constraint;
}
Class<?> constraintClas... | Adapts the given constraints to the given bean type. In case a constraint
is defined locally at the bean class the original constraint will be
returned without any modifications. If a constraint is defined in the
hierarchy (interface or super class) a new constraint will be returned
with an origin of {@link org.hiberna... | adaptOriginAndImplicitGroup | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
protected Set<MetaConstraint<?>> adaptConstraints(ConstrainedElement constrainedElement, Set<MetaConstraint<?>> constraints) {
return constraints;
} | Allows specific sub-classes to customize the retrieved constraints. | adaptConstraints | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
private ConstraintOrigin definedIn(Class<?> rootClass, Class<?> hierarchyClass) {
if ( hierarchyClass.equals( rootClass ) ) {
return ConstraintOrigin.DEFINED_LOCALLY;
}
else {
return ConstraintOrigin.DEFINED_IN_HIERARCHY;
}
} | @param rootClass The root class. That is the class for which we currently
create a {@code BeanMetaData}
@param hierarchyClass The class on which the current constraint is defined on
@return Returns {@code ConstraintOrigin.DEFINED_LOCALLY} if the
constraint was defined on the root bean,
{@code Constrain... | definedIn | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/aggregated/MetaDataBuilder.java | MIT |
@Override
protected Stack<MetaConstraint<?>> initialValue() {
return new Stack<MetaConstraint<?>>();
} | Instances of this class abstract the constraint type (class, method or field constraint) and give access to
meta data about the constraint. This allows a unified handling of constraints in the validator implementation.
@author Hardy Ferentschik
@author Gunnar Morling
@author Guillaume Smet | initialValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public static MetaConstraint<?> get() {
if (!stack.get().isEmpty())
return stack.get().peek();
else
return null;
} | Instances of this class abstract the constraint type (class, method or field constraint) and give access to
meta data about the constraint. This allows a unified handling of constraints in the validator implementation.
@author Hardy Ferentschik
@author Gunnar Morling
@author Guillaume Smet | get | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
private static ValueExtractionPathNode getValueExtractionPath(List<ContainerClassTypeParameterAndExtractor> valueExtractionPath) {
switch ( valueExtractionPath.size() ) {
case 0: return null;
case 1: return new SingleValueExtractionPathNode( valueExtractionPath.iterator().next() );
default: return new Linked... | @param constraintDescriptor The constraint descriptor for this constraint
@param location meta data about constraint placement
@param valueExtractionPath the potential {@link ValueExtractor}s used to extract the value to validate
@param validatedValueType the type of the validated element | getValueExtractionPath | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public final Set<Class<?>> getGroupList() {
return constraintTree.getDescriptor().getGroups();
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getGroupList | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public final boolean isDefinedForOneGroupOnly() {
return isDefinedForOneGroupOnly;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | isDefinedForOneGroupOnly | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public final ConstraintDescriptorImpl<A> getDescriptor() {
return constraintTree.getDescriptor();
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getDescriptor | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public final ConstraintLocationKind getConstraintLocationKind() {
return constraintTree.getDescriptor().getConstraintLocationKind();
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getConstraintLocationKind | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public boolean validateConstraint(ValidationContext<?> validationContext, ValueContext<?, Object> valueContext) {
push(this);
try {
boolean success = true;
// constraint requiring value extraction to get the value to validate
if ( valueExtractionPath != null ) {
Object valueToValidate = valueContext.ge... | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | validateConstraint | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
private boolean doValidateConstraint(ValidationContext<?> executionContext, ValueContext<?, ?> valueContext) {
valueContext.setConstraintLocationKind( getConstraintLocationKind() );
boolean validationResult = constraintTree.validateConstraints( executionContext, valueContext );
return validationResult;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | doValidateConstraint | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public ConstraintLocation getLocation() {
return location;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getLocation | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
MetaConstraint<?> that = (MetaConstraint<?>) o;
if ( !constraintTree.getDescriptor().equals( that.constraintTree.getDescriptor() ) ) {
return false;
}
... | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | equals | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
private static int buildHashCode(ConstraintDescriptorImpl<?> constraintDescriptor, ConstraintLocation location) {
final int prime = 31;
int result = 1;
result = prime * result + constraintDescriptor.hashCode();
result = prime * result + location.hashCode();
return result;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | buildHashCode | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public int hashCode() {
return hashCode;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | hashCode | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( "MetaConstraint" );
sb.append( "{constraintType=" ).append( StringHelper.toShortString( constraintTree.getDescriptor().getAnnotation().annotationType() ) );
sb.append( ", location=" ).append( location );
sb.append( ... | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | toString | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public void value(String nodeName, Object object) {
doValidate( object, nodeName );
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | value | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public void iterableValue(String nodeName, Object value) {
valueContext.markCurrentPropertyAsIterable();
doValidate( value, nodeName );
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | iterableValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public void indexedValue(String nodeName, int index, Object value) {
valueContext.markCurrentPropertyAsIterableAndSetIndex( index );
doValidate( value, nodeName );
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | indexedValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public void keyedValue(String nodeName, Object key, Object value) {
valueContext.markCurrentPropertyAsIterableAndSetKey( key );
doValidate( value, nodeName );
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | keyedValue | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
private void doValidate(Object value, String nodeName) {
BeanValueContext.ValueState<Object> originalValueState = valueContext.getCurrentValueState();
Class<?> containerClass = currentValueExtractionPathNode.getContainerClass();
if ( containerClass != null ) {
valueContext.setTypeParameter( containerClass... | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | doValidate | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public boolean isSuccess() {
return success;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | isSuccess | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public String toString() {
return "ContainerClassTypeParameterAndExtractor [containerClass=" + containerClass +
", typeParameter=" + typeParameter +
", typeParameterIndex=" + typeParameterIndex +
", valueExtractorDescriptor=" + valueExtractorDescriptor + "]";
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | toString | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public boolean hasNext() {
return false;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | hasNext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public ValueExtractionPathNode getPrevious() {
throw new NoSuchElementException();
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getPrevious | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public ValueExtractionPathNode getNext() {
throw new NoSuchElementException();
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getNext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public Class<?> getContainerClass() {
return containerClass;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getContainerClass | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public TypeVariable<?> getTypeParameter() {
return typeParameter;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getTypeParameter | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public Integer getTypeParameterIndex() {
return typeParameterIndex;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getTypeParameterIndex | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public ValueExtractorDescriptor getValueExtractorDescriptor() {
return valueExtractorDescriptor;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getValueExtractorDescriptor | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public String toString() {
return "SingleValueExtractionPathNode [containerClass=" + containerClass +
", typeParameter=" + typeParameter +
", valueExtractorDescriptor=" + valueExtractorDescriptor + "]";
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | toString | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public boolean hasNext() {
return next != null;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | hasNext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public ValueExtractionPathNode getPrevious() {
return previous;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getPrevious | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public ValueExtractionPathNode getNext() {
return next;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getNext | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public Class<?> getContainerClass() {
return containerClass;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getContainerClass | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public TypeVariable<?> getTypeParameter() {
return typeParameter;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getTypeParameter | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public Integer getTypeParameterIndex() {
return typeParameterIndex;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getTypeParameterIndex | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public ValueExtractorDescriptor getValueExtractorDescriptor() {
return valueExtractorDescriptor;
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | getValueExtractorDescriptor | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
@Override
public String toString() {
return "LinkedValueExtractionPathNode [containerClass=" + containerClass +
", typeParameter=" + typeParameter +
", valueExtractorDescriptor=" + valueExtractorDescriptor + "]";
} | @return Returns the list of groups this constraint is part of. This might include the default group even when
it is not explicitly specified, but part of the redefined default group list of the hosting bean. | toString | java | theonedev/onedev | server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/hibernate/validator/internal/metadata/core/MetaConstraint.java | MIT |
public boolean checkData() {
// If there are more documents available?
return composer.checkNode();
} | Check if more documents available
@return true when there are more YAML documents in the stream | checkData | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
public Object getData() throws NoSuchElementException {
// Construct and return the next document.
if (!composer.checkNode()) {
throw new NoSuchElementException("No document is available.");
}
Node node = composer.getNode();
if (rootTag != null) {
node.setTag(rootTag);
}
return c... | Construct and return the next document
@return constructed instance | getData | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
public Object getSingleData(Class<?> type) {
// Ensure that the stream contains a single document and construct it
final Node node = composer.getSingleNode();
if (node != null && !Tag.NULL.equals(node.getTag())) {
if (Object.class != type) {
node.setTag(new Tag(type));
} else if (rootTag... | Ensure that the stream contains a single document and construct it
@param type the class of the instance being created
@return constructed instance
@throws ComposerException in case there are more documents in the stream | getSingleData | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected final Object constructDocument(Node node) {
try {
Object data = constructObject(node);
fillRecursive();
return data;
} catch (RuntimeException e) {
if (wrappedToRootException && !(e instanceof YAMLException)) {
throw new YAMLException(e);
} else {
throw e;... | Construct complete YAML document. Call the second step in case of recursive structures. At the
end cleans all the state.
@param node root Node
@return Java instance | constructDocument | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
private void fillRecursive() {
if (!maps2fill.isEmpty()) {
for (RecursiveTuple<Map<Object, Object>, RecursiveTuple<Object, Object>> entry : maps2fill) {
RecursiveTuple<Object, Object> key_value = entry._2();
entry._1().put(key_value._1(), key_value._2());
}
maps2fill.clear();
}... | Fill the recursive structures and clean the internal collections | fillRecursive | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Object constructObject(Node node) {
if (constructedObjects.containsKey(node)) {
return constructedObjects.get(node);
}
return constructObjectNoCheck(node);
} | Construct object from the specified Node. Return existing instance if the node is already
constructed.
@param node Node to be constructed
@return Java instance | constructObject | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Object constructObjectNoCheck(Node node) {
if (recursiveObjects.contains(node)) {
throw new ConstructorException(null, null, "found unconstructable recursive node",
node.getStartMark());
}
recursiveObjects.add(node);
Construct constructor = getConstructor(node);
Object data... | Construct object from the specified Node without the check if it was already created.
@param node - the source
@return constructed instance | constructObjectNoCheck | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Construct getConstructor(Node node) {
if (node.useClassConstructor()) {
return yamlClassConstructors.get(node.getNodeId());
} else {
Tag tag = node.getTag();
Construct constructor = yamlConstructors.get(tag);
if (constructor == null) {
for (String prefix : yamlMultiCons... | Get the constructor to construct the Node. For implicit tags if the runtime class is known a
dedicated Construct implementation is used. Otherwise, the constructor is chosen by the tag.
@param node {@link Node} to construct an instance from
@return {@link Construct} implementation for the specified node | getConstructor | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected String constructScalar(ScalarNode node) {
return node.getValue();
} | Create string from scalar
@param node - the source
@return the data | constructScalar | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected List<Object> createDefaultList(int initSize) {
return new ArrayList<Object>(initSize);
} | Create string from scalar
@param node - the source
@return the data | createDefaultList | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Set<Object> createDefaultSet(int initSize) {
return new LinkedHashSet<Object>(initSize);
} | Create string from scalar
@param node - the source
@return the data | createDefaultSet | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Map<Object, Object> createDefaultMap(int initSize) {
// respect order from YAML document
return new LinkedHashMap<Object, Object>(initSize);
} | Create string from scalar
@param node - the source
@return the data | createDefaultMap | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Object createArray(Class<?> type, int size) {
return Array.newInstance(type.getComponentType(), size);
} | Create string from scalar
@param node - the source
@return the data | createArray | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Object finalizeConstruction(Node node, Object data) {
final Class<? extends Object> type = node.getType();
if (typeDefinitions.containsKey(type)) {
return typeDefinitions.get(type).finalizeConstruction(data);
}
return data;
} | Create string from scalar
@param node - the source
@return the data | finalizeConstruction | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Object newInstance(Node node) {
return newInstance(Object.class, node);
} | Create string from scalar
@param node - the source
@return the data | newInstance | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected final Object newInstance(Class<?> ancestor, Node node) {
return newInstance(ancestor, node, true);
} | Create string from scalar
@param node - the source
@return the data | newInstance | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
protected Object newInstance(Class<?> ancestor, Node node, boolean tryDefault) {
try {
final Class<? extends Object> type = node.getType();
if (typeDefinitions.containsKey(type)) {
TypeDescription td = typeDefinitions.get(type);
final Object instance = td.newInstance(node);
if (i... | Tries to create a new object for the node.
@param ancestor expected ancestor of the {@code node.getType()}
@param node for which to create a corresponding java object
@param tryDefault should default constructor to be tried when there is no corresponding
{@code TypeDescription} or {@code TypeDescription.newInst... | newInstance | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
@SuppressWarnings("unchecked")
protected Set<Object> newSet(CollectionNode<?> node) {
Object instance = newInstance(Set.class, node);
if (instance != NOT_INSTANTIATED_OBJECT) {
return (Set<Object>) instance;
} else {
return createDefaultSet(node.getValue().size());
}
} | Tries to create a new object for the node.
@param ancestor expected ancestor of the {@code node.getType()}
@param node for which to create a corresponding java object
@param tryDefault should default constructor to be tried when there is no corresponding
{@code TypeDescription} or {@code TypeDescription.newInst... | newSet | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
@SuppressWarnings("unchecked")
protected List<Object> newList(SequenceNode node) {
Object instance = newInstance(List.class, node);
if (instance != NOT_INSTANTIATED_OBJECT) {
return (List<Object>) instance;
} else {
return createDefaultList(node.getValue().size());
}
} | Tries to create a new object for the node.
@param ancestor expected ancestor of the {@code node.getType()}
@param node for which to create a corresponding java object
@param tryDefault should default constructor to be tried when there is no corresponding
{@code TypeDescription} or {@code TypeDescription.newInst... | newList | java | theonedev/onedev | server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.