com.openharbor.beck.marshal
Class CollectionMarshaller

java.lang.Object
  extended bycom.openharbor.beck.marshal.DefaultMarshaller
      extended bycom.openharbor.beck.marshal.CollectionMarshaller
All Implemented Interfaces:
Marshaller
Direct Known Subclasses:
InlineCollectionMarshaller, ListMarshaller

public class CollectionMarshaller
extends DefaultMarshaller


Nested Class Summary
static class CollectionMarshaller.Candidate
           
 
Field Summary
protected static Getter memberGetter
           
protected static XMLThing NO_TAG
          Indicates the absence of a tag (to writeAsElement).
 
Fields inherited from class com.openharbor.beck.marshal.DefaultMarshaller
log
 
Constructor Summary
CollectionMarshaller()
           
 
Method Summary
protected  void writeAsElement(MapToXML mapper, java.lang.Object parent, Getter getter, java.lang.Object source, XMLThing tag, XMLWriter writer)
          Map to XML elements from the source collection and its members.
protected  void writeMembers(MapToXML mapper, java.util.Collection source, XMLThing sourceTag, XMLWriter writer)
          Map the members of the given collection to XML elements.
 
Methods inherited from class com.openharbor.beck.marshal.DefaultMarshaller
getText, getXML, getXMLSource, marshal, marshalMember, writeNull, writeSimply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_TAG

protected static final XMLThing NO_TAG
Indicates the absence of a tag (to writeAsElement).


memberGetter

protected static final Getter memberGetter
Constructor Detail

CollectionMarshaller

public CollectionMarshaller()
Method Detail

writeAsElement

protected void writeAsElement(MapToXML mapper,
                              java.lang.Object parent,
                              Getter getter,
                              java.lang.Object source,
                              XMLThing tag,
                              XMLWriter writer)
                       throws java.lang.Exception
Map to XML elements from the source collection and its members. Normally there is an element for the collection, which contains an element for each member.

Overrides:
writeAsElement in class DefaultMarshaller
Parameters:
tag - the XML element corresponding to the collection, or NO_TAG to indicate that there is no such tag; in which case the members are marshalled 'in line', contained directly in the element copied from the parent object. NO_TAG is recognized by == not .equals; that is, it must be exactly the same object, not another object of equal value.
Throws:
java.lang.Exception

writeMembers

protected void writeMembers(MapToXML mapper,
                            java.util.Collection source,
                            XMLThing sourceTag,
                            XMLWriter writer)
                     throws java.lang.Exception
Map the members of the given collection to XML elements. Normally there is an element for each member.

Throws:
java.lang.Exception