com.openindex.openestate.impl
Class OpenEstateUtils

java.lang.Object
  extended by com.openindex.openestate.impl.OpenEstateUtils

public class OpenEstateUtils
extends Object

Hilfsfunktionen für OpenEstate-XML.
$Id: OpenEstateUtils.java 1829 2012-10-14 14:24:52Z andy $

Author:
Andreas Rudolph

Field Summary
static Locale DEFAULT_LOCALE
           
static String OPENESTATE_ENCODING
           
static String OPENESTATE_NAMESPACE
           
static String OPENESTATE_VERSION
           
static String RESOURCE_PATH
           
 
Method Summary
static Locale buildLocale(String code)
           
static String convertToIso2Country(String iso3Country)
           
static String convertToIso3Country(String iso2Country)
           
static String[] getAllEstateSubtypes(OpenEstateType type)
           
static OpenEstateAttrib getAvailableAttribute(String key)
           
static String[] getAvailableAttributes()
           
static Locale[] getAvailableLocales()
           
static String[] getEstateTypePath(OpenEstateType type)
           
static OpenEstateType[] getEstateTypesOnRoot()
           
static ImageIcon getFlagIcon(Locale locale)
           
static ImageIcon getFlagIcon(String code)
           
static ResourceBundle getResources(Locale locale)
           
static String getSerializationLineBreak()
           
static DateFormat getXsdDateFormat()
           
static DateFormat getXsdDateTimeFormat()
           
static DateFormat getXsdTimeFormat()
           
static String hash(String value)
           
static String hash(String value, String method)
           
static void init()
           
static File initLogging()
           
static org.dom4j.Document loadDocument(InputStream in)
           
static org.dom4j.Document loadDocument(Reader in)
           
static org.dom4j.Document loadDocumentFromResource(String res)
           
static org.dom4j.Document loadDocumentFromXmlString(String xml)
           
static Map<String,OpenEstateTranslator> loadTranslatorsByLanguage()
           
static String makeCamelCase(String txt)
           
static String makeUnCamelCase(String txt)
           
static String parseString(String value)
           
static String readResource(String path)
           
static void registerAttrib(OpenEstateAttrib attrib)
           
static String serializeString(String value)
           
static String serializeString(String value, String nl)
           
static void serializeToXML(SerializableXmlElement element, Writer out, boolean prettyPrint)
           
static void serializeToXML(SerializableXmlElement element, Writer out, boolean prettyPrint, String encoding)
           
static void serializeToXML(SerializableXmlElement element, Writer out, boolean prettyPrint, String encoding, String lineBreak)
           
static String translate(String key)
           
static String translate(String key, Locale locale)
           
static String translate(String key, String defaultValue)
           
static String translate(String key, String defaultValue, Locale locale)
           
static String translateAction(String action)
           
static String translateAction(String action, Locale locale)
           
static String translateAttachment(String type)
           
static String translateAttachment(String type, Locale locale)
           
static String translateAttribute(String group)
           
static String translateAttribute(String group, Locale locale)
           
static String translateAttribute(String group, String attrib)
           
static String translateAttribute(String group, String attrib, Locale locale)
           
static String translateAttribute(String group, String attrib, String value)
           
static String translateAttribute(String group, String attrib, String value, Locale locale)
           
static String translateAttributeByCountry(String group, Locale locale, String country)
           
static String translateAttributeByCountry(String group, String attrib, Locale locale, String country)
           
static String translateAttributeByCountry(String group, String attrib, String value, Locale locale, String country)
           
static String translateConst(String key)
           
static String translateConst(String key, Locale locale)
           
static String translateEstate(String estate)
           
static String translateEstate(String estate, Locale locale)
           
static String writeException(Throwable ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_PATH

public static final String RESOURCE_PATH
See Also:
Constant Field Values

OPENESTATE_ENCODING

public static final String OPENESTATE_ENCODING
See Also:
Constant Field Values

OPENESTATE_NAMESPACE

public static final String OPENESTATE_NAMESPACE
See Also:
Constant Field Values

OPENESTATE_VERSION

public static final String OPENESTATE_VERSION
See Also:
Constant Field Values

DEFAULT_LOCALE

public static final Locale DEFAULT_LOCALE
Method Detail

buildLocale

public static Locale buildLocale(String code)

convertToIso2Country

public static String convertToIso2Country(String iso3Country)

convertToIso3Country

public static String convertToIso3Country(String iso2Country)

getAllEstateSubtypes

public static String[] getAllEstateSubtypes(OpenEstateType type)
                                     throws OpenEstateException
Throws:
OpenEstateException

getAvailableAttribute

public static OpenEstateAttrib getAvailableAttribute(String key)

getAvailableAttributes

public static String[] getAvailableAttributes()

getAvailableLocales

public static Locale[] getAvailableLocales()

getEstateTypePath

public static String[] getEstateTypePath(OpenEstateType type)
                                  throws OpenEstateException
Throws:
OpenEstateException

getEstateTypesOnRoot

public static OpenEstateType[] getEstateTypesOnRoot()
                                             throws OpenEstateException
Throws:
OpenEstateException

getFlagIcon

public static ImageIcon getFlagIcon(Locale locale)

getFlagIcon

public static ImageIcon getFlagIcon(String code)

getResources

public static ResourceBundle getResources(Locale locale)

getSerializationLineBreak

public static String getSerializationLineBreak()

getXsdDateFormat

public static DateFormat getXsdDateFormat()

getXsdDateTimeFormat

public static DateFormat getXsdDateTimeFormat()

getXsdTimeFormat

public static DateFormat getXsdTimeFormat()

hash

public static String hash(String value)
                   throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

hash

public static String hash(String value,
                          String method)
                   throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

initLogging

public static File initLogging()
                        throws IOException,
                               ParserConfigurationException,
                               SAXException
Throws:
IOException
ParserConfigurationException
SAXException

loadDocument

public static org.dom4j.Document loadDocument(Reader in)
                                       throws org.dom4j.DocumentException
Throws:
org.dom4j.DocumentException

loadDocument

public static org.dom4j.Document loadDocument(InputStream in)
                                       throws org.dom4j.DocumentException
Throws:
org.dom4j.DocumentException

loadDocumentFromResource

public static org.dom4j.Document loadDocumentFromResource(String res)
                                                   throws org.dom4j.DocumentException
Throws:
org.dom4j.DocumentException

loadDocumentFromXmlString

public static org.dom4j.Document loadDocumentFromXmlString(String xml)
                                                    throws org.dom4j.DocumentException
Throws:
org.dom4j.DocumentException

loadTranslatorsByLanguage

public static Map<String,OpenEstateTranslator> loadTranslatorsByLanguage()
                                                                  throws IOException
Throws:
IOException

init

public static void init()

makeCamelCase

public static String makeCamelCase(String txt)

makeUnCamelCase

public static String makeUnCamelCase(String txt)

parseString

public static String parseString(String value)

readResource

public static String readResource(String path)
                           throws IOException
Throws:
IOException

registerAttrib

public static void registerAttrib(OpenEstateAttrib attrib)

serializeString

public static String serializeString(String value)

serializeString

public static String serializeString(String value,
                                     String nl)

serializeToXML

public static void serializeToXML(SerializableXmlElement element,
                                  Writer out,
                                  boolean prettyPrint)
                           throws IOException,
                                  org.dom4j.DocumentException
Throws:
IOException
org.dom4j.DocumentException

serializeToXML

public static void serializeToXML(SerializableXmlElement element,
                                  Writer out,
                                  boolean prettyPrint,
                                  String encoding)
                           throws IOException,
                                  org.dom4j.DocumentException
Throws:
IOException
org.dom4j.DocumentException

serializeToXML

public static void serializeToXML(SerializableXmlElement element,
                                  Writer out,
                                  boolean prettyPrint,
                                  String encoding,
                                  String lineBreak)
                           throws IOException,
                                  org.dom4j.DocumentException
Throws:
IOException
org.dom4j.DocumentException

translate

public static String translate(String key)

translate

public static String translate(String key,
                               String defaultValue)

translate

public static String translate(String key,
                               Locale locale)

translate

public static String translate(String key,
                               String defaultValue,
                               Locale locale)

translateAction

public static String translateAction(String action)

translateAction

public static String translateAction(String action,
                                     Locale locale)

translateAttachment

public static String translateAttachment(String type)

translateAttachment

public static String translateAttachment(String type,
                                         Locale locale)

translateAttribute

public static String translateAttribute(String group)

translateAttribute

public static String translateAttribute(String group,
                                        Locale locale)

translateAttribute

public static String translateAttribute(String group,
                                        String attrib)

translateAttribute

public static String translateAttribute(String group,
                                        String attrib,
                                        Locale locale)

translateAttribute

public static String translateAttribute(String group,
                                        String attrib,
                                        String value)

translateAttribute

public static String translateAttribute(String group,
                                        String attrib,
                                        String value,
                                        Locale locale)

translateAttributeByCountry

public static String translateAttributeByCountry(String group,
                                                 Locale locale,
                                                 String country)

translateAttributeByCountry

public static String translateAttributeByCountry(String group,
                                                 String attrib,
                                                 Locale locale,
                                                 String country)

translateAttributeByCountry

public static String translateAttributeByCountry(String group,
                                                 String attrib,
                                                 String value,
                                                 Locale locale,
                                                 String country)

translateConst

public static String translateConst(String key)

translateConst

public static String translateConst(String key,
                                    Locale locale)

translateEstate

public static String translateEstate(String estate)

translateEstate

public static String translateEstate(String estate,
                                     Locale locale)

writeException

public static String writeException(Throwable ex)


Copyright © 2012 OpenEstate. All Rights Reserved.