Package org.modeshape.jcr

Examples of org.modeshape.jcr.JcrValueFactory.createValue()


            jcrValue = factory.createValue((Reference)value);
        } else if (value instanceof URI) {
            jcrValue = factory.createValue((URI)value);
        } else if (value instanceof InputStream) {
            Binary binary = factory.createBinary((InputStream)value);
            jcrValue = factory.createValue(binary);
        } else if (value instanceof Name || value instanceof Path) {
            // Convert first to a string ...
            String strValue = typeSystem.getStringFactory().create(value);
            jcrValue = factory.createValue(strValue);
        } else if (value instanceof Node) {
View Full Code Here


            Binary binary = factory.createBinary((InputStream)value);
            jcrValue = factory.createValue(binary);
        } else if (value instanceof Name || value instanceof Path) {
            // Convert first to a string ...
            String strValue = typeSystem.getStringFactory().create(value);
            jcrValue = factory.createValue(strValue);
        } else if (value instanceof Node) {
            try {
                jcrValue = factory.createValue((Node)value);
            } catch (RepositoryException e) {
                throw new ValueFormatException(value, PropertyType.REFERENCE,
View Full Code Here

            // Convert first to a string ...
            String strValue = typeSystem.getStringFactory().create(value);
            jcrValue = factory.createValue(strValue);
        } else if (value instanceof Node) {
            try {
                jcrValue = factory.createValue((Node)value);
            } catch (RepositoryException e) {
                throw new ValueFormatException(value, PropertyType.REFERENCE,
                                               GraphI18n.errorConvertingType.text(Node.class.getSimpleName(),
                                                                                  Reference.class.getSimpleName(), value), e);
            }
View Full Code Here

                throw new ValueFormatException(value, PropertyType.REFERENCE,
                                               GraphI18n.errorConvertingType.text(Node.class.getSimpleName(),
                                                                                  Reference.class.getSimpleName(), value), e);
            }
        } else {
            jcrValue = factory.createValue(value.toString());
        }
        return new LiteralValue(jcrValue, value);
    }

}
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.