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

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

public class Model
extends Object

Stores info about all of the jsf artifacts in the system being processed.


Constructor Summary
Model()
           
 
Method Summary
 void addBehavior(BehaviorMeta behavior)
          Holds info about a JSF Behavior definition
 void addComponent(ComponentMeta component)
          Adds a component to this faces config document.
 void addConverter(ConverterMeta converter)
          Holds info about a JSF Converter definition
 void addFaceletTag(FaceletTagMeta tag)
          Adds a tag to this faces config document.
 void addRenderKit(RenderKitMeta renderKit)
          Adds a render kit to this faces config document.
 void addTag(TagMeta tag)
          Adds a tag to this faces config document.
 void addValidator(ValidatorMeta validator)
          Holds info about a JSF Converter definition
 void addWebConfig(WebConfigMeta config)
           
static void addXmlRules(org.apache.commons.digester.Digester digester)
          Add digester rules to repopulate a Model instance from an xml file.
 Iterator behaviors()
          Returns an iterator for all behaviors
 Iterator components()
          Returns an iterator for all components.
 Iterator converters()
          Returns an iterator for all converters
 Iterator faceletTags()
          Returns an iterator for all tags.
 BehaviorMeta findBehaviorByClassName(String className)
           
 ComponentMeta findComponentByClassName(String className)
           
 ComponentMeta findComponentByTagClassName(String className)
           
 ComponentMeta findComponentByType(String componentType)
           
 ConverterMeta findConverterByClassName(String className)
           
 FaceletTagMeta findFaceletTagByClassName(String className)
           
 FaceletTagMeta findFaceletTagByName(String name)
           
 RenderKitMeta findRenderKitById(String id)
          Returns the render kit for this render kit id.
 TagMeta findTagByClassName(String className)
           
 ValidatorMeta findValidatorByClassName(String className)
           
 WebConfigMeta findWebConfigsByModelId(String modelId)
           
 List getBehaviors()
          Returns all behaviors
 List getComponents()
          Returns all components
 List getConverters()
          Returns all converters
 List getFaceletTags()
          Returns all tags
 String getModelId()
          Obtain a value that indicate from where this model comes from.
 List getRenderKits()
           
 List getTags()
          Returns all tags
 List getValidators()
          Returns all validators
 List getWebConfigs()
           
 void merge(Model other)
          Adds all components from the other model to this model, because only this info is necessary from construct a full model of components and build correctly faces-config.xml, .tld, and component and tag classes.
 Iterator renderKits()
          Returns an iterator for all render kits in this faces config.
 void setModelId(String modelId)
           
 Iterator tags()
          Returns an iterator for all tags.
 Iterator validators()
          Returns an iterator for all validators
 Iterator webConfigs()
           
static void writeXml(XmlWriter out, Model model)
          Write this model out as xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model()
Method Detail

writeXml

public static void writeXml(XmlWriter out,
                            Model model)
Write this model out as xml.

Having a hand-coded method like this is not very elegant; it would be better to do this via some library like Betwixt. However I'm not very familiar with such libs, so hand-coding is quicker for now.


addXmlRules

public static void addXmlRules(org.apache.commons.digester.Digester digester)
Add digester rules to repopulate a Model instance from an xml file.

Having a hand-coded method like this is not very elegant; it would be better to do this via some library like Betwixt. However I'm not very familiar with such libs, so hand-coding is quicker for now.


merge

public void merge(Model other)
Adds all components from the other model to this model, because only this info is necessary from construct a full model of components and build correctly faces-config.xml, .tld, and component and tag classes.

Parameters:
other -

addComponent

public void addComponent(ComponentMeta component)
Adds a component to this faces config document.

Parameters:
component - the component to add

getComponents

public List getComponents()
Returns all components


components

public Iterator components()
Returns an iterator for all components.


findComponentByClassName

public ComponentMeta findComponentByClassName(String className)

findComponentByTagClassName

public ComponentMeta findComponentByTagClassName(String className)

findComponentByType

public ComponentMeta findComponentByType(String componentType)

addConverter

public void addConverter(ConverterMeta converter)
Holds info about a JSF Converter definition


getConverters

public List getConverters()
Returns all converters


converters

public Iterator converters()
Returns an iterator for all converters


findConverterByClassName

public ConverterMeta findConverterByClassName(String className)

addBehavior

public void addBehavior(BehaviorMeta behavior)
Holds info about a JSF Behavior definition

Since:
1.0.6

getBehaviors

public List getBehaviors()
Returns all behaviors

Since:
1.0.6

behaviors

public Iterator behaviors()
Returns an iterator for all behaviors

Since:
1.0.6

findBehaviorByClassName

public BehaviorMeta findBehaviorByClassName(String className)
Since:
1.0.6

addValidator

public void addValidator(ValidatorMeta validator)
Holds info about a JSF Converter definition


getValidators

public List getValidators()
Returns all validators


validators

public Iterator validators()
Returns an iterator for all validators


findValidatorByClassName

public ValidatorMeta findValidatorByClassName(String className)

addRenderKit

public void addRenderKit(RenderKitMeta renderKit)
Adds a render kit to this faces config document.

Parameters:
renderKit - the render kit to add

getRenderKits

public List getRenderKits()

renderKits

public Iterator renderKits()
Returns an iterator for all render kits in this faces config.

Returns:
the render kit iterator

findRenderKitById

public RenderKitMeta findRenderKitById(String id)
Returns the render kit for this render kit id.

Parameters:
renderKitId - the render kit id to find

addTag

public void addTag(TagMeta tag)
Adds a tag to this faces config document.

Parameters:
tag - the tag to add

getTags

public List getTags()
Returns all tags


tags

public Iterator tags()
Returns an iterator for all tags.


findTagByClassName

public TagMeta findTagByClassName(String className)

addFaceletTag

public void addFaceletTag(FaceletTagMeta tag)
Adds a tag to this faces config document.

Parameters:
tag - the tag to add
Since:
1.0.4

getFaceletTags

public List getFaceletTags()
Returns all tags

Since:
1.0.4

faceletTags

public Iterator faceletTags()
Returns an iterator for all tags.

Since:
1.0.4

findFaceletTagByClassName

public FaceletTagMeta findFaceletTagByClassName(String className)
Since:
1.0.4

findFaceletTagByName

public FaceletTagMeta findFaceletTagByName(String name)
Since:
1.0.4

getWebConfigs

public List getWebConfigs()
Since:
1.0.4

webConfigs

public Iterator webConfigs()
Since:
1.0.4

findWebConfigsByModelId

public WebConfigMeta findWebConfigsByModelId(String modelId)
Since:
1.0.4

addWebConfig

public void addWebConfig(WebConfigMeta config)
Since:
1.0.4

setModelId

public void setModelId(String modelId)

getModelId

public String getModelId()
Obtain a value that indicate from where this model comes from.

Returns:


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