Examples of canSetProperty()


Examples of javax.jcr.nodetype.NodeType.canSetProperty()

        }

        NodeType nt = definition.getDeclaringNodeType();
        if (definition.isMultiple()) {
            List<Value> values = ValueFactoryImpl.createValues(property, ntMgr.getNamePathMapper());
            if (!nt.canSetProperty(property.getName(), values.toArray(new Value[values.size()]))) {
                throw new ConstraintViolationException("Cannot set property '" + property.getName() + "' to '" + values + '\'');
            }
        } else {
            Value v = ValueFactoryImpl.createValue(property, ntMgr.getNamePathMapper());
            if (!nt.canSetProperty(property.getName(), v)) {
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

            if (!nt.canSetProperty(property.getName(), values.toArray(new Value[values.size()]))) {
                throw new ConstraintViolationException("Cannot set property '" + property.getName() + "' to '" + values + '\'');
            }
        } else {
            Value v = ValueFactoryImpl.createValue(property, ntMgr.getNamePathMapper());
            if (!nt.canSetProperty(property.getName(), v)) {
                throw new ConstraintViolationException("Cannot set property '" + property.getName() + "' to '" + v + '\'');
            }
        }
    }
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

            throws RepositoryException, NotExecutableException {
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        NodeType nt = superuser.getWorkspace().getNodeTypeManager().getNodeType(testNodeType);
        Value v1 = superuser.getValueFactory().createValue("foo");
        Value v2 = superuser.getValueFactory().createValue(System.currentTimeMillis());
        if (!nt.canSetProperty(propertyName1, v1) || !nt.canSetProperty(propertyName1, v2)) {
            throw new NotExecutableException("Property " + propertyName1 + " is not of type UNDEFINED");
        }
        n.setProperty(propertyName1, v1);
        testRootNode.save();
        EventResult result = new EventResult(log);
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

            throws RepositoryException, NotExecutableException {
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        NodeType nt = superuser.getWorkspace().getNodeTypeManager().getNodeType(testNodeType);
        Value v1 = superuser.getValueFactory().createValue("foo");
        Value v2 = superuser.getValueFactory().createValue(System.currentTimeMillis());
        if (!nt.canSetProperty(propertyName1, v1) || !nt.canSetProperty(propertyName1, v2)) {
            throw new NotExecutableException("Property " + propertyName1 + " is not of type UNDEFINED");
        }
        n.setProperty(propertyName1, v1);
        testRootNode.save();
        EventResult result = new EventResult(log);
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

        Value anyStringValue = NodeTypeUtil.getValueOfType(session, PropertyType.STRING);
        assertFalse("canSetProperty(String propertyName, Value value) must return " +
                "false if the property is of type Double and value is a StringValue " +
                "that is not convertible to a DoubleValue",
                nodeType.canSetProperty(propDef.getName(), anyStringValue));

        Value doubleStringValue =
                superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString());
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a StringValue " +
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

        Value doubleStringValue =
                superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString());
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a StringValue " +
                "that is convertible to a DoubleValue",
                nodeType.canSetProperty(propDef.getName(), doubleStringValue));

        Value anyBinaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
        assertFalse("canSetProperty(String propertyName, Value value) must return " +
                "false if the property is of type Double and value is a UTF-8 " +
                "BinaryValue that is not convertible to a DoubleValue",
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

        Value anyBinaryValue = NodeTypeUtil.getValueOfType(session, PropertyType.BINARY);
        assertFalse("canSetProperty(String propertyName, Value value) must return " +
                "false if the property is of type Double and value is a UTF-8 " +
                "BinaryValue that is not convertible to a DoubleValue",
                nodeType.canSetProperty(propDef.getName(), anyBinaryValue));

        Value doubleBinaryValue =
                superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString(), PropertyType.BINARY);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a UTF-8 " +
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

        Value doubleBinaryValue =
                superuser.getValueFactory().createValue(NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE).getString(), PropertyType.BINARY);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a UTF-8 " +
                "BinaryValue that is convertible to a DoubleValue",
                nodeType.canSetProperty(propDef.getName(), doubleBinaryValue));

        Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a DateValue",
                nodeType.canSetProperty(propDef.getName(), dateValue));
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

                nodeType.canSetProperty(propDef.getName(), doubleBinaryValue));

        Value dateValue = NodeTypeUtil.getValueOfType(session, PropertyType.DATE);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a DateValue",
                nodeType.canSetProperty(propDef.getName(), dateValue));

        Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a DoubleValue",
                nodeType.canSetProperty(propDef.getName(), doubleValue));
View Full Code Here

Examples of javax.jcr.nodetype.NodeType.canSetProperty()

                nodeType.canSetProperty(propDef.getName(), dateValue));

        Value doubleValue = NodeTypeUtil.getValueOfType(session, PropertyType.DOUBLE);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a DoubleValue",
                nodeType.canSetProperty(propDef.getName(), doubleValue));

        Value longValue = NodeTypeUtil.getValueOfType(session, PropertyType.LONG);
        assertTrue("canSetProperty(String propertyName, Value value) must return " +
                "true if the property is of type Double and value is a LongValue",
                nodeType.canSetProperty(propDef.getName(), longValue));
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.