code: public PropertyDefinition getDefinition() throws RepositoryException
     {
        checkValid();
  
        if (propertyDef == null)
        {
           throw new RepositoryException("FATAL: property definition is NULL " + getPath() + " "
              + propertyData.getValues());
        }
  
        Value[] defaultValues = new Value[propertyDef.getDefaultValues().length];
        String[] propVal = propertyDef.getDefaultValues();
        // there can be null in definition but should not be null value
        if (propVal != null)
        {
           for (int i = 0; i < propVal.length; i++)
           {
              if (propertyDef.getRequiredType() == PropertyType.UNDEFINED)
                 defaultValues[i] = valueFactory.createValue(propVal[i]);
              else
                 defaultValues[i] = valueFactory.createValue(propVal[i], propertyDef.getRequiredType());
           }
        }
  
        return new PropertyDefinitionImpl(propertyDef, session.getWorkspace().getNodeTypesHolder(),
           (ExtendedNodeTypeManager)session.getWorkspace().getNodeTypeManager(), session.getSystemLocationFactory(),
           session.getValueFactory(), session.getTransientNodesManager());
     }
docs: {@inheritDoc}