Package org.exolab.castor.xml.handlers

Examples of org.exolab.castor.xml.handlers.DateFieldHandler


        // as it can interfere with user specified handlers. Instead it should go into
        // XMLMappingLoader.
        if (getFieldType() != null) {
            if (java.util.Date.class.isAssignableFrom(getFieldType())) {
                if (getHandler() instanceof FieldHandlerImpl) {
                    setHandler(new DateFieldHandler(getHandler()));
                }
            }
        }

        setTransient(fieldDesc.isTransient());
View Full Code Here


            for (int i = 0; i < dateDescriptors.size(); i++) {
                XMLFieldDescriptorImpl fieldDesc =
                    (XMLFieldDescriptorImpl) dateDescriptors.get(i);
                FieldHandler handler = fieldDesc.getHandler();
                fieldDesc.setImmutable(true);
                DateFieldHandler dfh = new DateFieldHandler(handler);

                //-- patch for java.sql.Date
                Class type = fieldDesc.getFieldType();
                if (java.sql.Date.class.isAssignableFrom(type)) {
                    dfh.setUseSQLDate(true);
                }
                fieldDesc.setHandler(dfh);
            }
        }
View Full Code Here

            _contentDescriptor = new XMLFieldDescriptorImpl(String.class,
                "content", "content", NodeType.Text);

            _contentDescriptor.setImmutable(true);
            //-- setHandler
            _contentDescriptor.setHandler(new DateFieldHandler(
                new XMLFieldHandler() {

                    public Object getValue( Object object )
                        throws IllegalStateException
                    {
View Full Code Here

            for (int i = 0; i < dateDescriptors.size(); i++) {
                XMLFieldDescriptorImpl fieldDesc =
                    (XMLFieldDescriptorImpl) dateDescriptors.get(i);
                FieldHandler handler = fieldDesc.getHandler();
                fieldDesc.setImmutable(true);
                DateFieldHandler dfh = new DateFieldHandler(handler);
               
                //-- patch for java.sql.Date
                Class type = fieldDesc.getFieldType();
                if (java.sql.Date.class.isAssignableFrom(type)) {
                    dfh.setUseSQLDate(true);
                }
                fieldDesc.setHandler(dfh);
            }
        }
       
View Full Code Here

            _contentDescriptor = new XMLFieldDescriptorImpl(String.class,
                "content", "content", NodeType.Text);

            _contentDescriptor.setImmutable(true);
            //-- setHandler
            DateFieldHandler dfh = new DateFieldHandler(
                new XMLFieldHandler() {

                    public Object getValue( Object object )
                        throws IllegalStateException
                    {
                        return object;
                    }

                    public void setValue( Object object, Object value)
                        throws IllegalStateException, IllegalArgumentException
                    {
                        if (java.sql.Date.class == object.getClass()) {
                            Date target = (Date)object;
                            if (java.util.Date.class.isAssignableFrom(value.getClass())) {
                                target.setTime(((Date)value).getTime());
                            }
                        }
                    }
                    public Object newInstance( Object parent ) {
                        return null;
                    }
                }
            );
            dfh.setUseSQLDate(true);
            _contentDescriptor.setHandler(dfh);

        }

        if (_fields == null) {
View Full Code Here

        //-- check for instances of java.util.Date
        if (_fieldType != null) {
            if (java.util.Date.class.isAssignableFrom(_fieldType)) {
                if (!(_handler instanceof DateFieldHandler)) {
                    _handler = new DateFieldHandler(_handler);
                }
            }
        }

        //-- handle xml name
View Full Code Here

        }

        //-- check for instances of java.util.Date
        if (java.util.Date.class.isAssignableFrom(_fieldType)) {
            if (!(_handler instanceof DateFieldHandler)) {
                _handler = new DateFieldHandler(_handler);
            }
        }

        //-- handle xml name
        if ( xmlName == null ) xmlName = getFieldName();
View Full Code Here

            _contentDescriptor = new XMLFieldDescriptorImpl(String.class,
                "content", "content", NodeType.Text);

            _contentDescriptor.setImmutable(true);
            //-- setHandler
            _contentDescriptor.setHandler(new DateFieldHandler(
                new XMLFieldHandler() {

                    public Object getValue( Object object )
                        throws IllegalStateException
                    {
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.handlers.DateFieldHandler

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.