net.sf.hibernate.tool.hbm2java
Class MetaAttributeHelper

java.lang.Object
  extended by net.sf.hibernate.tool.hbm2java.MetaAttributeHelper

public class MetaAttributeHelper
extends Object

Helper for loading, merging and accessing tags.

Author:
max

Constructor Summary
MetaAttributeHelper()
           
 
Method Summary
static void copyMultiMap(org.apache.commons.collections.MultiMap destination, org.apache.commons.collections.MultiMap source)
          Copies all the values from one MultiMap to another.
static String getMetaAsString(Collection meta, String seperator)
           
static org.apache.commons.collections.MultiMap loadAndMergeMetaMap(org.jdom.Element classElement, org.apache.commons.collections.MultiMap inheritedMeta)
          Method loadAndMergeMetaMap.
protected static org.apache.commons.collections.MultiMap loadMetaMap(org.jdom.Element element)
          Load meta attributes from jdom element into a MultiMap.
static org.apache.commons.collections.MultiMap mergeMetaMaps(org.apache.commons.collections.MultiMap local, org.apache.commons.collections.MultiMap inherited)
          Merges a Multimap with inherited maps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaAttributeHelper

public MetaAttributeHelper()
Method Detail

loadMetaMap

protected static org.apache.commons.collections.MultiMap loadMetaMap(org.jdom.Element element)
Load meta attributes from jdom element into a MultiMap.

Parameters:
element -
Returns:
MultiMap

mergeMetaMaps

public static org.apache.commons.collections.MultiMap mergeMetaMaps(org.apache.commons.collections.MultiMap local,
                                                                    org.apache.commons.collections.MultiMap inherited)
Merges a Multimap with inherited maps. Values specified always overrules/replaces the inherited values.

Parameters:
local -
inherited -
Returns:
a MultiMap with all values from local and extra values from inherited

loadAndMergeMetaMap

public static org.apache.commons.collections.MultiMap loadAndMergeMetaMap(org.jdom.Element classElement,
                                                                          org.apache.commons.collections.MultiMap inheritedMeta)
Method loadAndMergeMetaMap.

Parameters:
classElement -
inheritedMeta -
Returns:
MultiMap

getMetaAsString

public static String getMetaAsString(Collection meta,
                                     String seperator)
Parameters:
collection -
string -

copyMultiMap

public static void copyMultiMap(org.apache.commons.collections.MultiMap destination,
                                org.apache.commons.collections.MultiMap source)
Copies all the values from one MultiMap to another. This method is needed because the (undocumented) behaviour of MultiHashMap.putAll in versions of Commons Collections prior to 3.0 was to replace the collection in the destination, whereas in 3.0 it adds the collection from the source as an _element_ of the collection in the destination. This method makes no assumptions about the implementation of the MultiMap, and should work with all versions.

Parameters:
destination -
source -