Package javax.jcr

Examples of javax.jcr.ValueFormatException


        // check multi-value flag
        if (multipleValues != isMultiple()) {
            String msg = (multipleValues) ?
                    "Single-valued property can not be set to an array of values:" :
                    "Multivalued property can not be set to a single value (an array of length one is OK): ";
            throw new ValueFormatException(msg + this);
        }

        // check protected flag and for retention/hold
        sessionContext.getItemValidator().checkModify(
                this, CHECK_CONSTRAINTS, Permission.NONE);
View Full Code Here


    public InternalValue[] internalGetValues() throws RepositoryException {
        final PropertyDefinition definition = data.getPropertyDefinition();
        if (isMultiple()) {
            return getPropertyState().getValues();
        } else {
            throw new ValueFormatException(
                    this + " is a single-valued property,"
                    + " so it's value can not be retrieved as an array");
        }

    }
View Full Code Here

     * @throws ValueFormatException if this property is not single-valued
     * @throws RepositoryException
     */
    public InternalValue internalGetValue() throws RepositoryException {
        if (isMultiple()) {
            throw new ValueFormatException(
                    this + " is a multi-valued property,"
                    + " so it's values can only be retrieved as an array");
        } else {
            InternalValue[] values = getPropertyState().getValues();
            if (values.length > 0) {
View Full Code Here

                        throw new ItemNotFoundException(pathValue.getString());
                    }
                }

            default:
                throw new ValueFormatException("Property value cannot be converted to a PATH, REFERENCE or WEAKREFERENCE");
        }
    }
View Full Code Here

        boolean absolute;
        try {
            Path p = sessionContext.getQPath(path);
            absolute = p.isAbsolute();
        } catch (RepositoryException e) {
            throw new ValueFormatException("Property value cannot be converted to a PATH");
        }
        try {
            return (absolute) ? getSession().getProperty(path) : getParent().getProperty(path);
        } catch (PathNotFoundException e) {
            throw new ItemNotFoundException(path);
View Full Code Here

    public void setValue(Calendar value) throws RepositoryException {
        if (value != null) {
            try {
                setValue(getSession().getValueFactory().createValue(value));
            } catch (IllegalArgumentException e) {
                throw new ValueFormatException(
                        "Value is not an ISO8601 date: " + value, e);
            }
        } else {
            setValue((Value) null);
        }
View Full Code Here

    public void setValue(Node value) throws RepositoryException {
        if (value != null) {
            try {
                setValue(getValueFactory().createValue(value));
            } catch (UnsupportedRepositoryOperationException e) {
                throw new ValueFormatException(
                        "Node is not referenceable: " + value, e);
            }
        } else {
            setValue((Value) null);
        }
View Full Code Here

            for (int i = 0; i < values.length; i++) {
                if (values[i] != null) {
                    if (firstValueType == UNDEFINED) {
                        firstValueType = values[i].getType();
                    } else if (firstValueType != values[i].getType()) {
                        throw new ValueFormatException(
                                "inhomogeneous type of values");
                    }
                }
            }
        }
View Full Code Here

        }

        // check multi-value flag
        if (multipleValues) {
            if (!definition.isMultiple()) {
                throw new ValueFormatException(safeGetJCRPath()
                        + " is not multi-valued");
            }
        } else {
            if (definition.isMultiple()) {
                throw new ValueFormatException(safeGetJCRPath()
                        + " is multi-valued and can therefore only be set to an array of values");
            }
        }

        // check lock status
View Full Code Here

        // check state of this instance
        sanityCheck();

        // check multi-value flag
        if (!definition.isMultiple()) {
            throw new ValueFormatException(safeGetJCRPath() + " is not multi-valued");
        }

        PropertyState state = (PropertyState) getItemState();
        return state.getValues();
    }
View Full Code Here

TOP

Related Classes of javax.jcr.ValueFormatException

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.