Package org.modeshape.jcr.value

Examples of org.modeshape.jcr.value.PropertyType


                }
            } else {
                throw e;
            }
        }
        PropertyType type = PropertyType.valueFor(typeString);

        Pattern pattern = VALUE_PATTERN;
        ValueFactory<?> valueFactory = factories.getValueFactory(type);
        boolean binary = false;
        boolean decode = false;
View Full Code Here


    public static <T> ManagedLocalIndexBuilder<T> create( ExecutionContext context,
                                                          IndexDefinition defn,
                                                          Supplier nodeTypesSupplier,
                                                          NodeTypePredicate matcher ) {
        if (defn.hasSingleColumn()) {
            PropertyType actualPropertyType = determineActualPropertyType(defn.getColumnDefinition(0));
            return new SingleColumnIndexBuilder<T>(context, defn, nodeTypesSupplier, matcher, actualPropertyType);
        }
        throw new LocalIndexException("The local provider does not support multi-column indexes");
    }
View Full Code Here

        }
        throw new LocalIndexException("The local provider does not support multi-column indexes");
    }

    protected static PropertyType determineActualPropertyType( IndexColumnDefinition columnDefn ) {
        PropertyType type = PropertyType.valueFor(columnDefn.getColumnType());
        switch (type) {
            case BOOLEAN:
            case DATE:
            case DECIMAL:
            case DOUBLE:
View Full Code Here

        }
    }

    @SuppressWarnings( "unchecked" )
    protected <T> LocalUniqueIndex<T> uniqueValueIndex( Class<T> valueType ) {
        PropertyType type = PropertyType.discoverType(valueType);
        ValueFactory<T> valueFactory = (ValueFactory<T>)context.getValueFactories().getValueFactory(type);
        Converter<T> converter = IndexValues.converter(valueFactory);
        Serializer<T> serializer = (Serializer<T>)serializers.serializerFor(type.getValueClass());
        BTreeKeySerializer<T> keySerializer = (BTreeKeySerializer<T>)serializers.bTreeKeySerializerFor(type.getValueClass(),
                                                                                                       type.getComparator(),
                                                                                                       false);
        return new LocalUniqueIndex<T>("myIndex", "myWorkspace", db, converter, keySerializer, serializer);
    }
View Full Code Here

        return new LocalUniqueIndex<T>("myIndex", "myWorkspace", db, converter, keySerializer, serializer);
    }

    @SuppressWarnings( "unchecked" )
    protected <T> LocalDuplicateIndex<T> duplicateValueIndex( Class<T> valueType ) {
        PropertyType type = PropertyType.discoverType(valueType);
        Comparator<T> comparator = (Comparator<T>)type.getComparator();
        ValueFactory<T> valueFactory = (ValueFactory<T>)context.getValueFactories().getValueFactory(type);
        Converter<T> converter = IndexValues.converter(valueFactory);
        Serializer<T> serializer = (Serializer<T>)serializers.serializerFor(type.getValueClass());
        return new LocalDuplicateIndex<T>("myIndex", "myWorkspace", db, converter, serializer, comparator);
    }
View Full Code Here

        if (staticOperand instanceof LiteralValue) {
            LiteralValue literal = (LiteralValue)staticOperand;
            Value value = literal.getLiteralValue();
            if (value != null) {
                // Use the proper type factory to ensure the value is the correct type ...
                PropertyType propType = PropertyTypeUtil.modePropertyTypeFor(value.getType());
                try {
                    literalValue = context.getExecutionContext().getValueFactories().getValueFactory(propType)
                                          .create(value.getString());
                } catch (RepositoryException e) {
                    // Really shouldn't happen, but just in case ...
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.value.PropertyType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.