Package org.modeshape.jcr.value

Examples of org.modeshape.jcr.value.PropertyType


        }

        @Override
        public ValueFactory<?> getValueFactory( Object prototype ) {
            CheckArg.isNotNull(prototype, "prototype");
            PropertyType inferredType = PropertyType.discoverType(prototype);
            assert inferredType != null;
            return getValueFactory(inferredType);
        }
View Full Code Here


                return propertyTypeIter.hasNext();
            }

            @Override
            public ValueFactory<?> next() {
                PropertyType nextType = propertyTypeIter.next();
                return getValueFactory(nextType);
            }
View Full Code Here

            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);
        }
    }
View Full Code Here

    }

    public IndexColumnDefinition readIndexColumnDefinition( CachedNode indexColumnDefn ) {
        String propertyName = strings.create(names.create(first(indexColumnDefn, ModeShapeLexicon.PROPERTY_NAME)));
        String columnTypeName = strings.create(first(indexColumnDefn, ModeShapeLexicon.COLUMN_TYPE_NAME));
        PropertyType columnType = PropertyType.valueFor(columnTypeName);
        return new RepositoryIndexColumnDefinition(propertyName, columnType.jcrType());
    }
View Full Code Here

                                     Object valueOrValues ) {
        Name propName = names.create(name);
        Property prop = null;
        if (valueOrValues instanceof Object[]) {
            Object[] values = (Object[])valueOrValues;
            PropertyType type = propertyTypeOf(values);
            prop = propertyFactory.create(propName, type, values);
        } else if (valueOrValues == null) {
            prop = propertyFactory.create(propName, new Object[] {});
        } else {
            PropertyType type = PropertyType.discoverType(valueOrValues);
            prop = propertyFactory.create(propName, type, valueOrValues);
        }
        return prop;
    }
View Full Code Here

    private PropertyType propertyTypeOf( Object[] values ) {
        if (values != null) {
            for (Object value : values) {
                if (value != null) {
                    PropertyType type = PropertyType.discoverType(value);
                    if (type != PropertyType.OBJECT) return type;
                }
            }
        }
        return PropertyType.OBJECT;
View Full Code Here

                                try {
                                    Matcher matcher = COLUMN_DEFN_PATTERN.matcher(columnDefn);
                                    if (matcher.find()) {
                                        final String propertyName = matcher.group(1).trim();
                                        String typeStr = matcher.group(2).trim();
                                        final PropertyType type = PropertyType.valueFor(typeStr);
                                        columns.add(new IndexColumnDefinition() {

                                            @Override
                                            public String getPropertyName() {
                                                return propertyName;
                                            }

                                            @Override
                                            public int getColumnType() {
                                                return type.jcrType();
                                            }
                                        });
                                    }
                                } catch (RuntimeException e) {
                                    e.printStackTrace();
View Full Code Here

    }

    @Override
    public ValueFactory<?> getValueFactory( Object prototype ) {
        CheckArg.isNotNull(prototype, "prototype");
        PropertyType inferredType = PropertyType.discoverType(prototype);
        assert inferredType != null;
        return getValueFactory(inferredType);
    }
View Full Code Here

            return propertyTypeIter.hasNext();
        }

        @Override
        public ValueFactory<?> next() {
            PropertyType nextType = propertyTypeIter.next();
            return getValueFactory(nextType);
        }
View Full Code Here

            stream.append('\n');
            stream.flush();
            return;
        }
        stream.append(" (");
        PropertyType type = PropertyType.discoverType(property.getFirstValue());
        stream.append(type.getName().toLowerCase());
        stream.append(") ");
        if (property.isMultiple()) {
            stream.append('[');
        }
        boolean first = true;
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.