private final int determineBestPropertyTypeIfUndefined( int actualPropertyType, Property property ) { if (actualPropertyType == PropertyType.UNDEFINED) { return PropertyTypeUtil.jcrPropertyTypeFor(property); } return actualPropertyType; }
first = false; org.modeshape.jcr.value.PropertyType requiredType = PropertyTypeUtil.modePropertyTypeFor(defn.getRequiredType()); switch (defn.getRequiredType()) { case PropertyType.REFERENCE: Object minimum = defn.getMinimumValue(); Object maximum = defn.getMaximumValue(); org.modeshape.jcr.value.PropertyType requiredType = PropertyTypeUtil.modePropertyTypeFor(defn.getRequiredType()); builder.addColumn(tableName, columnName, type, requiredType, fullTextSearchable, orderable, minimum, maximum, operators);
first = false; org.modeshape.jcr.value.PropertyType requiredType = PropertyTypeUtil.modePropertyTypeFor(defn.getRequiredType()); switch (defn.getRequiredType()) { case PropertyType.REFERENCE: Object minimum = defn.getMinimumValue(); Object maximum = defn.getMaximumValue(); org.modeshape.jcr.value.PropertyType requiredType = PropertyTypeUtil.modePropertyTypeFor(defn.getRequiredType()); builder.addColumn(tableName, columnName, type, requiredType, fullTextSearchable, orderable, minimum, maximum, operators);
private final int determineBestPropertyTypeIfUndefined( int actualPropertyType, Property property ) { if (actualPropertyType == PropertyType.UNDEFINED) { return PropertyTypeUtil.jcrPropertyTypeFor(property); } return actualPropertyType; }
if (value != null) { PropertyType propType = PropertyTypeUtil.modePropertyTypeFor(value.getType()); try { literalValue = context.getExecutionContext().getValueFactories().getValueFactory(propType)
/** * Compute the JCR {@link PropertyType} for the given ModeShape {@link org.modeshape.jcr.value.PropertyType}. * <p> * See MODE-328 for complete discussion on why this method works the way it does. The best option appears to be basing the * PropertyType on the first value, since that should be compatible with the PropertyType that was used when the values were * set on the property in the first place. * </p> * * @param property the ModeShape property for which the {@link PropertyType} is to be determined; never null * @return the JCR property type; always a valid value and never {@link PropertyType#UNDEFINED}. */ public static final int jcrPropertyTypeFor( org.modeshape.jcr.value.Property property ) { for (Object value : property) { if (value != null) { return jcrPropertyTypeFor(org.modeshape.jcr.value.PropertyType.discoverType(value)); } } return PropertyType.STRING; }
if (value != null) { PropertyType propType = PropertyTypeUtil.modePropertyTypeFor(value.getType()); try { literalValue = context.getExecutionContext().getValueFactories().getValueFactory(propType)
/** * Compute the JCR {@link PropertyType} for the given ModeShape {@link org.modeshape.jcr.value.PropertyType}. * <p> * See MODE-328 for complete discussion on why this method works the way it does. The best option appears to be basing the * PropertyType on the first value, since that should be compatible with the PropertyType that was used when the values were * set on the property in the first place. * </p> * * @param property the ModeShape property for which the {@link PropertyType} is to be determined; never null * @return the JCR property type; always a valid value and never {@link PropertyType#UNDEFINED}. */ public static final int jcrPropertyTypeFor( org.modeshape.jcr.value.Property property ) { for (Object value : property) { if (value != null) { return jcrPropertyTypeFor(org.modeshape.jcr.value.PropertyType.discoverType(value)); } } return PropertyType.STRING; }
org.modeshape.jcr.value.PropertyType msType = PropertyTypeUtil.modePropertyTypeFor(propertyType); org.modeshape.jcr.value.ValueFactory<?> factory = context().getValueFactories().getValueFactory(msType); for (int i = 0; i != numValues; ++i) {
protected final int propertyType( Object value ) { org.modeshape.jcr.value.PropertyType type = org.modeshape.jcr.value.PropertyType.valueFor(strings.create(value) .toLowerCase()); return PropertyTypeUtil.jcrPropertyTypeFor(type); }
org.modeshape.jcr.value.PropertyType msType = PropertyTypeUtil.modePropertyTypeFor(propertyType); org.modeshape.jcr.value.ValueFactory<?> factory = context().getValueFactories().getValueFactory(msType); for (int i = 0; i != numValues; ++i) {
protected final int propertyType( Object value ) { org.modeshape.jcr.value.PropertyType type = org.modeshape.jcr.value.PropertyType.valueFor(strings.create(value) .toLowerCase()); return PropertyTypeUtil.jcrPropertyTypeFor(type); }
protected int jcrPropertyType( String typeName ) { org.modeshape.jcr.value.PropertyType type = org.modeshape.jcr.value.PropertyType.valueFor(typeName.toLowerCase()); return PropertyTypeUtil.jcrPropertyTypeFor(type); }
/** * Parse the property type, if a valid one appears next on the token stream. * * @param tokens the tokens containing the definition; never null * @param propDefn the property definition; never null * @param defaultPropertyType the default property type if none is actually found * @throws ParsingException if there is a problem parsing the content */ protected void parsePropertyType( TokenStream tokens, JcrPropertyDefinitionTemplate propDefn, String defaultPropertyType ) { if (tokens.canConsume('(')) { // Parse the (optional) property type ... String propertyType = defaultPropertyType; if (tokens.matchesAnyOf(VALID_PROPERTY_TYPES)) { propertyType = tokens.consume(); if ("*".equals(propertyType)) propertyType = "UNDEFINED"; } tokens.consume(')'); PropertyType type = PropertyType.valueFor(propertyType.toLowerCase()); int jcrType = PropertyTypeUtil.jcrPropertyTypeFor(type); propDefn.setRequiredType(jcrType); } }
/** * Parse the property type, if a valid one appears next on the token stream. * * @param tokens the tokens containing the definition; never null * @param propDefn the property definition; never null * @param defaultPropertyType the default property type if none is actually found * @throws ParsingException if there is a problem parsing the content */ protected void parsePropertyType( TokenStream tokens, JcrPropertyDefinitionTemplate propDefn, String defaultPropertyType ) { if (tokens.canConsume('(')) { // Parse the (optional) property type ... String propertyType = defaultPropertyType; if (tokens.matchesAnyOf(VALID_PROPERTY_TYPES)) { propertyType = tokens.consume(); if ("*".equals(propertyType)) propertyType = "UNDEFINED"; } tokens.consume(')'); PropertyType type = PropertyType.valueFor(propertyType.toLowerCase()); int jcrType = PropertyTypeUtil.jcrPropertyTypeFor(type); propDefn.setRequiredType(jcrType); } }
NodeTypes nodeTypes ) { JcrPropertyDefinition definition = null; int propertyType = PropertyTypeUtil.jcrPropertyTypeFor(property);
NodeTypes nodeTypes ) { JcrPropertyDefinition definition = null; int propertyType = PropertyTypeUtil.jcrPropertyTypeFor(property);
for (Object value : defaultValues) { org.modeshape.jcr.value.PropertyType modeType = org.modeshape.jcr.value.PropertyType.discoverType(value); int jcrType = PropertyTypeUtil.jcrPropertyTypeFor(modeType); String strValue = strings.create(value); try {
for (Object value : defaultValues) { org.modeshape.jcr.value.PropertyType modeType = org.modeshape.jcr.value.PropertyType.discoverType(value); int jcrType = PropertyTypeUtil.jcrPropertyTypeFor(modeType); String strValue = strings.create(value); try {