本文整理汇总了Java中org.kuali.rice.krad.datadictionary.AttributeDefinition.isRequired方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeDefinition.isRequired方法的具体用法?Java AttributeDefinition.isRequired怎么用?Java AttributeDefinition.isRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.datadictionary.AttributeDefinition
的用法示例。
在下文中一共展示了AttributeDefinition.isRequired方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isAttributeRequired
import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.service.DataDictionaryService#isAttributeRequired(java.lang.Class, java.lang.String)
*/
@Override
public Boolean isAttributeRequired(String entryName, String attributeName) {
Boolean required = null;
AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
if (attributeDefinition != null) {
required = attributeDefinition.isRequired();
}
return required;
}
示例2: isAttributeRequired
import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.service.DataDictionaryService#isAttributeRequired(java.lang.Class, java.lang.String)
*/
@Override
public Boolean isAttributeRequired(String entryName, String attributeName) {
Boolean required = null;
AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
if (attributeDefinition != null) {
required = attributeDefinition.isRequired();
}
return required;
}
示例3: buildRemotableFieldFromAttributeDefinition
import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Override
public RemotableAttributeField buildRemotableFieldFromAttributeDefinition(String componentClassName,
String attributeName) {
AttributeDefinition baseDefinition;
Class<?> componentClass;
// try to resolve the component name - if not possible - try to pull the definition from the app mediation service
try {
componentClass = Class.forName(componentClassName);
baseDefinition = getDataDictionaryService().getDataDictionary().getDictionaryObjectEntry(componentClassName)
.getAttributeDefinition(attributeName);
} catch (ClassNotFoundException ex) {
throw new RiceRuntimeException("Unable to find attribute definition for attribute : " + attributeName);
}
RemotableAttributeField.Builder definition = RemotableAttributeField.Builder.create(baseDefinition.getName());
definition.setLongLabel(baseDefinition.getLabel());
definition.setShortLabel(baseDefinition.getShortLabel());
definition.setMaxLength(baseDefinition.getMaxLength());
if (baseDefinition.isRequired() != null) {
definition.setRequired(baseDefinition.isRequired().booleanValue());
}
definition.setForceUpperCase(baseDefinition.getForceUppercase().booleanValue());
//set the datatype - needed for successful custom doc searches
String dataType = DataTypeUtil.determineFieldDataType((Class<? extends BusinessObject>) componentClass,
attributeName);
definition.setDataType(DataType.valueOf(dataType.toUpperCase()));
RemotableAbstractControl.Builder control = createControl(baseDefinition);
if (control != null) {
definition.setControl(control);
}
RemotableQuickFinder.Builder qf = createQuickFinder(componentClass, attributeName);
if (qf != null) {
definition.setWidgets(Collections.<RemotableAbstractWidget.Builder>singletonList(qf));
}
return definition.build();
}
示例4: getDataDictionaryAttributeDefinition
import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
* @param namespaceCode
* @param typeAttribute
* @return an AttributeDefinition for the given KimTypeAttribute, or null no base AttributeDefinition
* matches the typeAttribute parameter's attributeName.
*/
protected KimAttributeField getDataDictionaryAttributeDefinition( String namespaceCode, String kimTypeId, KimTypeAttribute typeAttribute, List<String> uniqueAttributes) {
final String componentClassName = typeAttribute.getKimAttribute().getComponentName();
final String attributeName = typeAttribute.getKimAttribute().getAttributeName();
final Class<? extends BusinessObject> componentClass;
final AttributeDefinition baseDefinition;
// try to resolve the component name - if not possible - try to pull the definition from the app mediation service
try {
if (StringUtils.isNotBlank(componentClassName)) {
componentClass = (Class<? extends BusinessObject>) Class.forName(componentClassName);
AttributeDefinition baseDefinitionTemp =
getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(componentClassName)
.getAttributeDefinition(attributeName);
if (baseDefinitionTemp == null) {
baseDefinition = getDataDictionaryService().getDataDictionary().getDataObjectEntry(
componentClassName).getAttributeDefinition(attributeName);
} else {
baseDefinition = baseDefinitionTemp;
}
} else {
baseDefinition = null;
componentClass = null;
}
} catch (ClassNotFoundException ex) {
throw new KimTypeAttributeException(ex);
}
if (baseDefinition == null) {
return null;
}
final RemotableAttributeField.Builder definition = RemotableAttributeField.Builder.create(baseDefinition.getName());
definition.setLongLabel(baseDefinition.getLabel());
definition.setShortLabel(baseDefinition.getShortLabel());
definition.setMaxLength(baseDefinition.getMaxLength());
if (baseDefinition.isRequired() != null) {
definition.setRequired(baseDefinition.isRequired());
} else {
definition.setRequired(false);
}
if (baseDefinition.getForceUppercase() != null) {
definition.setForceUpperCase(baseDefinition.getForceUppercase());
}
definition.setControl(DataDictionaryTypeServiceHelper.toRemotableAbstractControlBuilder(
baseDefinition));
final RemotableQuickFinder.Builder qf = createQuickFinder(componentClass, attributeName);
if (qf != null) {
definition.setWidgets(Collections.<RemotableAbstractWidget.Builder>singletonList(qf));
}
final KimAttributeField.Builder kimField = KimAttributeField.Builder.create(definition, typeAttribute.getKimAttribute().getId());
if(uniqueAttributes!=null && uniqueAttributes.contains(definition.getName())){
kimField.setUnique(true);
}
return kimField.build();
}
示例5: buildAttributeMap
import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
public ExportMap buildAttributeMap(AttributeDefinition attribute, String fullClassName) {
ExportMap attributeMap = new ExportMap(attribute.getName());
// simple properties
attributeMap.set("name", attribute.getName());
attributeMap.set("forceUppercase", attribute.getForceUppercase().toString());
attributeMap.set("label", attribute.getLabel());
attributeMap.set("shortLabel", attribute.getShortLabel());
//KULRICE-9144 remove maxLength non null assumption
Integer maxLength = attribute.getMaxLength();
if (maxLength != null) {
attributeMap.set("maxLength", maxLength.toString());
}
String exclusiveMin = attribute.getExclusiveMin();
if (exclusiveMin != null) {
attributeMap.set("exclusiveMin", exclusiveMin/*.toString()*/);
}
String exclusiveMax = attribute.getInclusiveMax();
if (exclusiveMax != null) {
attributeMap.set("exclusiveMax", exclusiveMax/*.toString()*/);
}
if (attribute.isRequired() != null) {
attributeMap.set("required", attribute.isRequired().toString());
} else {
attributeMap.set("required", "false");
}
if (attribute.getSummary() != null) {
attributeMap.set("summary", attribute.getSummary());
}
if (attribute.getDescription() != null) {
attributeMap.set("description", attribute.getDescription());
}
if (attribute.hasFormatterClass()) {
attributeMap.set("formatterClass", attribute.getFormatterClass());
}
/**
// complex properties
if (attribute.hasValidationPattern()) {
attributeMap.set(attribute.getValidationPattern().buildExportMap("validationPattern"));
}
if(attribute.hasAttributeSecurity()){
attributeMap.set("attributeSecurityMask", String.valueOf(attribute.getAttributeSecurity().isMask()));
attributeMap.set("attributeSecurityPartialMask", String.valueOf(attribute.getAttributeSecurity().isPartialMask()));
attributeMap.set("attributeSecurityHide", String.valueOf(attribute.getAttributeSecurity().isHide()));
attributeMap.set("attributeSecurityReadOnly", String.valueOf(attribute.getAttributeSecurity().isReadOnly()));
// TODO: consider whether to export class names from the attribute security
}
*/
attributeMap.set(buildControlMap(attribute));
if (attribute.getOptionsFinder() != null) {
attributeMap.set(buildKeyLabelMap(attribute));
}
if (StringUtils.isNotBlank(fullClassName)) {
attributeMap.set("fullClassName", fullClassName);
}
return attributeMap;
}