本文整理汇总了Java中org.alfresco.service.cmr.dictionary.ClassDefinition.getParentClassDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDefinition.getParentClassDefinition方法的具体用法?Java ClassDefinition.getParentClassDefinition怎么用?Java ClassDefinition.getParentClassDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.dictionary.ClassDefinition
的用法示例。
在下文中一共展示了ClassDefinition.getParentClassDefinition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToCustomModelProperty
import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
private List<CustomModelProperty> convertToCustomModelProperty(ClassDefinition classDefinition, boolean includeInherited)
{
Collection<PropertyDefinition> ownProperties = null;
ClassDefinition parentDef = classDefinition.getParentClassDefinition();
if (!includeInherited && parentDef != null)
{
// Remove inherited properties
ownProperties = removeRightEntries(classDefinition.getProperties(), parentDef.getProperties()).values();
}
else
{
ownProperties = classDefinition.getProperties().values();
}
List<CustomModelProperty> customProperties = new ArrayList<>(ownProperties.size());
for (PropertyDefinition propDef : ownProperties)
{
customProperties.add(new CustomModelProperty(propDef, dictionaryService));
}
return customProperties;
}
示例2: getTypesToExclude
import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
/**
* @param taskType type of the task
* @return all types (and aspects) which properties should not be used for form-model elements
*/
protected Set<QName> getTypesToExclude(TypeDefinition taskType)
{
HashSet<QName> typesToExclude = new HashSet<QName>();
ClassDefinition parentClassDefinition = taskType.getParentClassDefinition();
boolean contentClassFound = false;
while(parentClassDefinition != null)
{
if(contentClassFound)
{
typesToExclude.add(parentClassDefinition.getName());
}
else if(ContentModel.TYPE_CONTENT.equals(parentClassDefinition.getName()))
{
// All parents of "cm:content" should be ignored as well for fetching start-properties
typesToExclude.add(ContentModel.TYPE_CONTENT);
typesToExclude.addAll(parentClassDefinition.getDefaultAspectNames());
contentClassFound = true;
}
parentClassDefinition = parentClassDefinition.getParentClassDefinition();
}
return typesToExclude;
}
示例3: Property
import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
/**
* Construct
*
* @param qname property name
* @param value property values
*/
@SuppressWarnings("unchecked")
public Property(QName qname, Serializable value, NodeRef nodeRef)
{
this.name = new QNameBean(qname);
residual = true;
PropertyDefinition propDef = getDictionaryService().getProperty(qname);
if (propDef != null)
{
QName qn = propDef.getDataType().getName();
typeName = qn != null ? new QNameBean(propDef.getDataType().getName()) : null;
// ALF-21950 We need to check if the property belongs to the type of the node or to their ancestors
if(propDef.getContainerClass().isAspect())
{
residual = false;
}
else
{
ClassDefinition classDef = getDictionaryService().getClass(getNodeService().getType(nodeRef));
boolean found = false;
while(classDef != null)
{
found = searchInClassDefinition(qname, classDef);
if(found)
{
break;
}
classDef = classDef.getParentClassDefinition();
}
residual = !found;
}
}
// handle multi/single values
final List<Value> values;
if (value instanceof Collection)
{
Collection<Serializable> oldValues = (Collection<Serializable>) value;
values = new ArrayList<Value>(oldValues.size());
isCollection = true;
for (Serializable multiValue : oldValues)
{
values.add(new Value(multiValue instanceof QName ? new QNameBean((QName) multiValue) : multiValue));
}
}
else
{
values = Collections.singletonList(new Value(value instanceof QName ? new QNameBean((QName) value) : value));
}
this.values = values;
}