|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.skaringa.javaxml.serializers.SerializerRegistry
public final class SerializerRegistry
Registry that holds the serializers. It is implemented using the singleton pattern.
Method Summary | |
---|---|
void |
addSerializer(java.lang.String className,
ComponentSerializer ser)
Add a serializer to the registry. |
ComponentSerializer |
findDeserializer(java.lang.Object parent,
java.lang.String elementName)
Try to find a deserializer if no xsi:type attribute is available. |
ComponentSerializer |
getDeserializer(java.lang.String elementName,
org.xml.sax.Attributes attrs,
java.lang.ClassLoader classLoader)
Get a deserializer for an xml element. |
static SerializerRegistry |
getInstance()
Get the one instance of the SerializerRegistry. |
ComponentSerializer |
getSerializer(java.lang.Class type)
Get a serializer for a type. |
ComponentSerializer |
guessDeserializerForNumber(java.lang.String s)
Guess the deserializer for a number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SerializerRegistry getInstance()
public void addSerializer(java.lang.String className, ComponentSerializer ser)
className
- The name of the class which should be handled by the
serializer.ser
- The serializer.public ComponentSerializer getSerializer(java.lang.Class type)
type
- The type.
public ComponentSerializer getDeserializer(java.lang.String elementName, org.xml.sax.Attributes attrs, java.lang.ClassLoader classLoader) throws DeserializerException
elementName
- The name of the element.attrs
- The attributes of the element.classLoader
- The class loader used to load new classes.
DeserializerException
- If the deserializer can't be found.public ComponentSerializer findDeserializer(java.lang.Object parent, java.lang.String elementName) throws DeserializerException
parent
- The parent object.elementName
- The name of the element.
DeserializerException
- If the deserializer can't be found.public ComponentSerializer guessDeserializerForNumber(java.lang.String s) throws DeserializerException
s
- The number as String.
DeserializerException
- If the argument is not a number.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |