001package com.hfg.html;
002
003import com.hfg.xml.XMLNode;
004
005//------------------------------------------------------------------------------
006/**
007 * Represents a meta (<meta>) tag.
008 *
009 * @author J. Alex Taylor, hairyfatguy.com
010 */
011//------------------------------------------------------------------------------
012// com.hfg XML/HTML Coding Library
013//
014// This library is free software; you can redistribute it and/or
015// modify it under the terms of the GNU Lesser General Public
016// License as published by the Free Software Foundation; either
017// version 2.1 of the License, or (at your option) any later version.
018//
019// This library is distributed in the hope that it will be useful,
020// but WITHOUT ANY WARRANTY; without even the implied warranty of
021// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
022// Lesser General Public License for more details.
023//
024// You should have received a copy of the GNU Lesser General Public
025// License along with this library; if not, write to the Free Software
026// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
027//
028// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
029// jataylor@hairyfatguy.com
030//------------------------------------------------------------------------------
031
032public class Meta extends HTMLTag
033{
034   public static final Meta CONTENT_TYPE_ISO_8859_1 = new Meta();
035   public static final Meta GOOGLE_CHOME_FRAME      = new Meta();
036
037   static
038   {
039      CONTENT_TYPE_ISO_8859_1.setHttpEquiv("Content-Type")
040                             .setContentAttribute("text/html; charset=ISO-8859-1");
041
042      GOOGLE_CHOME_FRAME.setHttpEquiv("X-UA-Compatible").setContentAttribute("chrome=1");
043   }
044
045   //##########################################################################
046   // PRIVATE FIELDS
047   //##########################################################################
048
049
050   //##########################################################################
051   // CONSTRUCTORS
052   //##########################################################################
053
054   //--------------------------------------------------------------------------
055   public Meta()
056   {
057      super(HTML.META);
058   }
059
060   //--------------------------------------------------------------------------
061   public Meta(XMLNode inXMLNode)
062   {
063      this();
064      initFromXMLNode(inXMLNode);
065   }
066
067   //##########################################################################
068   // PUBLIC METHODS
069   //##########################################################################
070
071   //--------------------------------------------------------------------------
072   public Meta setHttpEquiv(String inValue)
073   {
074      setAttribute(HTML.HTTP_EQUIV, inValue);
075
076      return this;
077   }
078
079   //--------------------------------------------------------------------------
080   public Meta setName(String inValue)
081   {
082      setAttribute(HTML.NAME, inValue);
083
084      return this;
085   }
086
087   //--------------------------------------------------------------------------
088   public String getName()
089   {
090      return getAttributeValue(HTML.NAME);
091   }
092
093   //--------------------------------------------------------------------------
094   public Meta setContentAttribute(String inValue)
095   {
096      setAttribute(HTML.CONTENT, inValue);
097
098      return this;
099   }
100
101   //--------------------------------------------------------------------------
102   public String getContentAttribute()
103   {
104      return getAttributeValue(HTML.CONTENT);
105   }
106
107
108}