本文整理汇总了Java中org.kuali.rice.krad.datadictionary.validation.capability.Constrainable类的典型用法代码示例。如果您正苦于以下问题:Java Constrainable类的具体用法?Java Constrainable怎么用?Java Constrainable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Constrainable类属于org.kuali.rice.krad.datadictionary.validation.capability包,在下文中一共展示了Constrainable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateAttribute
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* Validates the attribute specified by definition
*
* @param definition - the constrainable attribute definition of a specific attribute name
* @throws AttributeValidationException
*/
protected void validateAttribute(DictionaryValidationResult result, Constrainable definition,
AttributeValueReader attributeValueReader, boolean checkIfRequired, String validationState,
StateMapping stateMapping) throws AttributeValidationException {
if (definition == null) {
throw new AttributeValidationException(
"Unable to validate constraints for attribute \"" + attributeValueReader.getAttributeName() +
"\" on entry \"" + attributeValueReader.getEntryName() +
"\" because no attribute definition can be found.");
}
Object value = attributeValueReader.getValue();
processElementConstraints(result, value, definition, attributeValueReader, checkIfRequired, validationState,
stateMapping);
}
示例2: validateAttribute
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* Validates the attribute specified by definition
*
* @param definition - the constrainable attribute definition of a specific attribute name
* @throws AttributeValidationException
* @see #validateAttribute(DictionaryValidationResult, AttributeValueReader, boolean) for the other parameters
*/
protected void validateAttribute(DictionaryValidationResult result, Constrainable definition,
AttributeValueReader attributeValueReader, boolean checkIfRequired, String validationState,
StateMapping stateMapping) throws AttributeValidationException {
if (definition == null) {
throw new AttributeValidationException(
"Unable to validate constraints for attribute \"" + attributeValueReader.getAttributeName() +
"\" on entry \"" + attributeValueReader.getEntryName() +
"\" because no attribute definition can be found.");
}
Object value = attributeValueReader.getValue();
processElementConstraints(result, value, definition, attributeValueReader, checkIfRequired, validationState,
stateMapping);
}
示例3: getType
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
@Override
public Class<?> getType(String selectedAttributeName) {
Constrainable attributeDefinition = getDefinition(selectedAttributeName);
if (attributeDefinition != null && attributeDefinition instanceof DataTypeConstraint) {
DataTypeConstraint dataTypeConstraint = (DataTypeConstraint) attributeDefinition;
if (dataTypeConstraint.getDataType() != null) {
return dataTypeConstraint.getDataType().getType();
}
}
// Assuming we can reliably guess
return value != null ? value.getClass() : null;
}
示例4: getValue
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
@Override
public <X> X getValue(String attributeName) throws AttributeValidationException {
Constrainable attributeDefinition = getDefinition(attributeName);
if (attributeDefinition != null) {
return (X) value;
}
return null;
}
示例5: isSupported
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.datadictionary.validation.constraint.provider.ConstraintProvider#isSupported(org.kuali.rice.krad.datadictionary.validation.capability.Constrainable)
*/
@Override
public boolean isSupported(Constrainable definition) {
if (definition instanceof ComplexAttributeDefinition) {
return true;
}
return false;
}
示例6: isSupported
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.datadictionary.validation.constraint.provider.ConstraintProvider#isSupported(org.kuali.rice.krad.datadictionary.validation.capability.Constrainable)
*/
@Override
public boolean isSupported(Constrainable definition) {
if (definition instanceof CollectionDefinition) {
return true;
}
return false;
}
示例7: isSupported
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.datadictionary.validation.constraint.provider.ConstraintProvider#isSupported(org.kuali.rice.krad.datadictionary.validation.capability.Constrainable)
*/
@Override
public boolean isSupported(Constrainable definition) {
if (definition instanceof DataObjectEntry) {
return true;
}
return false;
}
示例8: isSupported
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.datadictionary.validation.constraint.provider.ConstraintProvider#isSupported(org.kuali.rice.krad.datadictionary.validation.capability.Constrainable)
*/
@Override
public boolean isSupported(Constrainable definition) {
if (definition instanceof AttributeDefinition
|| definition instanceof InputField
|| definition instanceof ViewAttributeValueReader.InputFieldConstrainableInfo) {
return true;
}
return false;
}
示例9: getDefinition
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* Gets the definition which is an InputField on the View/Page
*/
@Override
public Constrainable getDefinition(String attributeName) {
InputFieldConstrainableInfo field = inputFieldMap.get(attributeName);
if (field != null) {
return field;
} else {
return null;
}
}
示例10: getDefinitions
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
@Override
public List<Constrainable> getDefinitions() {
if (entry instanceof DataDictionaryEntryBase) {
DataDictionaryEntryBase entryBase = (DataDictionaryEntryBase) entry;
List<Constrainable> definitions = new ArrayList<Constrainable>();
List<AttributeDefinition> attributeDefinitions = entryBase.getAttributes();
definitions.addAll(attributeDefinitions);
return definitions;
}
return null;
}
示例11: getEntry
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
@Override
public Constrainable getEntry() {
if (entry instanceof Constrainable) {
return (Constrainable) entry;
}
return null;
}
示例12: processSingleValidCharacterConstraint
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
protected ConstraintValidationResult processSingleValidCharacterConstraint(DictionaryValidationResult result,
Object value, ValidCharactersConstraint constraint,
AttributeValueReader attributeValueReader) throws AttributeValidationException {
if (constraint == null) {
return result.addNoConstraint(attributeValueReader, CONSTRAINT_NAME);
}
if (ValidationUtils.isNullOrEmpty(value)) {
return result.addSkipped(attributeValueReader, CONSTRAINT_NAME);
}
// This mix-in interface is here to allow some definitions to avoid the extra processing that goes on in KNS
// to decipher and validate things like date range strings -- something that looks like "02/02/2002..03/03/2003"
Constrainable definition = attributeValueReader.getDefinition(attributeValueReader.getAttributeName());
if (definition instanceof Formatable) {
return doProcessFormattableValidCharConstraint(result, constraint, (Formatable) definition, value,
attributeValueReader);
}
ConstraintValidationResult constraintValidationResult = doProcessValidCharConstraint(constraint, value);
if (constraintValidationResult == null) {
return result.addSuccess(attributeValueReader, CONSTRAINT_NAME);
}
result.addConstraintValidationResult(attributeValueReader, constraintValidationResult);
constraintValidationResult.setConstraintLabelKey(constraint.getMessageKey());
constraintValidationResult.setErrorParameters(constraint.getValidationMessageParamsArray());
return constraintValidationResult;
}
示例13: isSupported
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.datadictionary.validation.constraint.provider.ConstraintProvider#isSupported(org.kuali.rice.krad.datadictionary.validation.capability.Constrainable)
*/
@Override
public boolean isSupported(Constrainable definition) {
if (definition instanceof AttributeDefinition || definition instanceof InputField) {
return true;
}
return false;
}
示例14: getDefinition
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
/**
* Gets the definition which is an InputField on the View/Page
*/
@Override
public Constrainable getDefinition(String attributeName) {
InputField field = inputFieldMap.get(attributeName);
if (field != null) {
return field;
} else {
return null;
}
}
示例15: getDefinition
import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable; //导入依赖的package包/类
@Override
public Constrainable getDefinition(String attributeName) {
// Only return the definition if you have it, and if it's the definition for the passed attribute name
return definition != null && definition.getName() != null && definition.getName().equals(attributeName) ?
definition : null;
}