Package org.apache.turbine.services.intake.xmlmodel

Examples of org.apache.turbine.services.intake.xmlmodel.XmlField


        fields = new HashMap((int) (1.25 * size + 1));
        mapToObjectFields = new HashMap((int) (1.25 * size + 1));
        fieldsArray = new Field[size];
        for (int i = size - 1; i >= 0; i--)
        {
            XmlField f = (XmlField) inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i] = field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List) mapToObjectFields.get(f.getMapToObject());
            if (tmpFields == null)
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here


        fields = new HashMap((int) (1.25 * size + 1));
        mapToObjectFields = new HashMap((int) (1.25 * size + 1));
        fieldsArray = new Field[size];
        for (int i = size - 1; i >= 0; i--)
        {
            XmlField f = (XmlField) inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i] = field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List) mapToObjectFields.get(f.getMapToObject());
            if (tmpFields == null)
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here

        fields = new HashMap((int) (1.25 * size + 1));
        mapToObjectFields = new HashMap((int) (1.25 * size + 1));
        fieldsArray = new Field[size];
        for (int i = size - 1; i >= 0; i--)
        {
            XmlField f = (XmlField) inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i] = field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List) mapToObjectFields.get(f.getMapToObject());
            if (tmpFields == null)
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here

                List fields = g.getFields();
                iter2 = fields.iterator();
                while (iter2.hasNext())
                {
                    XmlField field = (XmlField)iter2.next();
                    String className = field.getMapToObject();
                    String propName = field.getMapToProperty();
                    // an unlikely but possible error
                    if ( className == null &&
                         !field.getName().equals(propName) )
                    {
                        Log.error("Field, " + field.getName() +
                                 ", has a property, " + propName +
                                 " but no class is defined.");
                    }
                   
                    if ( className != null && propName != null )
                    {                   
                        // Uses bean introspection to set writable properties
                        // of bean from the parameters, where a
                        // (case-insensitive) name match between the bean
                        // property and the parameter is looked for.
                        PropertyDescriptor[] beanProps = Introspector
                            .getBeanInfo(Class.forName(className))
                            .getPropertyDescriptors();
                       
                        boolean noMatch = true;
                        for (int j=beanProps.length-1; j>=0; j--)
                        {
                            if (propName
                                .equalsIgnoreCase(beanProps[j].getName()))
                            {
                                ((HashMap)getterMap.get(className))
                                    .put(propName, 
                                         beanProps[j].getReadMethod());
                                ((HashMap)setterMap.get(className))
                                    .put(propName, 
                                         beanProps[j].getWriteMethod());
                                noMatch = false;
                                break;
                            }
                        }
                        if ( noMatch )
                        {
                            Log.error("Field, " + field.getName() +
                                     ", has a property, " + propName +
                                     " for class, " + className +
                                     ", but the property could not be found.");
                        }
                    }
View Full Code Here

        fields = new HashMap((int)(1.25*size + 1));
        mapToObjectFields = new HashMap((int)(1.25*size + 1));
        fieldsArray = new Field[size];
        for (int i=size-1; i>=0; i--)
        {
            XmlField f = (XmlField)inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i]= field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List)mapToObjectFields.get(f.getMapToObject());
            if ( tmpFields == null )
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here

        fields = new HashMap((int)(1.25*size + 1));
        mapToObjectFields = new HashMap((int)(1.25*size + 1));
        fieldsArray = new Field[size];
        for (int i=size-1; i>=0; i--)
        {
            XmlField f = (XmlField)inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i]= field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List)mapToObjectFields.get(f.getMapToObject());
            if ( tmpFields == null )
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here

        fields = new HashMap((int) (1.25 * size + 1));
        mapToObjectFields = new HashMap((int) (1.25 * size + 1));
        fieldsArray = new Field[size];
        for (int i = size - 1; i >= 0; i--)
        {
            XmlField f = (XmlField) inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i] = field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List) mapToObjectFields.get(f.getMapToObject());
            if (tmpFields == null)
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here

        fields = new HashMap((int)(1.25*size + 1));
        mapToObjectFields = new HashMap((int)(1.25*size + 1));
        fieldsArray = new Field[size];
        for (int i=size-1; i>=0; i--)
        {
            XmlField f = (XmlField)inputFields.get(i);
            Field field = FieldFactory.getInstance(f, this);
            fieldsArray[i]= field;
            fields.put(f.getName(), field);

            // map fields by their mapToObject
            List tmpFields = (List)mapToObjectFields.get(f.getMapToObject());
            if ( tmpFields == null )
            {
                tmpFields = new ArrayList(size);
                mapToObjectFields.put(f.getMapToObject(), tmpFields);
            }
            tmpFields.add(field);
        }

        // Change the mapToObjectFields values to Field[]
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.intake.xmlmodel.XmlField

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.