no.sesat.search.site.config
Class AbstractDocumentFactory

java.lang.Object
  extended by no.sesat.search.site.config.AbstractDocumentFactory
Direct Known Subclasses:
SearchModeFactory, SearchTabFactory

public abstract class AbstractDocumentFactory
extends Object

Utility class for deserialising from an xml document.

Version:
$Id: AbstractDocumentFactory.java 7225 2009-04-09 00:32:20Z ssmiweve $

Nested Class Summary
static class AbstractDocumentFactory.ParseType
           
 
Constructor Summary
protected AbstractDocumentFactory()
          Creates a new instance of AbstractDocumentFactory
 
Method Summary
static String beanToXmlName(String beanName)
          The words within the bean name are deduced assuming the first-letter-capital (for example camel's hump) naming convention.
static void fillBeanProperty(Object beanObj, Object beanParent, String property, AbstractDocumentFactory.ParseType type, Element element, String def)
          TODO implement Type.Property.
static boolean parseBoolean(String s, boolean def)
          try to use fillBeanProperty instead.
static float parseFloat(String s, float def)
          try to use fillBeanProperty instead.
static int parseInt(String s, int def)
          try to use fillBeanProperty instead.
static String parseString(String s, String def)
          try to use fillBeanProperty instead.
static String xmlToBeanName(String xmlName)
          The reverse transformation to beanToXmlName(string).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDocumentFactory

protected AbstractDocumentFactory()
Creates a new instance of AbstractDocumentFactory

Method Detail

fillBeanProperty

public static final void fillBeanProperty(Object beanObj,
                                          Object beanParent,
                                          String property,
                                          AbstractDocumentFactory.ParseType type,
                                          Element element,
                                          String def)
TODO implement Type.Property. *

Parameters:
beanObj -
beanParent -
property -
type -
element -
def -

beanToXmlName

public static String beanToXmlName(String beanName)

The words within the bean name are deduced assuming the first-letter-capital (for example camel's hump) naming convention. For example, the words in FooBar are foo and bar.

Then the #getSeparator property value is inserted so that it separates each word.

Parameters:
beanName - The name string to convert. If a JavaBean class name, should included only the last part of the name rather than the fully qualified name (e.g. FooBar rather than org.example.FooBar).
Returns:
the bean name converted to either upper or lower case with words separated by the separator.

xmlToBeanName

public static String xmlToBeanName(String xmlName)
The reverse transformation to beanToXmlName(string). *

Parameters:
xmlName -
Returns:

parseBoolean

public static final boolean parseBoolean(String s,
                                         boolean def)
try to use fillBeanProperty instead. *

Parameters:
s -
def -
Returns:

parseFloat

public static final float parseFloat(String s,
                                     float def)
try to use fillBeanProperty instead. *

Parameters:
s -
def -
Returns:

parseInt

public static final int parseInt(String s,
                                 int def)
try to use fillBeanProperty instead. *

Parameters:
s -
def -
Returns:

parseString

public static final String parseString(String s,
                                       String def)
try to use fillBeanProperty instead. *

Parameters:
s -
def -
Returns:


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.