/** * @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. */ public final Set<Class<?>> getGroupList() { return constraintDescriptor.getGroups(); }
@Override public ConstraintType getPartition(ConstraintDescriptorImpl<?> v) { return v.getConstraintType(); } };
private <A extends Annotation> ConstraintDescriptorImpl<A> buildConstraintDescriptor(Member member, A annotation, ElementType type) { return new ConstraintDescriptorImpl<A>( constraintHelper, member, annotation, type ); }
public final ElementType getElementType() { return constraintDescriptor.getElementType(); }
/** * @return {@code} true if the current constraint should be reported as single violation, {@code false otherwise}. * When using negation, we only report the single top-level violation, as * it is hard, especially for ALL_FALSE to give meaningful reports */ private boolean reportAsSingleViolation() { return getDescriptor().isReportAsSingleViolation() || getDescriptor().getCompositionType() == ALL_FALSE; }
@Override public final ConstraintFinder findConstraints() { return new ConstraintFinderImpl(); }
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; }
@Override public final boolean isBeanConstrained() { return hasConstraints() || !constrainedProperties.isEmpty(); }
@Override public final Set<ConstraintDescriptor<?>> getConstraintDescriptors() { return findConstraints().getConstraintDescriptors(); }
@Override public boolean hasConstraints() { return getConstraintDescriptors().size() != 0; }
@Override public PropertyDescriptorImpl asDescriptor(boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence) { return new PropertyDescriptorImpl( getType(), getName(), asDescriptors( getConstraints() ), isCascading(), defaultGroupSequenceRedefined, defaultGroupSequence, getGroupConversionDescriptors() ); }
@Override public String getMessageTemplate() { return (String) getAttributes().get( ConstraintHelper.MESSAGE ); }
if (cdi1.getElementType() != null ? !cdi1.getElementType().equals(cdi2.getElementType()) : cdi2.getElementType() != null) { return false;
/** * @return {@code} true if the current constraint should be reported as single violation, {@code false otherwise}. * When using negation, we only report the single top-level violation, as * it is hard, especially for ALL_FALSE to give meaningful reports */ private boolean reportAsSingleViolation() { return getDescriptor().isReportAsSingleViolation() || getDescriptor().getCompositionType() == ALL_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. */ public final Set<Class<?>> getGroupList() { return constraintTree.getDescriptor().getGroups(); }
private <A extends Annotation> ConstraintDescriptorImpl<A> buildConstraintDescriptor(Member member, A annotation, ElementType type) { return new ConstraintDescriptorImpl<>( constraintHelper, member, new ConstraintAnnotationDescriptor<>( annotation ), type ); }
@Override public final ConstraintFinder findConstraints() { return new ConstraintFinderImpl(); }
@Override public int hashCode() { int result = constraintDescriptor != null ? constraintDescriptor.hashCode() : 0; result = 31 * result + ( location != null ? location.hashCode() : 0 ); return result; }
@Override public final boolean isBeanConstrained() { return hasConstraints() || !constrainedProperties.isEmpty(); }
@Override public final Set<ConstraintDescriptor<?>> getConstraintDescriptors() { return findConstraints().getConstraintDescriptors(); }