com.groiss.gui.velocity
Class Formatter

java.lang.Object
  extended by com.groiss.gui.velocity.Formatter

public class Formatter
extends java.lang.Object

a utility class for formatting objects in Velocity-templates


Constructor Summary
Formatter()
           
 
Method Summary
static java.lang.String encodeURL(java.lang.String url)
           
static NumberFormat getDecimalFormat()
           
static java.lang.String getDisplayValue(DMSForm f, java.lang.String field)
           
static Formatter getInstance()
          returns a singleton instance
static java.lang.String htmlEncode(java.lang.Object str)
           
static boolean isEmpty(java.lang.String str)
           
static boolean isNotEmpty(java.lang.String str)
           
static java.lang.String showDate(java.lang.Object date)
           
static java.lang.String showDateTime(java.lang.Object date)
           
static java.lang.String toClassnameOid(Persistent p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Formatter

public Formatter()
Method Detail

getInstance

public static Formatter getInstance()
returns a singleton instance

Returns:
the singleton instance

showDate

public static java.lang.String showDate(java.lang.Object date)
Parameters:
date - the date
Returns:
CalUtil.showDate(Object)

showDateTime

public static java.lang.String showDateTime(java.lang.Object date)
Parameters:
date - the date
Returns:
CalUtil.showDateTime(Object)

getDecimalFormat

public static NumberFormat getDecimalFormat()
Returns:
Settings.getDecimalFormatter()

toClassnameOid

public static java.lang.String toClassnameOid(Persistent p)
Parameters:
p - the persistent
Returns:
StoreUtil.toString(Persistent)

htmlEncode

public static java.lang.String htmlEncode(java.lang.Object str)
Parameters:
str - the string
Returns:
StringUtil.htmlEncode(Object)

isEmpty

public static boolean isEmpty(java.lang.String str)
Parameters:
str - the string
Returns:
StringUtil.isEmpty(String)

isNotEmpty

public static boolean isNotEmpty(java.lang.String str)
Parameters:
str - the string
Returns:
StringUtil.isNotEmpty(String)

encodeURL

public static java.lang.String encodeURL(java.lang.String url)
Parameters:
url - the url
Returns:
StringUtil.encodeURL(String)

getDisplayValue

public static java.lang.String getDisplayValue(DMSForm f,
                                               java.lang.String field)
Parameters:
f - the form
field - the fieldname
Returns:
HTMLUtils.getDisplayValue(DMSForm, String)


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.