Package org.cyclos.impl.utils.validation
Class Property
- java.lang.Object
-
- org.cyclos.impl.utils.validation.Property
-
public class Property extends Object
Describes a property, which contain several validations. Each property may contain at most one validation of each class. For example, ifmaxLength(int)is invoked multiple times, only the last one will be used.
-
-
Constructor Summary
Constructors Constructor Description Property(PropertyAccess access, Object display)
-
Method Summary
-
-
-
Constructor Detail
-
Property
public Property(PropertyAccess access, Object display)
-
-
Method Detail
-
add
public Property add(PropertyValidation validation)
-
allOf
public Property allOf(Collection<?> values)
-
anyOf
public Property anyOf(Collection<?> values)
-
between
public Property between(Comparable<?> from, Comparable<?> to)
Including both from and to
-
between
public Property between(Range<? extends Comparable<?>> range)
Including both from and to
-
betweenExcluding
public Property betweenExcluding(Comparable<?> from, Comparable<?> to)
Excluding both from and to
-
betweenIncludingOnlyFrom
public Property betweenIncludingOnlyFrom(Comparable<?> from, Comparable<?> to)
-
betweenIncludingOnlyTo
public Property betweenIncludingOnlyTo(Comparable<?> from, Comparable<?> to)
-
characterEncoding
public Property characterEncoding()
-
childOf
public Property childOf(Object parent, MessageKey parentKey)
-
color
public Property color()
-
comparable
public Property comparable(Comparable<?> comparable, String operation)
-
comparable
public Property comparable(Comparable<?> comparable, String operation, ValidationError error)
-
date
public Property date()
-
email
public Property email()
-
entity
public <E extends SimpleEntity> Property entity(Class<E> entityType, EntityValidation<E> validation)
-
fixedLength
public Property fixedLength(int length)
-
futureDate
public Property futureDate()
-
futurePeriod
public Property futurePeriod()
-
getAccess
public PropertyAccess getAccess()
-
getDisplay
public Object getDisplay()
-
getIdentifier
public Object getIdentifier()
-
getNestedProperties
public Collection<Property> getNestedProperties()
-
getParent
public Property getParent()
-
getValidations
public Collection<PropertyValidation> getValidations()
-
greaterEquals
public Property greaterEquals(Comparable<?> value)
-
greaterThan
public Property greaterThan(Comparable<?> value)
-
identifier
public Property identifier()
-
internalName
public Property internalName(boolean isRequired)
Internal names could be optional or required, have a max length of 50 and are formatted as identifier
-
internetAddress
public Property internetAddress()
-
internetAddressList
public Property internetAddressList()
-
invalid
public Property invalid()
-
invalid
public Property invalid(boolean handleEmpty)
-
invalid
public Property invalid(boolean handlEmpty, ValidationError error)
-
invalid
public Property invalid(MessageKey key)
-
invalid
public Property invalid(ValidationError error)
-
latLong
public Property latLong()
-
length
public Property length(int min, int max)
-
length
public Property length(IntegerRange range)
-
lessEquals
public Property lessEquals(Comparable<?> value)
-
lessThan
public Property lessThan(Comparable<?> value)
-
mask
public Property mask(int minimumPlaceholders)
-
maxElements
public Property maxElements(int length)
-
maxLength
public Property maxLength(int length)
-
maxWordSize
public Property maxWordSize(int length)
-
minElements
public Property minElements(int length)
-
minLength
public Property minLength(int length)
-
mustBeInstanceOf
public Property mustBeInstanceOf(Class<? extends BaseEntity> entityType)
-
negativeIntegerNonZero
public Property negativeIntegerNonZero()
-
negativeNonZero
public Property negativeNonZero(int scale)
-
negativeOrZero
public Property negativeOrZero()
-
nested
public Property nested(Property<?,?> beanProperty, MessageKey key)
Returns the reference to a nested property, creating a new one if it doesn't exists
-
nested
public Property nested(Property<?,?> beanProperty, String label)
Returns the reference to a nested property, creating a new one if it doesn't exists
-
noFuturePeriod
public Property noFuturePeriod()
-
noneOf
public Property noneOf(Collection<?> values)
-
noPropertyOf
public Property noPropertyOf(Collection<Class<?>> values)
-
pastDate
public Property pastDate()
-
period
public Property period()
-
phoneNumber
public Property phoneNumber(String defaultCountry, PhoneNature expectedNature)
-
positiveIntegerNonZero
public Property positiveIntegerNonZero()
-
positiveNonZero
public Property positiveNonZero()
-
positiveNonZero
public Property positiveNonZero(HasCurrency hasCurrency)
-
positiveNonZero
public Property positiveNonZero(int scale)
-
positiveOrZero
public Property positiveOrZero()
-
positiveOrZero
public Property positiveOrZero(HasCurrency hasCurrency)
-
range
public Property range(RangeOptionalType type)
-
required
public Property required()
-
url
public Property url()
-
-