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.js.JavaMethod; 20 import org.apache.ws.jaxme.js.JavaSource; 21 import org.xml.sax.SAXException ; 22 23 24 28 public class EmptyElementHandlerSG extends HandlerSGImpl { 29 32 public EmptyElementHandlerSG(ComplexTypeSG pType, JavaSource pJs) { 33 super(pType, pJs); 34 } 35 36 public JavaMethod newStartElementMethod() throws SAXException { 37 JavaMethod result = super.newStartElementMethod(); 38 result.addLine("return false;"); 39 return result; 40 } 41 42 public JavaMethod newIsFinishedMethod() throws SAXException { 43 JavaMethod jm = super.newIsFinishedMethod(); 44 jm.addLine("return true;"); 45 return jm; 46 } 47 48 public JavaMethod newIsEmptyMethod() throws SAXException { 49 JavaMethod jm = super.newIsEmptyMethod(); 50 jm.addLine("return ", ctSG.hasSimpleContent() ? "false" : "true", ";"); 51 return jm; 52 } 53 54 public JavaMethod newIsAtomicMethod() throws SAXException { 55 JavaMethod jm = super.newIsAtomicMethod(); 56 jm.addLine("return ", ctSG.hasSimpleContent() ? "true" : "false", ";"); 57 return jm; 58 } 59 } 60 | Popular Tags |