org.apache.myfaces.buildtools.maven2.plugin.builder.model
Class ModelUtils

java.lang.Object
  extended by org.apache.myfaces.buildtools.maven2.plugin.builder.model.ModelUtils

public class ModelUtils
extends Object

Simple static helper methods.


Constructor Summary
ModelUtils()
           
 
Method Summary
static Boolean defaultOf(Boolean val, boolean dflt)
          Return a default value if a boolean property is null.
static Boolean merge(Boolean curr, Boolean inherited)
          Inherit setting only if current one is empty.
static Object merge(Object curr, Object inherited)
          Inherit setting only if current one is empty.
static String merge(String curr, String inherited)
          Inherit setting only if current one is empty.
static void mergeAttributes(AttributeHolder dst, AttributeHolder src)
           
static void mergeFacets(FacetHolder dst, FacetHolder src)
           
static void mergeListeners(ListenerHolder dst, ListenerHolder src)
           
static void mergeProps(PropertyHolder dst, PropertyHolder src)
          Given two JSF artifacts that can have associated user-settable properties, merge all the properties one one into the other.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelUtils

public ModelUtils()
Method Detail

merge

public static String merge(String curr,
                           String inherited)
Inherit setting only if current one is empty.


merge

public static Object merge(Object curr,
                           Object inherited)
Inherit setting only if current one is empty.


merge

public static Boolean merge(Boolean curr,
                            Boolean inherited)
Inherit setting only if current one is empty.


defaultOf

public static Boolean defaultOf(Boolean val,
                                boolean dflt)
Return a default value if a boolean property is null.


mergeProps

public static void mergeProps(PropertyHolder dst,
                              PropertyHolder src)
Given two JSF artifacts that can have associated user-settable properties, merge all the properties one one into the other.

The dst object is expected to be a "child" of the src object. Any data on dst therefore overrides stuff on src, but otherwise everything on src gets copied to dst.


mergeFacets

public static void mergeFacets(FacetHolder dst,
                               FacetHolder src)

mergeListeners

public static void mergeListeners(ListenerHolder dst,
                                  ListenerHolder src)
Parameters:
dst -
src -
Since:
1.0.4

mergeAttributes

public static void mergeAttributes(AttributeHolder dst,
                                   AttributeHolder src)
Since:
1.0.4


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.