當前位置: 首頁>>代碼示例>>Java>>正文


Java Constrainable類代碼示例

本文整理匯總了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);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:23,代碼來源:DictionaryValidationServiceImpl.java

示例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);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:24,代碼來源:DictionaryValidationServiceImpl.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:SingleAttributeValueReader.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:11,代碼來源:SingleAttributeValueReader.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:ComplexAttributeDefinitionConstraintProvider.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:CollectionDefinitionConstraintProvider.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:DataObjectEntryConstraintProvider.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:AttributeDefinitionConstraintProvider.java

示例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;
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:ViewAttributeValueReader.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:DictionaryObjectAttributeValueReader.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:DictionaryObjectAttributeValueReader.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:31,代碼來源:ValidCharactersConstraintProcessor.java

示例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;
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:13,代碼來源:AttributeDefinitionConstraintProvider.java

示例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;
    }
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:13,代碼來源:ViewAttributeValueReader.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:7,代碼來源:SingleAttributeValueReader.java


注:本文中的org.kuali.rice.krad.datadictionary.validation.capability.Constrainable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。