Examples of PropertyValue


Examples of javax.jcr.query.qom.PropertyValue

    }

    public void testCreateQueryWithConstraintOrderingAndColumn() throws RepositoryException {
        Selector selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        Column column = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
View Full Code Here

Examples of javax.jcr.query.qom.PropertyValue

    }

    public void testCreateQueryFromSourceWithConstraintOrderingAndColumn() throws RepositoryException {
        Source selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        Column column = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
View Full Code Here

Examples of org.apache.jackrabbit.core.query.jsr283.qom.PropertyValue

    /**
     * Test case for {@link QueryObjectModelFactory#propertyValue(String, String)}
     */
    public void testPropertyValueWithSelector() throws RepositoryException {
        PropertyValue propVal = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, propVal.getSelectorName());
        assertEquals("Wrong property name", propertyName1, propVal.getPropertyName());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.PropertyValue

    @Override
    public PropertyValue currentProperty() {
        boolean asterisk = PathUtils.getName(propertyName).equals("*");
        if (!asterisk) {
            PropertyValue p = selector.currentProperty(propertyName);
            return matchesPropertyType(p) ? p : null;
        }
        Tree tree = selector.currentTree();
        if (tree == null || !tree.exists()) {
            return null;
        }
        if (!asterisk) {
            String name = PathUtils.getName(propertyName);
            name = normalizePropertyName(name);
            PropertyState p = tree.getProperty(name);
            if (p == null) {
                return null;
            }
            return matchesPropertyType(p) ? PropertyValues.create(p) : null;
        }
        // asterisk - create a multi-value property
        // warning: the returned property state may have a mixed type
        // (not all values may have the same type)

        // TODO currently all property values are converted to strings -
        // this doesn't play well with the idea that the types may be different
        List<String> values = new ArrayList<String>();
        for (PropertyState p : tree.getProperties()) {
            if (matchesPropertyType(p)) {
                Iterables.addAll(values, p.getValue(Type.STRINGS));
            }
        }
        // "*"
        return PropertyValues.newString(values);
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.PropertyValue

            boolean not = readIf("NOT");
            read("NULL");
            if (!(left instanceof PropertyValue)) {
                this.getSyntaxError("propertyName (NOT NULL is only supported for properties)");
            }
            PropertyValue p = (PropertyValue) left;
            c = getPropertyExistence(p);
            if (!not) {
                c = factory.not(c);
            }
        } else if (readIf("NOT")) {
            if (readIf("IS")) {
                read("NULL");
                if (!(left instanceof PropertyValue)) {
                    throw new RepositoryException(
                            "Only property values can be tested for NOT IS NULL; got: "
                            + left.getClass().getName());
                }
                PropertyValue pv = (PropertyValue) left;
                c = getPropertyExistence(pv);
            } else {
                read("LIKE");
                c = factory.not(factory.comparison(left,
                        QueryObjectModelConstants.OPERATOR_LIKE,
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.PropertyValue

               byte[] padding = new byte[8-length];
               IOUtils.readFully(value, padding);
            }
           
            // Wrap and store
            PropertyValue propVal = null;
            if (isPointer) {
               // TODO Pointer type which can do lookup
            }
            else if (type == Types.LONG_LONG) {
               propVal = new LongLongPropertyValue(prop, flags, data);
            }
            else if (type == Types.TIME) {
               propVal = new TimePropertyValue(prop, flags, data);
            }
            // TODO Add in the rest of the type
            else {
               propVal = new PropertyValue(prop, flags, data);
            }
           
            if (properties.get(prop) == null) {
               properties.put(prop, new ArrayList<PropertyValue>());
            }
View Full Code Here

Examples of org.apache.qpid.disttest.client.property.PropertyValue

        final TestCommand unmarshalledCommand = _jsonHandler.unmarshall(json, TestCommand.class);
        Map<String, PropertyValue> properties = unmarshalledCommand.getMessageProperties();
        assertNotNull("Properties should not be null", properties);
        assertFalse("Properties should not be empty", properties.isEmpty());
        assertEquals("Unexpected properties size", 2, properties.size());
        PropertyValue testProperty = properties.get("test");
        assertNotNull("Unexpected property test", testProperty);
        assertTrue("Unexpected property test", testProperty.getValue() instanceof Number);
        assertEquals("Unexpected property value", 1, ((Number)testProperty.getValue()).intValue());
        Object generatorObject = properties.get("generator");
        assertTrue("Unexpected generator object", generatorObject instanceof ListPropertyValue);
        PropertyValue generator = (PropertyValue)generatorObject;
        assertEquals("Unexpected generator value", "first", generator.getValue());
        for (int i = 0; i < 10; i++)
        {
            assertEquals("Unexpected generator value", new Integer(i), generator.getValue());
        }
        String newJson =_jsonHandler.marshall(unmarshalledCommand);
        final TestCommand newUnmarshalledCommand = _jsonHandler.unmarshall(newJson, TestCommand.class);
        assertEquals("Unmarshalled command should be equal to the original object", unmarshalledCommand, newUnmarshalledCommand);
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.PropertyValue

    private void processProperties(Map<String, PropertyValue<?>> propertyValues,
                                   Collection<JavaMappedProperty<?>> properties,
                                   SystemAtomicComponentImpl component) {
        for (JavaMappedProperty<?> property : properties) {
            PropertyValue value = propertyValues.get(property.getName());
            ObjectFactory<?> factory;
            if (value != null) {
                factory = value.getValueFactory();
            } else {
                factory = property.getDefaultValueFactory();
            }
            if (factory != null) {
                component.addPropertyFactory(property.getName(), factory);
View Full Code Here

Examples of org.foray.fotree.value.PropertyValue

     * @return The PropertyValue instance created by the parser.
     * @throws PropertyException If the input is inconsistent.
     */
    protected PropertyValue standardParse(final FObj fobj,
            final String rawPropertyValue) throws PropertyException {
        PropertyValue pv = checkKeywords(getValidKeywords(), rawPropertyValue);
        if (pv != null) {
            return pv;
        }
        pv = PropertyParser.parse(fobj, rawPropertyValue,
                this.getPropertyType());
View Full Code Here

Examples of org.hibernate.test.any.PropertyValue

  public void testAnyMappingReference() {
    Session s = openSession();
    s.beginTransaction();

    PropertyValue redValue = new StringPropertyValue( "red" );
    PropertyValue lonliestNumberValue = new IntegerPropertyValue( 1 );

    Long id;
    PropertySet ps = new PropertySet( "my properties" );
    ps.setSomeSpecificProperty( redValue );
    ps.getGeneralProperties().put( "the lonliest number", lonliestNumberValue );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.