Package net.freedom.gj.beans.mapper

Examples of net.freedom.gj.beans.mapper.MappingData


        return mappingInformation;
    }

    private void handleCollection(BufferedReader reader,String line, List<MappingData>list ) throws Exception{
        MappingData data = new MappingData();
        data.setCollection(true);
        data.setCollectionObjectType(resolveKey("type=\"","\"",line));
        data.setSourceExpression(resolveKey("source=\"", "\"", line));
        data.setTargetExpression(resolveKey("target=\"", "\"", line));
         List<MappingData> coll = new ArrayList<MappingData>();
         while( (line = reader.readLine()) != null && !line.contains("</collection>") ) {
            coll.add(getMappingData(line));
         }
         data.setCollectionMappingData(coll);
         list.add(data);
    }
View Full Code Here


         info.setPostProcessors(coll);
    }


    private MappingData getMappingData(String conf) throws Exception {
        MappingData data = new MappingData();
        data.setSourceExpression(resolveKey("source=\"", "\"", conf));
        data.setTargetExpression(resolveKey("target=\"", "\"", conf));
        String converter = resolveKey("converter=\"", "\"", conf);
        if (converter != null) {           
            Converter instance = getConverter(converter);
            data.setConverter(instance);
        }
        return data;
    }
View Full Code Here

           }
        }
        @Override
        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
            if (qName.equals("bind")) {
                MappingData d = new MappingData();
                d.setSourceExpression(attributes.getValue("source"));
                d.setTargetExpression(attributes.getValue("target"));
                d.setConverter(getConverter( attributes.getValue("converter")  ));
               
                if( collectionData != null )
                    collectionData.getCollectionMappingData().add(d);
                else
                    mappingInformation.getMappingData().add(d);

            }else if( qName.equals("collection") ){
                collectionData = new MappingData();
                collectionData.setCollection(true);
                collectionData.setSourceExpression(attributes.getValue("source"));
                collectionData.setTargetExpression(attributes.getValue("target"));
                collectionData.setCollectionObjectType(attributes.getValue("type"));
                collectionData.setCollectionMappingData(new ArrayList<MappingData>());
View Full Code Here

TOP

Related Classes of net.freedom.gj.beans.mapper.MappingData

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.