Package org.qi4j.api.property

Examples of org.qi4j.api.property.Property


        {
            Object initialValue = propertyModel.initialValue( module );
            if (propertyModel.accessor().equals(identityMethod))
                initialValue = identity;

            Property property = new PropertyInstance<Object>(propertyModel, initialValue );
            properties.put( propertyModel.accessor(), property );
        }

        TransientStateInstance state = new TransientStateInstance( properties );
        ServiceInstance compositeInstance = new ServiceInstance( this, module, mixins, state );
View Full Code Here


        }

        public Object provideInjection( InjectionContext context )
            throws InjectionProviderException
        {
            Property value = context.state().propertyFor( propertyDescriptor.accessor() );
            if( value != null )
            {
                return value;
            }
            else
View Full Code Here

        {
            for( OrderBy orderBySegment : orderBySegments )
            {
                try
                {
                    final Property prop1 = orderBySegment.getPropertyFunction().map( o1 );
                    final Property prop2 = orderBySegment.getPropertyFunction().map( o2 );
                    if( prop1 == null || prop2 == null )
                    {
                        if( prop1 == null && prop2 == null )
                        {
                            return 0;
                        }
                        else if( prop1 != null )
                        {
                            return 1;
                        }
                        return -1;
                    }
                    final Object value1 = prop1.get();
                    final Object value2 = prop2.get();
                    if( value1 == null || value2 == null )
                    {
                        if( value1 == null && value2 == null )
                        {
                            return 0;
View Full Code Here

        }

        Map<AccessibleObject, Property<?>> properties = new HashMap<AccessibleObject, Property<?>>();
        for( PropertyModel propertyModel : model.model().state().properties() )
        {
            Property property = new PropertyInstance<Object>(propertyModel.getBuilderInfo(), propertyModel.initialValue( model.module() ) );
            properties.put( propertyModel.accessor(), property );
        }

        TransientStateInstance state = new TransientStateInstance( properties );
View Full Code Here

        }

        Map<AccessibleObject, Property<?>> properties = new HashMap<AccessibleObject, Property<?>>();
        for( PropertyModel propertyModel : model.model().state().properties() )
        {
            Property property = new PropertyInstance<Object>(propertyModel, propertyModel.initialValue( model.module() ) );
            properties.put( propertyModel.accessor(), property );
        }

        TransientStateInstance state = new TransientStateInstance( properties );
View Full Code Here

    public void use( T actualData )
    {
        for( Map.Entry<Method, BoundProperty> entry : properties.entrySet() )
        {
            BoundProperty bound = entry.getValue();
            Property actualProperty = null;
            if( actualData != null )
            {
                Method method = entry.getKey();
                try
                {
View Full Code Here

        {
            for( OrderBy orderBySegment : orderBySegments )
            {
                try
                {
                    final Property prop1 = orderBySegment.property().map( o1 );
                    final Property prop2 = orderBySegment.property().map( o2 );
                    if( prop1 == null || prop2 == null )
                    {
                        if( prop1 == null && prop2 == null )
                        {
                            return 0;
                        }
                        else if( prop1 != null )
                        {
                            return 1;
                        }
                        return -1;
                    }
                    final Object value1 = prop1.get();
                    final Object value2 = prop2.get();
                    if( value1 == null || value2 == null )
                    {
                        if( value1 == null && value2 == null )
                        {
                            return 0;
View Full Code Here

            try
            {
                String propertyName = methodName;
                Object thisComposite = JavaEmbedUtils.rubyToJava( iRubyObject.getRuntime(), iRubyObject, Object.class );
                Method propertyMethod = thisComposite.getClass().getMethod( propertyName );
                Property property = (Property) propertyMethod.invoke( thisComposite );
                Object propertyValue = property.get();
                IRubyObject prop = JavaEmbedUtils.javaToRuby( iRubyObject.getRuntime(), propertyValue );
                return prop;
            }
            catch( Exception e )
            {
View Full Code Here

        {
            Class<?> memberClass = qi4jField.getClass();

            if( Property.class.isAssignableFrom( memberClass ) )
            {
                Property property = (Property) qi4jField;

                OgnlContext ognlContext = (OgnlContext) aContext;
                Class<?> propertyType = (Class) api.propertyDescriptorFor( property ).type();
                Object convertedValue = getConvertedType(
                    ognlContext, aTarget, null, fieldName, aPropertyValue, propertyType );
                try
                {
                    property.set( convertedValue );
                }
                catch( ConstraintViolationException e )
                {
                    Collection<ConstraintViolation> violations = e.constraintViolations();
                    handleConstraintViolation( aContext, aTarget, fieldName, convertedValue, violations );
View Full Code Here

TOP

Related Classes of org.qi4j.api.property.Property

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.