private PropertyDefinition getPropertyDefinition()

in src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/SimpleFieldsHelper.java [359:385]


	private PropertyDefinition getPropertyDefinition(NodeType nodeType, String propertyName) {
        PropertyDefinition[] pd = nodeType.getPropertyDefinitions();
        PropertyDefinition candidate = null;
        for (int i=0; i < pd.length; i++)
        {
            // ignore multi-value properties
            if (pd[i].isMultiple())
            {
                continue;
            }

            // if we have an exact match, use this and return
            if (propertyName.equals(pd[i].getName()))
            {
                return pd[i];
            }

            // if we have a residual property definition consider as candidate
            if (pd[i].getName() == null && candidate == null)
            {
                candidate = pd[i];
            }
        }

        // return the potential residal candidate definition
        return candidate;
	}