Examples of ValueConstraint


Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

            return;
        }
        List constraints = new ArrayList();
        do {
            nextToken();
            ValueConstraint constraint = null;
            try {
                constraint = ValueConstraint.create(pdi.getRequiredType(), currentToken, nsMapping);
            } catch (InvalidConstraintException e) {
                lexer.fail("'" + currentToken + "' is not a valid constraint expression for a value of type " + pdi.getRequiredType());
            }
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

            return;
        }
        List constraints = new ArrayList();
        do {
            nextToken();
            ValueConstraint constraint = null;
            try {
                constraint = ValueConstraint.create(pdi.getRequiredType(), currentToken, resolver);
            } catch (InvalidConstraintException e) {
                lexer.fail("'" + currentToken + "' is not a valid constraint expression for a value of type " + pdi.getRequiredType());
            }
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

        namespaceMapping.setMapping(NS_PREFIX, NS_URI);
        InternalValue dv1 = InternalValue.create(DEFAULT_VALUE_1);
        InternalValue dv2 = InternalValue.create(DEFAULT_VALUE_2);

        NamePathResolver resolver = new DefaultNamePathResolver(namespaceMapping);
        ValueConstraint vc = ValueConstraint.create(PropertyType.LONG, VALUE_CONSTRAINT, resolver);
        InternalValue[] defaultValues = new InternalValue[]{dv1, dv2};
        ValueConstraint[] valueConstraints = new ValueConstraint[]{vc};

        PropDefImpl pd = new PropDefImpl();
        pd.setName(PROPERTY_NAME);
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

            return;
        }
        List constraints = new ArrayList();
        do {
            nextToken();
            ValueConstraint constraint = null;
            try {
                constraint = ValueConstraint.create(pdi.getRequiredType(), currentToken, nsMapping);
            } catch (InvalidConstraintException e) {
                lexer.fail("'" + currentToken + "' is not a valid constraint expression for a value of type " + pdi.getRequiredType());
            }
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

    protected void setUp() throws Exception {
        NamespaceMapping namespaceMapping = new NamespaceMapping();
        namespaceMapping.setMapping(NS_PREFIX, NS_URI);
        InternalValue dv1 = InternalValue.create(DEFAULT_VALUE_1);
        InternalValue dv2 = InternalValue.create(DEFAULT_VALUE_2);
        ValueConstraint vc = ValueConstraint.create(PropertyType.LONG, VALUE_CONSTRAINT, namespaceMapping);
        InternalValue[] defaultValues = new InternalValue[]{dv1, dv2};
        ValueConstraint[] valueConstraints = new ValueConstraint[]{vc};

        PropDefImpl pd = new PropDefImpl();
        pd.setName(PROPERTY_NAME);
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

        namespaceMapping.setMapping(NS_PREFIX, NS_URI);
        InternalValue dv1 = InternalValue.create(DEFAULT_VALUE_1);
        InternalValue dv2 = InternalValue.create(DEFAULT_VALUE_2);

        NamePathResolver resolver = new DefaultNamePathResolver(namespaceMapping);
        ValueConstraint vc = ValueConstraint.create(PropertyType.LONG, VALUE_CONSTRAINT, resolver);
        InternalValue[] defaultValues = new InternalValue[]{dv1, dv2};
        ValueConstraint[] valueConstraints = new ValueConstraint[]{vc};

        PropDefImpl pd = new PropDefImpl();
        pd.setName(PROPERTY_NAME);
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.ValueConstraint

            return;
        }
        List constraints = new ArrayList();
        do {
            nextToken();
            ValueConstraint constraint = null;
            try {
                constraint = ValueConstraint.create(pdi.getRequiredType(), currentToken, resolver);
            } catch (InvalidConstraintException e) {
                lexer.fail("'" + currentToken + "' is not a valid constraint"
                        + " expression for a value of type " + pdi.getRequiredType());
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.nodetype.ValueConstraint

            return new String[0];
        }
        try {
            String[] vca = new String[constraints.length];
            for (int i = 0; i < constraints.length; i++) {
                ValueConstraint constr = ValueConstraint.create(pd.getRequiredType(), constraints[i]);
                vca[i] = constr.getDefinition(resolver);
            }
            return vca;
        } catch (InvalidConstraintException e) {
            log.error("Invalid value constraint: " + e.getMessage());
            return null;
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.nodetype.constraint.ValueConstraint

    private String[] createValueConstraints(int type, QValueConstraint[] qv)
            throws RepositoryException {
        String[] ret = new String[qv.length];
        for (int i=0; i<ret.length; i++) {
            try {
                ValueConstraint c = ValueConstraint.create(type, qv[i].getString());
                ret[i] = c.getDefinition(resolver);
            } catch (InvalidConstraintException e) {
                throw new RepositoryException("Internal error while converting value constraints.", e);
            }
        }
        return ret;
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.nodetype.constraint.ValueConstraint

            return new String[0];
        }
        try {
            String[] vca = new String[constraints.length];
            for (int i = 0; i < constraints.length; i++) {
                ValueConstraint constr = ValueConstraint.create(pd.getRequiredType(), constraints[i]);
                vca[i] = constr.getDefinition(resolver);
            }
            return vca;
        } catch (InvalidConstraintException e) {
            log.error("Invalid value constraint: " + e.getMessage());
            return null;
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.