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

java.lang.Object
  extended by org.apache.myfaces.buildtools.maven2.plugin.builder.model.WebConfigMeta
All Implemented Interfaces:
WebConfigParamHolder

public class WebConfigMeta
extends Object
implements WebConfigParamHolder

Since:
1.0.4
Version:
$Revision: 796607 $ $Date: 2009-07-21 22:00:30 -0500 (mar, 21 jul 2009) $
Author:
Leonardo Uribe (latest modification by $Author: lu4242 $)

Field Summary
protected  Map _webConfigParameters
           
 
Constructor Summary
WebConfigMeta()
          Constructor.
 
Method Summary
 void addWebConfigParam(WebConfigParamMeta wcp)
           
static void addXmlRules(org.apache.commons.digester.Digester digester, String prefix)
          Add digester rules to repopulate an instance of this type from an xml file.
 String getModelId()
          Indicates which "group" of metadata this class belongs to.
 WebConfigParamMeta getWebConfigParam(String name)
           
 Collection getWebConfigParametersList()
           
protected  void merge(ClassMeta other)
          Merge any inheritable data from the specified "other" instance into the metadata held by this instance.
 void setModelId(String modelId)
           
 Iterator webConfigParameters()
           
 int webConfigParametersSize()
           
protected  void writeXml(XmlWriter out)
          Write the properties of this instance out as xml.
protected  void writeXmlComplex(XmlWriter out)
          See documentation for writeXml and writeXmlSimple methods.
protected  void writeXmlSimple(XmlWriter out)
          Write this model out as xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_webConfigParameters

protected Map _webConfigParameters
Constructor Detail

WebConfigMeta

public WebConfigMeta()
Constructor. Param xmlElementName is the name of the xml element that is created when method writeXml is invoked.

Method Detail

addXmlRules

public static void addXmlRules(org.apache.commons.digester.Digester digester,
                               String prefix)
Add digester rules to repopulate an instance of this type from an xml file.


writeXml

protected void writeXml(XmlWriter out)
Write the properties of this instance out as xml.

The name of the xml element that is created to hold the properties was specified when the constructor was called.

Subclasses that want to output their own properties should not override this method. Instead, they should override writeXmlSimple (and in rare cases writeXmlComplex).

Having two write methods (writeXmlSimple/writeXmlComplex) gives some basic control over the order in which data is written to xml, in order to make the generated xml look nice. Any properties written in writeXmlSimple will appear in the output file before properties written by writeXmlComplex. Therefore, properties which are "easily read" should be written out in a writeXmlSimple method. Data which has large CDATA blocks, or complicated nested structure should be written out in a writeXmlComplex method so that the "simple" stuff can be easily read and is not buried in the middle of the harder-to-read output.


writeXmlSimple

protected void writeXmlSimple(XmlWriter out)
Write this model out as xml.

Subclasses that wish to write out properties as xml should override this method, call the super implementation, then call methods on the XmlWriter object to output their data.


writeXmlComplex

protected void writeXmlComplex(XmlWriter out)
See documentation for writeXml and writeXmlSimple methods.


merge

protected void merge(ClassMeta other)
Merge any inheritable data from the specified "other" instance into the metadata held by this instance.


getModelId

public String getModelId()
Indicates which "group" of metadata this class belongs to.

Projects can inherit metadata from other projects, in which case all the ClassMeta objects end up in one big collection. But for some purposes it is necessary to iterate over the objects belonging to only one project (eg when generating components). This return value can be tested to check which "group" (project) a particular instance belongs to.


setModelId

public void setModelId(String modelId)

addWebConfigParam

public void addWebConfigParam(WebConfigParamMeta wcp)
Specified by:
addWebConfigParam in interface WebConfigParamHolder

webConfigParametersSize

public int webConfigParametersSize()

getWebConfigParam

public WebConfigParamMeta getWebConfigParam(String name)
Specified by:
getWebConfigParam in interface WebConfigParamHolder

webConfigParameters

public Iterator webConfigParameters()
Specified by:
webConfigParameters in interface WebConfigParamHolder

getWebConfigParametersList

public Collection getWebConfigParametersList()


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