Package org.qi4j.api.type

Examples of org.qi4j.api.type.ValueType


    @Override
    public <T> Function<String, T> deserialize( Class<T> type )
    {
        if( CollectionType.isCollection( type ) )
        {
            ValueType objectValueType = new ValueType( Object.class );
            return deserialize( new CollectionType( type, objectValueType ) );
        }
        if( MapType.isMap( type ) )
        {
            ValueType objectValueType = new ValueType( Object.class );
            return deserialize( new MapType( type, objectValueType, objectValueType ) );
        }
        return deserialize( new ValueType( type ) );
    }
View Full Code Here


    public final <T> T deserialize( Class<?> type, String input )
        throws ValueSerializationException
    {
        if( CollectionType.isCollection( type ) )
        {
            ValueType objectValueType = new ValueType( Object.class );
            return deserialize( new CollectionType( type, objectValueType ), input );
        }
        if( MapType.isMap( type ) )
        {
            ValueType objectValueType = new ValueType( Object.class );
            return deserialize( new MapType( type, objectValueType, objectValueType ), input );
        }
        return deserialize( new ValueType( type ), input );
    }
View Full Code Here

    public final <T> T deserialize( Class<?> type, InputStream input )
        throws ValueSerializationException
    {
        if( CollectionType.isCollection( type ) )
        {
            ValueType objectValueType = new ValueType( Object.class );
            return deserialize( new CollectionType( type, objectValueType ), input );
        }
        if( MapType.isMap( type ) )
        {
            ValueType objectValueType = new ValueType( Object.class );
            return deserialize( new MapType( type, objectValueType, objectValueType ), input );
        }
        return deserialize( new ValueType( type ), input );
    }
View Full Code Here

        ValueCompositeType valueCompositeType = (ValueCompositeType) valueType;
        Class<?> valueBuilderType = first( valueCompositeType.types() );
        String typeInfo = this.<String>getObjectFieldValue(
            inputNode,
            "_type",
            this.<String>buildDeserializeInputNodeFunction( new ValueType( String.class ) ) );
        TREE_PARSING_LOG.trace(
            "In deserializeNodeValueComposite(), getObjectFieldValue( {} ) returned '{}'",
            inputNode, typeInfo );
        if( typeInfo != null )
        {
View Full Code Here

            if( objectHasField( inputNode, associationName ) )
            {
                Object value = getObjectFieldValue(
                    inputNode,
                    associationName,
                    buildDeserializeInputNodeFunction( new ValueType( EntityReference.class ) ) );
                stateMap.put( associationName, value );
            }
        }

        // ManyAssociations
        for( AssociationDescriptor manyAssociation : valueCompositeType.manyAssociations() )
        {
            String manyAssociationName = manyAssociation.qualifiedName().name();
            if( objectHasField( inputNode, manyAssociationName ) )
            {
                Object value = getObjectFieldValue(
                    inputNode,
                    manyAssociationName,
                    buildDeserializeInputNodeFunction( new CollectionType( Collection.class,
                                                                           new ValueType( EntityReference.class ) ) ) );
                stateMap.put( manyAssociationName, value );
            }
        }

        // NamedAssociations
View Full Code Here

            if( objectHasField( inputNode, "_type" ) ) // with _type info
            {
                String typeInfo = this.<String>getObjectFieldValue(
                    inputNode,
                    "_type",
                    this.<String>buildDeserializeInputNodeFunction( new ValueType( String.class ) ) );
                TREE_PARSING_LOG.trace(
                    "In deserializeNodeGuessed(), getObjectFieldValue( {} ) returned '{}'",
                    inputNode, typeInfo );
                ValueDescriptor valueDescriptor = valuesModule().valueDescriptor( typeInfo );
                if( valueDescriptor == null )
View Full Code Here

        if( !( includeNonQueryable || persistentProperty.queryable() ) )
        {
            return; // Skip non-queryable
        }

        ValueType valueType = persistentProperty.valueType();

        final ValueFactory valueFactory = graph.getValueFactory();

        String propertyURI = persistentProperty.qualifiedName().toURI();
        URI predicate = valueFactory.createURI( propertyURI );
View Full Code Here

            if( propertyValue == null )
            {
                continue; // Skip null values
            }

            ValueType type = persistentProperty.valueType();
            if( type instanceof ValueCompositeType )
            {
                URI pred = valueFactory.createURI( baseUri, persistentProperty.qualifiedName().name() );
                serializeValueComposite( collection, pred, (ValueComposite) propertyValue, type, graph,
                                         baseUri + persistentProperty.qualifiedName().name() + "/",
View Full Code Here

    @Override
    public <T> T deserialize( Class<?> type, InputStream input )
        throws ValueSerializationException
    {
        return deserializer.deserialize( new ValueType( type ), input );
    }
View Full Code Here

TOP

Related Classes of org.qi4j.api.type.ValueType

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.