Package org.jboss.dna.graph.query.validate.Schemata

Examples of org.jboss.dna.graph.query.validate.Schemata.Column


        this.name = name;
        // Define the columns ...
        List<Column> columnList = new LinkedList<Column>();
        Map<String, Column> columnMap = new HashMap<String, Column>();
        for (Column column : columns) {
            Column old = columnMap.put(column.getName(), column);
            if (old != null) {
                columnList.set(columnList.indexOf(old), column);
            } else {
                columnList.add(column);
            }
View Full Code Here


            String propertyName = propValue.getPropertyName();
            String selectorName = propValue.getSelectorName().getName();
            final int index = columns.getColumnIndexForProperty(selectorName, propertyName);
            // Find the expected property type of the value ...
            Table table = schemata.getTable(propValue.getSelectorName());
            Column schemaColumn = table.getColumn(propertyName);
            final String expectedType = schemaColumn.getPropertyType();
            final TypeFactory<?> typeFactory = typeSystem.getTypeFactory(expectedType);
            return new DynamicOperation() {
                public String getExpectedType() {
                    return expectedType;
                }

                public Object evaluate( Object[] tuple ) {
                    return typeFactory.create(tuple[index]);
                }
            };
        }
        final TypeFactory<String> stringFactory = typeSystem.getStringFactory();
        if (operand instanceof Length) {
            Length length = (Length)operand;
            PropertyValue value = length.getPropertyValue();
            String propertyName = value.getPropertyName();
            String selectorName = value.getSelectorName().getName();
            final int index = columns.getColumnIndexForProperty(selectorName, propertyName);
            // Find the expected property type of the value ...
            Table table = context.getSchemata().getTable(value.getSelectorName());
            Column schemaColumn = table.getColumn(propertyName);
            final String expectedType = schemaColumn.getPropertyType();
            final TypeFactory<?> typeFactory = typeSystem.getTypeFactory(expectedType);
            final TypeFactory<Long> longFactory = typeSystem.getLongFactory();
            return new DynamicOperation() {
                public String getExpectedType() {
                    return longFactory.getTypeName(); // length is always LONG
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.query.validate.Schemata.Column

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.