com.tonbeller.jpivot.table.span
Class PropertyUtils

java.lang.Object
  extended by com.tonbeller.jpivot.table.span.PropertyUtils

public class PropertyUtils
extends java.lang.Object

Handles nested Properties.

Example 1: src="x", href="y" becomes

 <property name="src" value="x"/>
 <property name="href" value="y"/>
 

Example 2: image="x", image.src="y", image.href="z" becomes

 <property name="image" value="x>
   <property name="src" value="y"/>
   <property name="href" value="z"/>
 </property>
 


Field Summary
static java.lang.String STYLE_PROPERTY
           
 
Method Summary
static void addInlineProperties(org.w3c.dom.Element target, Property[] properties)
          adds inline properties to caption and converts the property names to lower case.
static void addProperties(org.w3c.dom.Element target, Property[] properties)
          adds property children to the target element.
static Property getInlineProperty(Property[] props, java.lang.String name)
          returns the Inline Property with given name
static MemberPropertyMeta[] getRootMetas(MemberPropertyMeta[] metas)
          removes Metas that correspond to nested properties
static java.lang.String getRootName(java.lang.String propertyName)
          if propertyName denotes a nested property (i.e. contains the '.' delimiter), returns the name of the root property.
static boolean isInline(java.lang.String propertyName)
          true if name is rendered inline (e.g.
static boolean isNested(java.lang.String propertyName)
          true if name contains the delimiter '.'
static boolean isStyleProperty(java.lang.String propertyName)
           
static Property[] normalize(Property[] properties)
          creates nested properties where the hierarchy is derived by the property names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_PROPERTY

public static final java.lang.String STYLE_PROPERTY
See Also:
Constant Field Values
Method Detail

isNested

public static boolean isNested(java.lang.String propertyName)
true if name contains the delimiter '.'


getRootName

public static java.lang.String getRootName(java.lang.String propertyName)
if propertyName denotes a nested property (i.e. contains the '.' delimiter), returns the name of the root property.

Parameters:
propertyName - name of nested Property, e.g. "myName.image"
Returns:
name of root property, e.g. "myName"

isInline

public static boolean isInline(java.lang.String propertyName)
true if name is rendered inline (e.g. 'link', 'color', 'arrow')


isStyleProperty

public static boolean isStyleProperty(java.lang.String propertyName)

normalize

public static Property[] normalize(Property[] properties)
creates nested properties where the hierarchy is derived by the property names.


addProperties

public static void addProperties(org.w3c.dom.Element target,
                                 Property[] properties)
adds property children to the target element. If the name of a property contains the "." char, its treated specially (see below).


addInlineProperties

public static void addInlineProperties(org.w3c.dom.Element target,
                                       Property[] properties)
adds inline properties to caption and converts the property names to lower case.


getRootMetas

public static MemberPropertyMeta[] getRootMetas(MemberPropertyMeta[] metas)
removes Metas that correspond to nested properties

Parameters:
metas -
Returns:

getInlineProperty

public static Property getInlineProperty(Property[] props,
                                         java.lang.String name)
returns the Inline Property with given name

Parameters:
props - all properties
name - one of the names of the inline property
Returns:
null or the property