private static void generateParserOnXmlCharacters ( BindTypeContext context , MethodSpec . Builder methodBuilder , String instanceName , String parserName , BindEntity entity ) { BindTransform bindTransform ; int count = 0 ; for ( BindProperty property : entity . getCollection ( ) ) { if ( property . xmlInfo . xmlType != XmlType . VALUE && property . xmlInfo . xmlType != XmlType . VALUE_CDATA ) continue ; count ++ ; methodBuilder . beginControlFlow ( "if (elementName!=null && $L.hasText())" , parserName ) ; methodBuilder . addCode ( "// property $L\n" , property . getName ( ) ) ; bindTransform = BindTransformer . lookup ( property ) ; bindTransform . generateParseOnXml ( context , methodBuilder , parserName , property . getPropertyType ( ) . getTypeName ( ) , "instance" , property ) ; methodBuilder . endControlFlow ( ) ; } if ( count == 0 ) { methodBuilder . addCode ( "// no property is binded to VALUE o CDATA " ) ; } }
Parse entity properties and write code to read only CData Text fields .