@Nonnull public static PropertyValue newDate(@Nonnull String value) { return new PropertyStateValue(GenericPropertyState.dateProperty("", value)); }
@Nonnull public static PropertyValue newReference(@Nonnull String value) { return new PropertyStateValue(GenericPropertyState.referenceProperty("", value)); }
@NotNull public static PropertyValue newWeakReference(@NotNull String value) { return new PropertyStateValue(GenericPropertyState.weakreferenceProperty("", value)); }
return type.isArray() ? MultiGenericPropertyState.dateProperty(name, (Iterable<String>) value) : GenericPropertyState.dateProperty(name, (String) value); case PropertyType.BOOLEAN: return type.isArray() return type.isArray() ? MultiGenericPropertyState.nameProperty(name, (Iterable<String>) value) : GenericPropertyState.nameProperty(name, (String) value); case PropertyType.PATH: return type.isArray() ? MultiGenericPropertyState.pathProperty(name, (Iterable<String>) value) : GenericPropertyState.pathProperty(name, (String) value); case PropertyType.REFERENCE: return type.isArray() ? MultiGenericPropertyState.referenceProperty(name, (Iterable<String>) value) : GenericPropertyState.referenceProperty(name, (String) value); case PropertyType.WEAKREFERENCE: return type.isArray() ? MultiGenericPropertyState.weakreferenceProperty(name, (Iterable<String>) value) : GenericPropertyState.weakreferenceProperty(name, (String) value); case PropertyType.URI: return type.isArray() ? MultiGenericPropertyState.uriProperty(name, (Iterable<String>) value) : GenericPropertyState.uriProperty(name, (String) value); case PropertyType.DECIMAL: return type.isArray()
@Override @SuppressWarnings("deprecation") public Value createValue(Node value, boolean weak) throws RepositoryException { if (!value.isNodeType(NodeType.MIX_REFERENCEABLE)) { throw new ValueFormatException( "Node is not referenceable: " + value.getPath()); } return weak ? newValue(GenericPropertyState.weakreferenceProperty("", value.getUUID()), namePathMapper) : newValue(GenericPropertyState.referenceProperty("", value.getUUID()), namePathMapper); }
/** * Create a {@code PropertyState} from a path. No validation is performed * on the string passed for {@code value}. * @param name The name of the property state * @param value The value of the property state * @return The new property state of type {@link Type#PATH} */ public static PropertyState pathProperty(String name, String value) { return new GenericPropertyState(name, value, PATH); }
@NotNull public static PropertyValue newUri(@NotNull String value) { return new PropertyStateValue(GenericPropertyState.uriProperty("", value)); }
@NotNull public static PropertyValue newName(@NotNull String value) { return new PropertyStateValue(GenericPropertyState.nameProperty("", value)); }
@NotNull public static PropertyValue newPath(@NotNull String value) { return new PropertyStateValue(GenericPropertyState.pathProperty("", value)); }
return type.isArray() ? MultiGenericPropertyState.dateProperty(name, (Iterable<String>) value) : GenericPropertyState.dateProperty(name, (String) value); case PropertyType.BOOLEAN: return type.isArray() return type.isArray() ? MultiGenericPropertyState.nameProperty(name, (Iterable<String>) value) : GenericPropertyState.nameProperty(name, (String) value); case PropertyType.PATH: return type.isArray() ? MultiGenericPropertyState.pathProperty(name, (Iterable<String>) value) : GenericPropertyState.pathProperty(name, (String) value); case PropertyType.REFERENCE: return type.isArray() ? MultiGenericPropertyState.referenceProperty(name, (Iterable<String>) value) : GenericPropertyState.referenceProperty(name, (String) value); case PropertyType.WEAKREFERENCE: return type.isArray() ? MultiGenericPropertyState.weakreferenceProperty(name, (Iterable<String>) value) : GenericPropertyState.weakreferenceProperty(name, (String) value); case PropertyType.URI: return type.isArray() ? MultiGenericPropertyState.uriProperty(name, (Iterable<String>) value) : GenericPropertyState.uriProperty(name, (String) value); case PropertyType.DECIMAL: return type.isArray()
@NotNull public Value createValue(@NotNull Node value, boolean weak) throws RepositoryException { if (!value.isNodeType(NodeType.MIX_REFERENCEABLE)) { throw new ValueFormatException( "Node is not referenceable: " + value.getPath()); } return weak ? newValue(GenericPropertyState.weakreferenceProperty("", value.getUUID()), namePathMapper, getBlobAccessProvider()) : newValue(GenericPropertyState.referenceProperty("", value.getUUID()), namePathMapper, getBlobAccessProvider()); }
/** * Create a {@code PropertyState} from a reference. No validation is performed * on the string passed for {@code value}. * @param name The name of the property state * @param value The value of the property state * @return The new property state of type {@link Type#REFERENCE} */ public static PropertyState referenceProperty(String name, String value) { return new GenericPropertyState(name, value, REFERENCE); }
@Nonnull public static PropertyValue newUri(@Nonnull String value) { return new PropertyStateValue(GenericPropertyState.uriProperty("", value)); }
@Nonnull public static PropertyValue newName(@Nonnull String value) { return new PropertyStateValue(GenericPropertyState.nameProperty("", value)); }
@Nonnull public static PropertyValue newPath(@Nonnull String value) { return new PropertyStateValue(GenericPropertyState.pathProperty("", value)); }
throw new ValueFormatException("Invalid date " + value); return newValue(GenericPropertyState.dateProperty("", value), namePathMapper); case PropertyType.BOOLEAN: return createValue(Conversions.convert(value).toBoolean()); throw new ValueFormatException("Invalid name: " + value); return newValue(GenericPropertyState.nameProperty("", oakName), namePathMapper); case PropertyType.PATH: String oakValue = value; return newValue(GenericPropertyState.pathProperty("", oakValue), namePathMapper); case PropertyType.REFERENCE: if (!UUIDUtils.isValidUUID(value)) { throw new ValueFormatException("Invalid reference value " + value); return newValue(GenericPropertyState.referenceProperty("", value), namePathMapper); case PropertyType.WEAKREFERENCE: if (!UUIDUtils.isValidUUID(value)) { throw new ValueFormatException("Invalid weak reference value " + value); return newValue(GenericPropertyState.weakreferenceProperty("", value), namePathMapper); case PropertyType.URI: new URI(value); return newValue(GenericPropertyState.uriProperty("", value), namePathMapper); case PropertyType.DECIMAL: return createValue(Conversions.convert(value).toDecimal());
p = GenericPropertyState.weakreferenceProperty(prop.getName(), ids.get(0)); } else { p = GenericPropertyState.referenceProperty(prop.getName(), ids.get(0));
/** * Create a {@code PropertyState} from a date. No validation is performed * on the string passed for {@code value}. * * @param name The name of the property state * @param value The value of the property state * @return The new property state of type {@link Type#DATE} */ public static PropertyState dateProperty(String name, String value) { return new GenericPropertyState(name, value, DATE); }
@NotNull public static PropertyValue newDate(@NotNull String value) { return new PropertyStateValue(GenericPropertyState.dateProperty("", value)); }
@NotNull public static PropertyValue newReference(@NotNull String value) { return new PropertyStateValue(GenericPropertyState.referenceProperty("", value)); }