maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/trinidad/parse/RendererBean.java [31:442]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class RendererBean extends ObjectBean
{
  /**
   * Creates a new RendererBean.
   */
  public RendererBean()
  {
    _attributes = new TreeMap();
    _facets = new TreeMap();
  }

  /**
   * Sets the component family for this component.
   *
   * @param componentFamily  the component family
   */
  public void setComponentFamily(
    String componentFamily)
  {
    _componentFamily = componentFamily;
  }

  /**
   * Returns the component family for this component.
   *
   * @return  the component family
   */
  public String getComponentFamily()
  {
    return _componentFamily;
  }

  /**
   * Sets the renderer type for this component.
   *
   * @param rendererType  the renderer type
   */
  public void setRendererType(
    String rendererType)
  {
    _rendererType = rendererType;
  }

  /**
   * Returns the renderer type for this component.
   *
   * @return  the renderer type
   */
  public String getRendererType()
  {
    return _rendererType;
  }

  /**
   * Sets the renderer class for this renderer.
   *
   * @param rendererClass  the renderer class
   */
  public void setRendererClass(
    String rendererClass)
  {
    _rendererClass = rendererClass;
  }

  /**
   * Returns the renderer class for this renderer.
   *
   * @return  the renderer class
   */
  public String getRendererClass()
  {
    return _rendererClass;
  }

  /**
   * Sets the description of this attribute.
   *
   * @param description  the attribute description
   */
  public void setDescription(
    String description)
  {
    _description = description;
  }

  /**
   * Returns the description of this attribute.
   *
   * @return  the attribute description
   */
  public String getDescription()
  {
    return _description;
  }

  /**
   * Sets the component type for this component.
   *
   * @param componentType  the component type
   */
  public void setComponentType(
    String componentType)
  {
    _componentType = componentType;
  }

  /**
   * Returns the component type for this component.
   *
   * @return  the component type
   */
  public String getComponentType()
  {
    return _componentType;
  }

  /**
   * Sets the renderer superclass for this renderer.
   *
   * @param rendererSuperclass  the renderer superclass
   */
  public void setRendererSuperclass(
    String rendererSuperclass)
  {
    _rendererSuperclass = rendererSuperclass;
  }

  /**
   * Returns the renderer superclass for this component.
   *
   * @return  the renderer superclass
   */
  public String getRendererSuperclass()
  {
    return _rendererSuperclass;
  }

  /**
   * Finds the renderer-specific component class for this renderer.
   *
   * @return  the renderer-specific component class
   */
  public String findComponentClass()
  {
    ComponentBean component = resolveComponentType();
    return (component != null) ? component.getComponentClass()
                               : "org.apache.myfaces.trinidad.component.UIXComponent";
  }

  /**
   * Finds the behavioral component class for this renderer.
   *
   * @return  the behavioral component class
   */
  public String findComponentFamilyClass()
  {
    ComponentBean component = resolveComponentType();
    ComponentBean behavioral = (component != null)
                                  ? component.findBehavioralComponent()
                                  : null;
    return (behavioral != null) ? behavioral.getComponentClass()
                                : "org.apache.myfaces.trinidad.component.UIXComponent";
  }

  /**
   * Adds a attribute to this component.
   *
   * @param attribute  the attribute to add
   */
  public void addAttribute(
    AttributeBean attribute)
  {
    _attributes.put(attribute.getAttributeName(), attribute);
  }

  /**
   * Returns the attribute for this attribute name.
   *
   * @param attributeName  the attribute name to find
   */
  public AttributeBean findAttribute(
    String attributeName)
  {
    AttributeBean attribute = (AttributeBean)_attributes.get(attributeName);

    if (attribute == null)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
        attribute = component.findProperty(attributeName);
    }

    return attribute;
  }

  /**
   * Returns true if this component has any attributes.
   *
   * @return  true   if this component has any attributes,
   *          false  otherwise
   */
  public boolean hasAttributes()
  {
    boolean hasAttributes = !_attributes.isEmpty();

    if (!hasAttributes)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
        hasAttributes |= component.hasProperties();
    }

    return hasAttributes;
  }

  /**
   * Returns true if this component or any component supertype
   * has any attributes.
   *
   * @return  true   if this component or any supertype has any attributes,
   *          false  otherwise
   */
  public boolean hasAttributes(
    boolean flatten)
  {
    boolean hasAttributes = hasAttributes();

    if (!hasAttributes && flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          hasAttributes |= parent.hasProperties(true);
      }
    }

    return hasAttributes;
  }

  /**
   * Returns an iterator for all attributes on this component only.
   *
   * @return  the attribute iterator
   */
  public Iterator attributes()
  {
    Iterator attributes = _attributes.values().iterator();

    ComponentBean component = resolveComponentType();
    if (component != null)
        attributes = new CompoundIterator(attributes, component.properties());

    return attributes;
  }

  /**
   * Returns an iterator for attributes on this component.
   *
   * @param flatten  true   if the iterator should be a combined list of
   *                        attributes of this component and its supertype,
   *                 false  otherwise
   *
   * @return  the attribute iterator
   */
  public Iterator attributes(
    boolean flatten)
  {
    Iterator attributes = attributes();
    if (flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          attributes = new CompoundIterator(attributes, parent.properties(true));
      }
    }
    return attributes;
  }

  /**
   * Adds a facet to this component.
   *
   * @param facet  the facet to add
   */
  public void addFacet(
    FacetBean facet)
  {
    _facets.put(facet.getFacetName(), facet);
  }

  /**
   * Returns the facet for this facet name.
   *
   * @param facetName  the facet name to find
   */
  public FacetBean findFacet(
    String facetName)
  {
    return (FacetBean)_facets.get(facetName);
  }

  /**
   * Returns true if this component has any facets.
   *
   * @return  true   if this component has any facets,
   *          false  otherwise
   */
  public boolean hasFacets()
  {
    boolean hasFacets = !_facets.isEmpty();

    ComponentBean component = resolveComponentType();
    if (component != null)
      hasFacets |= component.hasFacets();

    return hasFacets;
  }

  /**
   * Returns true if this component or any component supertype
   * has any facets.
   *
   * @return  true   if this component or any supertype has any facets,
   *          false  otherwise
   */
  public boolean hasFacets(
    boolean flatten)
  {
    boolean hasFacets = hasFacets();

    if (!hasFacets && flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          hasFacets |= parent.hasFacets(true);
      }
    }

    return hasFacets;
  }

  /**
   * Returns an iterator for all facets on this component only.
   *
   * @return  the facet iterator
   */
  public Iterator facets()
  {
    Iterator facets = _facets.values().iterator();

    ComponentBean component = resolveComponentType();
    if (component != null)
        facets = new CompoundIterator(facets, component.facets());

    return facets;
  }

  /**
   * Returns an iterator for facets on this component.
   *
  * @param flatten  true   if the iterator should be a combined list of
  *                        facets of this component and its supertype,
  *                 false  otherwise
  *
  * @return  the facet iterator
  */
  public Iterator facets(
    boolean flatten)
  {
    Iterator facets = facets();
    if (flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          facets = new CompoundIterator(facets, parent.facets(true));
      }
    }
    return facets;
  }

  /**
   * Returns the component type instance.
   *
   * @return  the component type instance
   */
  public ComponentBean resolveComponentType()
  {
    if (_componentType == null)
      return null;

    FacesConfigBean owner = getOwner();
    return (owner != null) ? owner.findComponent(_componentType) : null;
  }

  private String  _description;
  private String  _componentFamily;
  private String  _rendererType;
  private String  _rendererClass;
  private String  _rendererSuperclass;
  private String  _componentType;
  private Map     _attributes;
  private Map     _facets;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/RendererBean.java [31:442]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class RendererBean extends ObjectBean
{
  /**
   * Creates a new RendererBean.
   */
  public RendererBean()
  {
    _attributes = new TreeMap();
    _facets = new TreeMap();
  }

  /**
   * Sets the component family for this component.
   *
   * @param componentFamily  the component family
   */
  public void setComponentFamily(
    String componentFamily)
  {
    _componentFamily = componentFamily;
  }

  /**
   * Returns the component family for this component.
   *
   * @return  the component family
   */
  public String getComponentFamily()
  {
    return _componentFamily;
  }

  /**
   * Sets the renderer type for this component.
   *
   * @param rendererType  the renderer type
   */
  public void setRendererType(
    String rendererType)
  {
    _rendererType = rendererType;
  }

  /**
   * Returns the renderer type for this component.
   *
   * @return  the renderer type
   */
  public String getRendererType()
  {
    return _rendererType;
  }

  /**
   * Sets the renderer class for this renderer.
   *
   * @param rendererClass  the renderer class
   */
  public void setRendererClass(
    String rendererClass)
  {
    _rendererClass = rendererClass;
  }

  /**
   * Returns the renderer class for this renderer.
   *
   * @return  the renderer class
   */
  public String getRendererClass()
  {
    return _rendererClass;
  }

  /**
   * Sets the description of this attribute.
   *
   * @param description  the attribute description
   */
  public void setDescription(
    String description)
  {
    _description = description;
  }

  /**
   * Returns the description of this attribute.
   *
   * @return  the attribute description
   */
  public String getDescription()
  {
    return _description;
  }

  /**
   * Sets the component type for this component.
   *
   * @param componentType  the component type
   */
  public void setComponentType(
    String componentType)
  {
    _componentType = componentType;
  }

  /**
   * Returns the component type for this component.
   *
   * @return  the component type
   */
  public String getComponentType()
  {
    return _componentType;
  }

  /**
   * Sets the renderer superclass for this renderer.
   *
   * @param rendererSuperclass  the renderer superclass
   */
  public void setRendererSuperclass(
    String rendererSuperclass)
  {
    _rendererSuperclass = rendererSuperclass;
  }

  /**
   * Returns the renderer superclass for this component.
   *
   * @return  the renderer superclass
   */
  public String getRendererSuperclass()
  {
    return _rendererSuperclass;
  }

  /**
   * Finds the renderer-specific component class for this renderer.
   *
   * @return  the renderer-specific component class
   */
  public String findComponentClass()
  {
    ComponentBean component = resolveComponentType();
    return (component != null) ? component.getComponentClass()
                               : "org.apache.myfaces.trinidad.component.UIXComponent";
  }

  /**
   * Finds the behavioral component class for this renderer.
   *
   * @return  the behavioral component class
   */
  public String findComponentFamilyClass()
  {
    ComponentBean component = resolveComponentType();
    ComponentBean behavioral = (component != null)
                                  ? component.findBehavioralComponent()
                                  : null;
    return (behavioral != null) ? behavioral.getComponentClass()
                                : "org.apache.myfaces.trinidad.component.UIXComponent";
  }

  /**
   * Adds a attribute to this component.
   *
   * @param attribute  the attribute to add
   */
  public void addAttribute(
    AttributeBean attribute)
  {
    _attributes.put(attribute.getAttributeName(), attribute);
  }

  /**
   * Returns the attribute for this attribute name.
   *
   * @param attributeName  the attribute name to find
   */
  public AttributeBean findAttribute(
    String attributeName)
  {
    AttributeBean attribute = (AttributeBean)_attributes.get(attributeName);

    if (attribute == null)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
        attribute = component.findProperty(attributeName);
    }

    return attribute;
  }

  /**
   * Returns true if this component has any attributes.
   *
   * @return  true   if this component has any attributes,
   *          false  otherwise
   */
  public boolean hasAttributes()
  {
    boolean hasAttributes = !_attributes.isEmpty();

    if (!hasAttributes)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
        hasAttributes |= component.hasProperties();
    }

    return hasAttributes;
  }

  /**
   * Returns true if this component or any component supertype
   * has any attributes.
   *
   * @return  true   if this component or any supertype has any attributes,
   *          false  otherwise
   */
  public boolean hasAttributes(
    boolean flatten)
  {
    boolean hasAttributes = hasAttributes();

    if (!hasAttributes && flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          hasAttributes |= parent.hasProperties(true);
      }
    }

    return hasAttributes;
  }

  /**
   * Returns an iterator for all attributes on this component only.
   *
   * @return  the attribute iterator
   */
  public Iterator attributes()
  {
    Iterator attributes = _attributes.values().iterator();

    ComponentBean component = resolveComponentType();
    if (component != null)
        attributes = new CompoundIterator(attributes, component.properties());

    return attributes;
  }

  /**
   * Returns an iterator for attributes on this component.
   *
   * @param flatten  true   if the iterator should be a combined list of
   *                        attributes of this component and its supertype,
   *                 false  otherwise
   *
   * @return  the attribute iterator
   */
  public Iterator attributes(
    boolean flatten)
  {
    Iterator attributes = attributes();
    if (flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          attributes = new CompoundIterator(attributes, parent.properties(true));
      }
    }
    return attributes;
  }

  /**
   * Adds a facet to this component.
   *
   * @param facet  the facet to add
   */
  public void addFacet(
    FacetBean facet)
  {
    _facets.put(facet.getFacetName(), facet);
  }

  /**
   * Returns the facet for this facet name.
   *
   * @param facetName  the facet name to find
   */
  public FacetBean findFacet(
    String facetName)
  {
    return (FacetBean)_facets.get(facetName);
  }

  /**
   * Returns true if this component has any facets.
   *
   * @return  true   if this component has any facets,
   *          false  otherwise
   */
  public boolean hasFacets()
  {
    boolean hasFacets = !_facets.isEmpty();

    ComponentBean component = resolveComponentType();
    if (component != null)
      hasFacets |= component.hasFacets();

    return hasFacets;
  }

  /**
   * Returns true if this component or any component supertype
   * has any facets.
   *
   * @return  true   if this component or any supertype has any facets,
   *          false  otherwise
   */
  public boolean hasFacets(
    boolean flatten)
  {
    boolean hasFacets = hasFacets();

    if (!hasFacets && flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          hasFacets |= parent.hasFacets(true);
      }
    }

    return hasFacets;
  }

  /**
   * Returns an iterator for all facets on this component only.
   *
   * @return  the facet iterator
   */
  public Iterator facets()
  {
    Iterator facets = _facets.values().iterator();

    ComponentBean component = resolveComponentType();
    if (component != null)
        facets = new CompoundIterator(facets, component.facets());

    return facets;
  }

  /**
   * Returns an iterator for facets on this component.
   *
  * @param flatten  true   if the iterator should be a combined list of
  *                        facets of this component and its supertype,
  *                 false  otherwise
  *
  * @return  the facet iterator
  */
  public Iterator facets(
    boolean flatten)
  {
    Iterator facets = facets();
    if (flatten)
    {
      ComponentBean component = resolveComponentType();
      if (component != null)
      {
        ComponentBean parent = component.resolveSupertype();
        if (parent != null)
          facets = new CompoundIterator(facets, parent.facets(true));
      }
    }
    return facets;
  }

  /**
   * Returns the component type instance.
   *
   * @return  the component type instance
   */
  public ComponentBean resolveComponentType()
  {
    if (_componentType == null)
      return null;

    FacesConfigBean owner = getOwner();
    return (owner != null) ? owner.findComponent(_componentType) : null;
  }

  private String  _description;
  private String  _componentFamily;
  private String  _rendererType;
  private String  _rendererClass;
  private String  _rendererSuperclass;
  private String  _componentType;
  private Map     _attributes;
  private Map     _facets;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



