thinkmap.xmlconfig
Interface ITypeConverter


public interface ITypeConverter

An interface for converting strings in an XML file into java objects.

Version:
$Revision $

Method Summary
 XObject convertToType(Assembler assembler, String s, Class<?> c, Class<?> context, ConfigElement currentTag)
          Convert the string to the given type.
 void init(Namespace ns)
          Intialize this type converter.
 

Method Detail

init

void init(Namespace ns)
Intialize this type converter.

Parameters:
ns - the Namespace that owns this type converter.

convertToType

XObject convertToType(Assembler assembler,
                      String s,
                      Class<?> c,
                      Class<?> context,
                      ConfigElement currentTag)
                      throws Exception
Convert the string to the given type.

Parameters:
s - the string to convert
c - the type to convert to
context - the class that the resultant object will be set on. (may be null)
currentTag - the current element being parsed, this is useful for reporting errors, getting the current line number, etc.
Returns:
the converted object
Throws:
Exception - if the string cannot be converted


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.