org.apache.ws.jaxme.generator.sg.impl.ccsg
Class GroupHandlerSG

java.lang.Object
  extended by org.apache.ws.jaxme.generator.sg.impl.ccsg.HandlerSGImpl
      extended by org.apache.ws.jaxme.generator.sg.impl.ccsg.GroupHandlerSG
All Implemented Interfaces:
HandlerSG
Direct Known Subclasses:
AllHandlerSG, ChoiceHandlerSG, SequenceHandlerSG

public abstract class GroupHandlerSG
extends HandlerSGImpl

An instance of GroupHandlerSG is responsible for creating an instance of JMSAXGroupParser, or JMSAXElementParser.
The ComplexContentSG creates a GroupHandlerSG for any group, contained in the element.


Field Summary
protected  ComplexContentSG ccSG
           
protected  GroupSG group
           
protected  GroupHandlerSG outerHandler
           
protected  ParticleSG particle
           
protected  ParticleSG[] particles
           
 
Fields inherited from class org.apache.ws.jaxme.generator.sg.impl.ccsg.HandlerSGImpl
ctSG
 
Constructor Summary
protected GroupHandlerSG(ComplexTypeSG pType, JavaSource pJs)
          Creates a new instance, which generates a handler for the complex type pTypeSG by adding methods and fields to the Java class pJs.
protected GroupHandlerSG(GroupHandlerSG pOuterHandler, ComplexTypeSG pType, ParticleSG pParticle, JavaSource pJs)
          Creates a new instance, which generates a handler for the group pGroupSG by adding methods and fields to the Java class pJs.
 
Method Summary
protected abstract  void acceptParticle(JavaMethod pJm, int pNum)
           
 void generate()
          Invokes the various "newFooMethod" methods.
protected abstract  DirectAccessible getEndElementState()
           
protected  GroupHandlerSG getGroupHandlerSG(GroupSG pGroup)
           
protected abstract  int getState(int pParticleNum)
           
protected  JavaField getStateField()
           
protected  void handleStartElementStates(java.lang.Object pUnmarshallerHandler, JavaMethod pJm, int pFrom, int pTo)
           
protected  void handleStartOfChildElement(java.lang.Object pUnmarshallerHandler, JavaMethod pJm, ParticleSG pParticle)
           
protected  boolean isRequiredParticle(ParticleSG particleSG)
           
 JavaMethod newAddAttributeMethod()
          Creates the handlers method JMSAXElementParser.addAttribute(String, String, String).
protected  JavaMethod newAddTextMethod()
           
 JavaMethod newEndElementMethod()
          Creates the handlers method JMSAXGroupParser.endElement(String, String, String, Object).
 JavaMethod newIsAtomicMethod()
          Creates the handlers method JMSAXElementParser.isAtomic().
 JavaMethod newIsEmptyMethod()
          Creates the handlers method JMSAXElementParser.isEmpty().
 JavaMethod newIsFinishedMethod()
          Creates the handlers method JMSAXGroupParser.isFinished().
protected  JavaMethod newIsMixedMethod()
           
protected abstract  JavaField newStateField()
           
 
Methods inherited from class org.apache.ws.jaxme.generator.sg.impl.ccsg.HandlerSGImpl
createSimpleTypeConversion, getJavaSource, getParamAttrs, getParamLocalName, getParamNamespaceURI, getParamQName, getParamResult, newStartElementMethod, setParamAttrs, setParamLocalName, setParamNamespaceURI, setParamQName, setParamResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ccSG

protected final ComplexContentSG ccSG

particle

protected final ParticleSG particle

group

protected final GroupSG group

particles

protected final ParticleSG[] particles

outerHandler

protected final GroupHandlerSG outerHandler
Constructor Detail

GroupHandlerSG

protected GroupHandlerSG(ComplexTypeSG pType,
                         JavaSource pJs)
                  throws org.xml.sax.SAXException
Creates a new instance, which generates a handler for the complex type pTypeSG by adding methods and fields to the Java class pJs.

Throws:
org.xml.sax.SAXException

GroupHandlerSG

protected GroupHandlerSG(GroupHandlerSG pOuterHandler,
                         ComplexTypeSG pType,
                         ParticleSG pParticle,
                         JavaSource pJs)
                  throws org.xml.sax.SAXException
Creates a new instance, which generates a handler for the group pGroupSG by adding methods and fields to the Java class pJs.

Throws:
org.xml.sax.SAXException
Method Detail

newStateField

protected abstract JavaField newStateField()
                                    throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getStateField

protected JavaField getStateField()
                           throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getGroupHandlerSG

protected GroupHandlerSG getGroupHandlerSG(GroupSG pGroup)

newAddAttributeMethod

public JavaMethod newAddAttributeMethod()
                                 throws org.xml.sax.SAXException
Description copied from interface: HandlerSG
Creates the handlers method JMSAXElementParser.addAttribute(String, String, String).

Specified by:
newAddAttributeMethod in interface HandlerSG
Overrides:
newAddAttributeMethod in class HandlerSGImpl
Throws:
org.xml.sax.SAXException

isRequiredParticle

protected boolean isRequiredParticle(ParticleSG particleSG)
                              throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

handleStartOfChildElement

protected void handleStartOfChildElement(java.lang.Object pUnmarshallerHandler,
                                         JavaMethod pJm,
                                         ParticleSG pParticle)

acceptParticle

protected abstract void acceptParticle(JavaMethod pJm,
                                       int pNum)
                                throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

handleStartElementStates

protected void handleStartElementStates(java.lang.Object pUnmarshallerHandler,
                                        JavaMethod pJm,
                                        int pFrom,
                                        int pTo)
                                 throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getState

protected abstract int getState(int pParticleNum)

getEndElementState

protected abstract DirectAccessible getEndElementState()
                                                throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

newEndElementMethod

public JavaMethod newEndElementMethod()
                               throws org.xml.sax.SAXException
Description copied from interface: HandlerSG
Creates the handlers method JMSAXGroupParser.endElement(String, String, String, Object).

Specified by:
newEndElementMethod in interface HandlerSG
Overrides:
newEndElementMethod in class HandlerSGImpl
Throws:
org.xml.sax.SAXException

newIsFinishedMethod

public JavaMethod newIsFinishedMethod()
                               throws org.xml.sax.SAXException
Description copied from interface: HandlerSG
Creates the handlers method JMSAXGroupParser.isFinished().

Specified by:
newIsFinishedMethod in interface HandlerSG
Overrides:
newIsFinishedMethod in class HandlerSGImpl
Throws:
org.xml.sax.SAXException

newIsAtomicMethod

public JavaMethod newIsAtomicMethod()
                             throws org.xml.sax.SAXException
Description copied from interface: HandlerSG
Creates the handlers method JMSAXElementParser.isAtomic().

Specified by:
newIsAtomicMethod in interface HandlerSG
Overrides:
newIsAtomicMethod in class HandlerSGImpl
Throws:
org.xml.sax.SAXException

newIsEmptyMethod

public JavaMethod newIsEmptyMethod()
                            throws org.xml.sax.SAXException
Description copied from interface: HandlerSG
Creates the handlers method JMSAXElementParser.isEmpty().

Specified by:
newIsEmptyMethod in interface HandlerSG
Overrides:
newIsEmptyMethod in class HandlerSGImpl
Throws:
org.xml.sax.SAXException

newIsMixedMethod

protected JavaMethod newIsMixedMethod()
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

newAddTextMethod

protected JavaMethod newAddTextMethod()
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

generate

public void generate()
              throws org.xml.sax.SAXException
Description copied from interface: HandlerSG
Invokes the various "newFooMethod" methods.

Specified by:
generate in interface HandlerSG
Overrides:
generate in class HandlerSGImpl
Throws:
org.xml.sax.SAXException