Dashboard Builder Data Provider API 6.0.0.CR5

org.jboss.dashboard.provider
Interface DataPropertyFormatter


public interface DataPropertyFormatter

Data property formatter.


Method Summary
 String formatName(DataProperty dp, Locale l)
           
 String formatName(String propertyId, Locale l)
           
 String formatValue(DataProperty property, Object value, Locale l)
           
 String formatValue(String propertyId, Object value, Locale l)
          Formats a value for a given property.
 Class getPropertyClass(DataProperty property)
           
 String[] getSupportedPropertyIds()
          Get the set of property ids this formatter is addressed to.
 Object parsePropertyValue(Class type, String value)
          Parses a given string and returns a instance representing the java object value.
 Object parsePropertyValue(DataProperty property, String value)
          Parses a given string and returns a instance representing the java object value.
 

Method Detail

getSupportedPropertyIds

String[] getSupportedPropertyIds()
Get the set of property ids this formatter is addressed to.

Returns:
null if this is a general purpose formatter.

getPropertyClass

Class getPropertyClass(DataProperty property)

formatName

String formatName(DataProperty dp,
                  Locale l)

formatName

String formatName(String propertyId,
                  Locale l)

formatValue

String formatValue(DataProperty property,
                   Object value,
                   Locale l)

formatValue

String formatValue(String propertyId,
                   Object value,
                   Locale l)
Formats a value for a given property.

The default formatting technique applied is quite simple. The value instance class (Integer, Long, Boolean, Date, ...) is used to format the value as string. The following list it shows which formatting mechanism is applied for a given value class:


parsePropertyValue

Object parsePropertyValue(DataProperty property,
                          String value)
                          throws Exception
Parses a given string and returns a instance representing the java object value.

Throws:
Exception

parsePropertyValue

Object parsePropertyValue(Class type,
                          String value)
                          throws Exception
Parses a given string and returns a instance representing the java object value.

Throws:
Exception

Dashboard Builder Data Provider API 6.0.0.CR5

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.