Package org.qi4j.api.value

Examples of org.qi4j.api.value.ValueBuilder


                        refs.add( EntityReference.parseEntityReference( jsonArray.getString( i ) ) );
                    }
                }
            }

            ValueBuilder valueBuilder = module
                    .newValueBuilderWithState( actualValueType.type(), new Function<PropertyDescriptor, Object>()
                    {
                        @Override
                        public Object map( PropertyDescriptor descriptor )
                        {
                            return values.get( descriptor.qualifiedName() );
                        }
                    },new Function<AssociationDescriptor, EntityReference>()
                    {
                        @Override
                        public EntityReference map( AssociationDescriptor associationDescriptor )
                        {
                            Object ref = values.get( associationDescriptor.qualifiedName() );
                            if (ref == null)
                                return null;
                            else
                                return (EntityReference) ref;
                        }
                    },new Function<AssociationDescriptor, Iterable<EntityReference>>()
                    {
                        @Override
                        public Iterable<EntityReference> map( AssociationDescriptor associationDescriptor )
                        {
                            Object ref = values.get( associationDescriptor.qualifiedName() );
                            if (ref == null)
                                return Iterables.empty();
                            else
                                return (Iterable<EntityReference>) ref;
                        }
                    });

            return valueBuilder.newInstance();
        } else
        {
            try
            {
                if( json instanceof JSONObject )
View Full Code Here

TOP

Related Classes of org.qi4j.api.value.ValueBuilder

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.