path = locationFactory.parseRelPath(value);
return createValue(path);
}
catch (RepositoryException e)
{
throw new ValueFormatException("Path '" + value + "' is invalid");
}
case PropertyType.NAME :
try
{
JCRName name = locationFactory.parseJCRName(value);
return createValue(name);
}
catch (RepositoryException e)
{
throw new ValueFormatException("Name '" + value + "' is invalid", e);
}
case PropertyType.REFERENCE :
return createValue(new Identifier(value));
case ExtendedPropertyType.PERMISSION :
try
{
return PermissionValue.parseValue(value);
}
catch (IOException e)
{
new ValueFormatException("Cant create PermissionValue " + e);
}
default :
throw new ValueFormatException("unknown type " + type);
}
}
catch (IllegalArgumentException e)
{ // NumberFormatException
throw new ValueFormatException("Cant create value from string '" + value + "' for type "
+ PropertyType.nameFromValue(type));
}
}