prupp.html
Class HTMLTag

java.lang.Object
  |
  +--prupp.html.HTMLTag

public class HTMLTag
extends java.lang.Object

A class to represent a html-tag.


Constructor Summary
HTMLTag(java.lang.String type)
          Create a tag with given type.
HTMLTag(java.lang.String type, boolean comment)
          Create a tag with given type and choose if it is a comment.
 
Method Summary
 java.lang.String getAttribute(java.lang.String type)
          Get the attribute for the given type
 java.lang.String getType()
          return the type of this tag.
 boolean isComment()
          is this tag a comment?
static void main(java.lang.String[] args)
          simple test program
 void removeAttribute(java.lang.String type)
          removes the given attribute for the tag.
 void setAttribute(java.lang.String key)
          Set an attribute for this tag (like the NOWRAP attribute in TD-tags)
 void setAttribute(java.lang.String key, java.lang.String value)
          Set a key=value parameter for this type
 void setType(java.lang.String type)
          set the type of this tag.
 java.lang.String toString()
          Give the string representation of this tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLTag

public HTMLTag(java.lang.String type)
Create a tag with given type.
Parameters:
type - the type of the tag e.g. A, IMG, B, P

HTMLTag

public HTMLTag(java.lang.String type,
               boolean comment)
Create a tag with given type and choose if it is a comment.
Parameters:
type - the type of the tag e.g. A, IMG, B, P
comment - true if this tag is a comment false otherwise.
Method Detail

isComment

public boolean isComment()
is this tag a comment?
Returns:
true if this tag is a comment

getAttribute

public java.lang.String getAttribute(java.lang.String type)
Get the attribute for the given type
Parameters:
type - the key were looking for a value to.
Returns:
the value, if any, or null.

setAttribute

public void setAttribute(java.lang.String key)
Set an attribute for this tag (like the NOWRAP attribute in TD-tags)
Parameters:
key - the key were setting.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Set a key=value parameter for this type
Parameters:
key - the keystring to set.
value - the value of the key, if null just set an attribute.

removeAttribute

public void removeAttribute(java.lang.String type)
removes the given attribute for the tag.
Parameters:
type - the attribute to remove

toString

public java.lang.String toString()
Give the string representation of this tag
Returns:
a string describing this tag.
Overrides:
toString in class java.lang.Object

getType

public java.lang.String getType()
return the type of this tag.
Returns:
the type of this tag.

setType

public void setType(java.lang.String type)
set the type of this tag.
Parameters:
type - the new type of this tag.

main

public static void main(java.lang.String[] args)
simple test program