E - the type of the elements in the source collection.C - thed collection type.public class UnorderedCollectionUpdatingValidator<E,C extends java.util.Collection<? extends E>> extends Validators.CollectionValidator<E,C> implements UpdatingValidator<C>, BeanValidator
Created: August 11 2014
UpdatingValidator.NoOpValidator<T>, UpdatingValidator.NullObjectIfNulledUpdatingValidator, UpdatingValidator.PropertyUpdateActionBeanValidator.NoOpBeanValidator| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
CLASS_VERSION
Class version string 
 | 
static java.lang.String | 
ID_PROPERTIES  | 
protected static VariableArgumentApplicationLogging | 
LOGGER  | 
NO_OPNO_OP_BEAN_VALIDATOR| Constructor and Description | 
|---|
UnorderedCollectionUpdatingValidator()
Create a new instance. 
 | 
UnorderedCollectionUpdatingValidator(boolean pRequired)
Create a new instance. 
 | 
UnorderedCollectionUpdatingValidator(boolean pRequired,
                                    Validator<? extends E> pValueValidator)
Create a new instance. 
 | 
UnorderedCollectionUpdatingValidator(java.lang.String pErrorCode,
                                    boolean pRequired)
Create a new instance. 
 | 
UnorderedCollectionUpdatingValidator(java.lang.String pErrorCode,
                                    boolean pRequired,
                                    Validator<? extends E> pValueValidator)
Create a new instance. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
addNewTargetElement(java.util.Collection<java.lang.Object> pTargetCollection,
                   java.lang.Object pTargetElement,
                   ValidatorContext<?> pContext)
Add a new target element to the target collection. 
 | 
protected java.util.Collection<java.lang.Object> | 
createCollectionDestination(java.lang.String pPropertyName,
                           java.lang.Object pTarget,
                           ValidatorContext<?> pContext)
If the pPropertyName on the target is null, this method will be invoked. 
 | 
protected boolean | 
createMatchingTargetAlsoAdds(java.util.Collection<java.lang.Object> pTargetCollection,
                            ValidatorContext<?> pContext)
Return whether creation a matching target also adds to the collection. 
 | 
protected java.lang.Object | 
createMatchingTargetElement(java.lang.String pPropertyName,
                           int pSourceIndex,
                           java.lang.Object pSourceElement,
                           java.util.Collection<java.lang.Object> pTargetCollection,
                           ValidatorContext<?> pContext)
Create a matching target to be the target of properties
 of pSourceObject. 
 | 
protected java.lang.Object | 
findMatchingTarget(java.lang.Object pSourceElement,
                  java.util.Collection<java.lang.Object> pTargetCollection,
                  ValidatorContext<?> pContext)
Find a match for pSourceObject in the collection pTargetCollection. 
 | 
protected java.util.List<atg.core.util.Pair.AliasedPair> | 
getMatchedPairs(C collSrc,
               java.util.List<java.lang.Object> dstsUnmatched,
               ValidatorContext pContext)  | 
java.lang.Class | 
getTargetCollectionCreateType()
Returns property targetCollectionCreateType. 
 | 
java.lang.Class | 
getTargetElementCreateType()
Returns property targetElementCreateType. 
 | 
CollectionUpdateHelper<? extends java.util.Collection<?>,?> | 
getUpdateHelper()
Returns property updateHelper. 
 | 
boolean | 
isAutoCreateCollectionTargetGuess()
Returns property autoCreateCollectionTargetGuess. 
 | 
protected void | 
postProcessCollection(java.util.Collection<?> pTargetCollection,
                     java.util.List<java.lang.Object> pDestinationItemsInSourceOrder,
                     ValidatorContext<?> pContext)
Post process the target collection, possibly ordering the target
 list. 
 | 
protected void | 
removeUnmatchedTargetValues(java.util.Collection<java.lang.Object> pTargetCollection,
                           java.util.List<java.lang.Object> pUnmatchedElements,
                           ValidatorContext<?> pContext)
Remove the unmatched element (pUnmatchedElements) from
 pTargetCollection. 
 | 
void | 
setAutoCreateCollectionTargetGuess(boolean pAutoCreateCollectionTargetGuess)
Sets property autoCreateCollectionTargetGuess. 
 | 
void | 
setTargetCollectionCreateType(java.lang.Class pTargetCollectionCreateType)
Sets property targetCollectionCreateType. 
 | 
void | 
setTargetElementCreateType(java.lang.Class pTargetElementCreateType)
Sets property targetElementCreateType. 
 | 
void | 
setUpdateHelper(CollectionUpdateHelper<? extends java.util.Collection<?>,?> pUpdateHelper)
Sets property updateHelper. 
 | 
protected boolean | 
shouldPredeleteUnmatchedTargetValues(ValidatorContext<?> pContext)
Whether to pre-delete unmatched target values. 
 | 
protected boolean | 
shouldSetCreatedCollectionAsProperty(java.util.Collection<java.lang.Object> pTargetCollection,
                                    ValidatorContext<?> pContext)
Return whether to set the created collection as a property of the parent. 
 | 
void | 
updateBean(java.lang.Object pSource,
          java.lang.Object pTarget,
          ValidatorContext<?> pContext)
Update the target bean with properties from pSource. 
 | 
UpdatingValidator.PropertyUpdateAction | 
updateBeanValue(java.lang.String pPropertyName,
               java.lang.Object pSource,
               java.lang.Object pTarget,
               ValidatorContext<?> pContext)
Typically invoked by  
ValidatorManager. | 
void | 
validateBean(java.lang.Object pBean,
            ValidatorContext<?> pContext)
Validate the specified bean. 
 | 
checkUniquePropertyValues, filterCollection, getChildValidatorMap, getChildValidators, getDefaultKeyForChildValidatorMap, getUniquePropertyNames, getValueValidator, listFromArray, setChildValidatorMap, validateValuegetClassRequired, getRequiredOption, getRequiredPredicate, isRequired, keyMustBePresent, setClassRequired, setRequired, setRequiredOption, setRequiredPredicateassertAlphanumeric, assertBoolean, assertDateTime, assertDouble, assertInstanceOf, assertInteger, assertLong, assertNotBlankString, assertNotEmpty, assertNotEmpty, assertNotNull, assertNotNull, assertString, assertString, assertString, createInstance, getBeanPropertyValueForValidation, getErrorCode, getNameForClass, getPropertyNames, getPropertyValue, getPropertyValue, hasProperty, isDigits, isRequired, setErrorCode, setPropertyValue, validateBeanPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateBeanProperty, validateValuepublic static java.lang.String CLASS_VERSION
protected static final VariableArgumentApplicationLogging LOGGER
public static final java.lang.String ID_PROPERTIES
public UnorderedCollectionUpdatingValidator()
public UnorderedCollectionUpdatingValidator(boolean pRequired)
pRequired - whether a non-null value is requiredpublic UnorderedCollectionUpdatingValidator(java.lang.String pErrorCode,
                                            boolean pRequired)
pErrorCode - the string error code to report on CCExceptions created by this
   validator.pRequired - whether a non-null value is requiredpublic UnorderedCollectionUpdatingValidator(boolean pRequired,
                                            Validator<? extends E> pValueValidator)
pRequired - whether a non-null value is requiredpValueValidator - the validator for individual values.public UnorderedCollectionUpdatingValidator(java.lang.String pErrorCode,
                                            boolean pRequired,
                                            Validator<? extends E> pValueValidator)
pErrorCode - the string error code to report on CCExceptions created by this
   validator.pRequired - whether a non-null value is requiredpValueValidator - the validator for individual values.public void setAutoCreateCollectionTargetGuess(boolean pAutoCreateCollectionTargetGuess)
public boolean isAutoCreateCollectionTargetGuess()
public void setTargetCollectionCreateType(java.lang.Class pTargetCollectionCreateType)
public java.lang.Class getTargetCollectionCreateType()
public void setTargetElementCreateType(java.lang.Class pTargetElementCreateType)
public java.lang.Class getTargetElementCreateType()
public void setUpdateHelper(CollectionUpdateHelper<? extends java.util.Collection<?>,?> pUpdateHelper)
public CollectionUpdateHelper<? extends java.util.Collection<?>,?> getUpdateHelper()
public UpdatingValidator.PropertyUpdateAction updateBeanValue(java.lang.String pPropertyName, java.lang.Object pSource, java.lang.Object pTarget, ValidatorContext<?> pContext)
UpdatingValidatorValidatorManager. Update
 a bean value from a source value. Note that if a new target bean
 is created, pContext.replaceParentDst() may need to be invoked.updateBeanValue in interface UpdatingValidator<C extends java.util.Collection<? extends E>>pSource - the value of pPropertyName property of the source
   beanpTarget - the existing value of pPropertyName of the target
   beanpContext - the current update context (with the
   current source/target parent beans).public void validateBean(java.lang.Object pBean,
                         ValidatorContext<?> pContext)
BeanValidatorvalidateBean in interface BeanValidatorpBean - the bean to validatepContext - the validator context to which any validation
    errors will be added.public void updateBean(java.lang.Object pSource,
                       java.lang.Object pTarget,
                       ValidatorContext<?> pContext)
BeanValidatorupdateBean in interface BeanValidatorpSource - the source beanpTarget - the target beanpContext - the validator context.protected void postProcessCollection(java.util.Collection<?> pTargetCollection,
                                     java.util.List<java.lang.Object> pDestinationItemsInSourceOrder,
                                     ValidatorContext<?> pContext)
pTargetCollection - the target collection to post process. The
   target collection should be in its final state, except perhaps for
   ordering.pDestinationItemsInSourceOrder - the destination items in source
  order. Should have the same members as pTargetCollection, but not
  necessary in source order.pContext - the current validator context.protected java.util.Collection<java.lang.Object> createCollectionDestination(java.lang.String pPropertyName,
                                                                             java.lang.Object pTarget,
                                                                             ValidatorContext<?> pContext)
pPropertyName - the parent property name.pTarget - the owning target parent bean.pContext - the owning validation context.protected boolean shouldPredeleteUnmatchedTargetValues(ValidatorContext<?> pContext)
pContext - the context to matchprotected boolean shouldSetCreatedCollectionAsProperty(java.util.Collection<java.lang.Object> pTargetCollection,
                                                       ValidatorContext<?> pContext)
pContext - the update context.protected java.lang.Object findMatchingTarget(java.lang.Object pSourceElement,
                                              java.util.Collection<java.lang.Object> pTargetCollection,
                                              ValidatorContext<?> pContext)
                                       throws PropertyNotFoundException,
                                              java.beans.IntrospectionException,
                                              atg.core.exception.ItemNotFoundException
pSourceElement - the source object to try to find a match forpTargetCollection - the target collectionatg.core.exception.ItemNotFoundExceptionPropertyNotFoundExceptionjava.beans.IntrospectionExceptionprotected java.lang.Object createMatchingTargetElement(java.lang.String pPropertyName,
                                                       int pSourceIndex,
                                                       java.lang.Object pSourceElement,
                                                       java.util.Collection<java.lang.Object> pTargetCollection,
                                                       ValidatorContext<?> pContext)
pSourceIndex - the source indexpSourceElement - the source element to create a match forpTargetCollection - the collection into which pSourceElement should (eventually)
   be placed.pContext - the update context.protected boolean createMatchingTargetAlsoAdds(java.util.Collection<java.lang.Object> pTargetCollection,
                                               ValidatorContext<?> pContext)
pTargetCollection - the target collection to which elements may be
   added or removed.pContext - the current update context.protected void addNewTargetElement(java.util.Collection<java.lang.Object> pTargetCollection,
                                   java.lang.Object pTargetElement,
                                   ValidatorContext<?> pContext)
pTargetCollection - the collection to add an element to.pTargetElement - the new element to add to the collection.pIndex - the index at which to add.pContext - the update context.protected void removeUnmatchedTargetValues(java.util.Collection<java.lang.Object> pTargetCollection,
                                           java.util.List<java.lang.Object> pUnmatchedElements,
                                           ValidatorContext<?> pContext)
pTargetCollection - the collection from which elements should
   be removed.pUnmatchedElements - the unmatched elements to be removedpContext - the update context.protected java.util.List<atg.core.util.Pair.AliasedPair> getMatchedPairs(C collSrc, java.util.List<java.lang.Object> dstsUnmatched, ValidatorContext pContext) throws PropertyNotFoundException, java.beans.IntrospectionException, atg.core.exception.ItemNotFoundException
PropertyNotFoundExceptionjava.beans.IntrospectionExceptionatg.core.exception.ItemNotFoundException