common-util

local.tomas.common.xml.impl
Class CollectionTypeHandler

java.lang.Object
  extended by local.tomas.common.xml.XMLTypeHandler
      extended by local.tomas.common.xml.impl.DefaultTypeHandler
          extended by local.tomas.common.xml.impl.CollectionTypeHandler

public class CollectionTypeHandler
extends DefaultTypeHandler

Type handler for java.util.Collection.

Author:
tomas
See Also:
Collection

Field Summary
static String ELEMENT_FIELD
          Name of element field.
 
Fields inherited from class local.tomas.common.xml.XMLTypeHandler
arrayType, arrayTypeHandler, name, type
 
Constructor Summary
CollectionTypeHandler()
          Default constructor.
 
Method Summary
protected  void marshallPrefix(String name, int index, Class<?> type, Object src, XMLTokenGenerator gen)
          Generate start token.
protected  void marshallValue(Class type, Object src, XMLTokenGenerator gen)
          Generate XML description of object value.
 void setProperty(Object dest, String name, int index, Object value)
          Set property of an object.
 
Methods inherited from class local.tomas.common.xml.impl.DefaultTypeHandler
getArraySize, marshallArrayElements, setArrayElement
 
Methods inherited from class local.tomas.common.xml.XMLTypeHandler
getArrayType, getArrayTypeHandler, getName, getType, marshall, marshall, marshallNullPrefix, marshallNullSuffix, marshallRef, marshallSuffix, match, newArray, newInstance, newInstance, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_FIELD

public static final String ELEMENT_FIELD
Name of element field.

See Also:
Constant Field Values
Constructor Detail

CollectionTypeHandler

public CollectionTypeHandler()
Default constructor.

Method Detail

marshallValue

protected void marshallValue(Class type,
                             Object src,
                             XMLTokenGenerator gen)
                      throws XMLException
Description copied from class: XMLTypeHandler
Generate XML description of object value.

Overrides:
marshallValue in class DefaultTypeHandler
Parameters:
type - - object type
src - - the object
gen - - used to generate XML tokens
Throws:
XMLException

marshallPrefix

protected void marshallPrefix(String name,
                              int index,
                              Class<?> type,
                              Object src,
                              XMLTokenGenerator gen)
                       throws XMLException
Description copied from class: XMLTypeHandler
Generate start token.

Overrides:
marshallPrefix in class XMLTypeHandler
Parameters:
name - - token name
index - - index attribute, negative values are omitted
type - - value type
src - - value
gen - - used to generate XML tokens
Throws:
XMLException

setProperty

public void setProperty(Object dest,
                        String name,
                        int index,
                        Object value)
                 throws XMLException
Description copied from class: XMLTypeHandler
Set property of an object.

Overrides:
setProperty in class XMLTypeHandler
Parameters:
dest - - the object
name - - the property name
index - - a property index
value - - the new property value
Throws:
XMLException

common-util

Copyright © 2007 null. All Rights Reserved.