Examples of internalValue()


Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

        // avoid unnecessary object creation if possible
        PropertyState state = (PropertyState) getItemState();
        InternalValue val = state.getValues()[0];
        int type = val.getType();
        if (type == PropertyType.DATE) {
            return (Calendar) val.internalValue();
        }
        // not a DATE value, delegate conversion to Value object
        return val.toJCRValue(session.getNamespaceResolver()).getDate();
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

        // avoid unnecessary object creation if possible
        PropertyState state = (PropertyState) getItemState();
        InternalValue val = state.getValues()[0];
        int type = val.getType();
        if (type == PropertyType.BOOLEAN) {
            return ((Boolean) val.internalValue()).booleanValue();
        }
        // not a BOOLEAN value, delegate conversion to Value object
        return val.toJCRValue(session.getNamespaceResolver()).getBoolean();
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

        PropertyState state = (PropertyState) getItemState();
        InternalValue val = state.getValues()[0];
        if (val.getType() == PropertyType.REFERENCE) {
            // reference, i.e. target UUID
            UUID targetUUID = (UUID) val.internalValue();
            return (Node) itemMgr.getItem(new NodeId(targetUUID.toString()));
        } else {
            throw new ValueFormatException("property must be of type REFERENCE");
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                InternalValue val = values[i];
                if (val != null) {
                    if (val.getType() == PropertyType.BINARY) {
                        BLOBFileValue blobVal = (BLOBFileValue) val.internalValue();
                        // delete blob file and prune empty parent folders
                        blobVal.delete(true);
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

                        InternalValue val = values[i];
                        if (val != null) {
                            if (type == PropertyType.BINARY) {
                                // special handling required for binary value:
                                // put binary value in BLOB store
                                BLOBFileValue blobVal = (BLOBFileValue) val.internalValue();
                                InputStream in = blobVal.getStream();
                                String blobId = blobStore.createId((PropertyId) state.getId(), i);
                                try {
                                    blobStore.put(blobId, in, blobVal.getLength());
                                } finally {
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                InternalValue val = values[i];
                if (val != null) {
                    if (val.getType() == PropertyType.BINARY) {
                        BLOBFileValue blobVal = (BLOBFileValue) val.internalValue();
                        // delete blob file and prune empty parent folders
                        blobVal.delete(true);
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

            for (int i = 0; i < values.length; i++) {
                InternalValue val = values[i];
                try {
                    if (type == PropertyType.BINARY) {
                        // special handling required for binary value
                        BLOBFileValue blob = (BLOBFileValue) val.internalValue();
                        InputStream in = blob.getStream();
                        out.writeLong(blob.getLength());
                        byte[] buf = new byte[0x2000];
                        try {
                            int read;
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

            boolean modified = false;
            InternalValue[] values = prop.getValues();
            InternalValue[] newVals = new InternalValue[values.length];
            for (int i = 0; i < values.length; i++) {
                InternalValue val = values[i];
                UUID original = (UUID) val.internalValue();
                UUID adjusted = refTracker.getMappedUUID(original);
                if (adjusted != null) {
                    newVals[i] = InternalValue.create(adjusted);
                    modified = true;
                } else {
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

            for (int i = 0; i < oldValues.length; i++) {
                InternalValue old = oldValues[i];
                if (old != null && old.getType() == PropertyType.BINARY) {
                    // make sure temporarily allocated data is discarded
                    // before overwriting it
                    ((BLOBFileValue) old.internalValue()).discard();
                }
            }
        }

        // set new values
View Full Code Here

Examples of org.apache.jackrabbit.core.value.InternalValue.internalValue()

        PropertyState state = (PropertyState) getItemState();
        InternalValue val = state.getValues()[0];
        int type = val.getType();
        if (type == PropertyType.LONG) {
            return ((Long) val.internalValue()).longValue();
        }
        // not a LONG value, delegate conversion to Value object
        return val.toJCRValue(session.getNamespaceResolver()).getLong();
    }
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.