in src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/SimpleFieldsHelper.java [410:443]
private PropertyDefinition getPropertyDefinition(Node node, String propertyName) throws RepositoryException {
// try to find the definition in the primary node type
NodeType nt = node.getPrimaryNodeType();
PropertyDefinition propDef = getPropertyDefinition(nt, propertyName);
// return the definition if it is not residual
if (propDef != null && propDef.getName() != null)
{
return propDef;
}
// otherwise look it up in any of the mixin node types
NodeType[] mixins = node.getMixinNodeTypes();
for (int i = 0; mixins != null && i < mixins.length; i++)
{
PropertyDefinition candidate = getPropertyDefinition(mixins[i], propertyName);
// use this property definition if not residual
if (candidate != null && candidate.getName() != null)
{
return propDef;
}
// otherwise use this if we do not have a candidate yet
if (propDef == null)
{
propDef = candidate;
}
}
// nothing found
return propDef;
}