1 16 package org.apache.ws.jaxme.generator.sg.impl.ccsg; 17 18 import org.apache.ws.jaxme.generator.sg.ComplexTypeSG; 19 import org.apache.ws.jaxme.generator.sg.SimpleContentSG; 20 import org.apache.ws.jaxme.js.JavaMethod; 21 import org.apache.ws.jaxme.js.JavaQName; 22 import org.apache.ws.jaxme.js.JavaSource; 23 import org.apache.ws.jaxme.js.LocalJavaField; 24 import org.apache.ws.jaxme.js.TypedValue; 25 import org.xml.sax.SAXException ; 26 27 28 32 public class SimpleContentHandlerSG extends EmptyElementHandlerSG { 33 36 public SimpleContentHandlerSG(ComplexTypeSG pType, JavaSource pJs) { 37 super(pType, pJs); 38 } 39 40 public JavaMethod newEndElementMethod() throws SAXException { 41 JavaMethod result = super.newEndElementMethod(); 42 JavaQName elementInterface = ctSG.getClassContext().getXMLInterfaceName(); 43 LocalJavaField element = result.newJavaField(elementInterface); 44 element.addLine("(", elementInterface, ") result"); 45 SimpleContentSG scSG = ctSG.getSimpleContentSG(); 46 TypedValue tv = createSimpleTypeConversion(result, scSG.getContentTypeSG(), 47 getParamResult(), scSG.getPropertySG().getPropertyName()); 48 scSG.getPropertySG().addValue(result, element, tv, null); 49 return result; 50 } 51 } 52 | Popular Tags |