org.ujac.print
Class AbstractTagTest

java.lang.Object
  extended by org.ujac.print.AbstractTagTest

public abstract class AbstractTagTest
extends Object

Name: AbstractTagTest
Description: An abstract tag test implementation, used at class TestTagInterceptor to define single tag tests during document processing.

Author:
lauerc

Field Summary
protected  BaseDocumentTag tag
          The tag to test.
static int TEST_CLOSE
          Tells to perform tests when closing the tag.
static int TEST_OPEN
          Tells to perform tests when opening the tag.
 
Constructor Summary
AbstractTagTest()
          Constructs a AbstractTagTest instance with no specific attributes.
AbstractTagTest(int testMode)
          Constructs a AbstractTagTest instance with specific attributes.
 
Method Summary
protected  void doIt()
          Performs the tests, sets the testPassed flag, in case the test was successful.
protected  boolean getBooleanAttribute(String name)
          Gets a boolean attribute.
protected  boolean getBooleanStyleAttribute(String name)
          Gets a boolean style attribute.
protected  Color getColorAttribute(String name)
          Gets a color attribute.
protected  Color getColorStyleAttribute(String name)
          Gets a color style attribute.
protected  String getContent()
          Gets the tags textual content.
protected  float getDimensionAttribute(String name)
          Gets a dimension attribute.
protected  float getDimensionStyleAttribute(String name)
          Gets a dimension style attribute.
protected  float getFloatAttribute(String name)
          Gets a float attribute.
protected  float getFloatStyleAttribute(String name)
          Gets a float style attribute.
protected  int getHorizontalAlignmentAttribute(String name)
          Gets a horizontal alignment attribute.
protected  int getHorizontalAlignmentStyleAttribute(String name)
          Gets a horizontal alignment style attribute.
protected  int getIntegerAttribute(String name)
          Gets a integer style attribute.
protected  int getIntegerStyleAttribute(String name)
          Gets a integer style attribute.
protected  String getStringAttribute(String name)
          Gets a string attribute.
protected  String getStringStyleAttribute(String name)
          Gets a string style attribute.
 BaseDocumentTag getTag()
          Gets the attached document tag instance.
 int getTestMode()
          Gets the current test mode.
protected  int getVerticalAlignmentAttribute(String name)
          Gets a vertical alignment attribute.
protected  int getVerticalAlignmentStyleAttribute(String name)
          Gets a vertical alignment style attribute.
 boolean isTestPassed()
          Tells, whether or not the test has been passed.
abstract  void performTest()
          Performs the test.
protected  void setup(BaseDocumentTag tag)
          Sets up the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_OPEN

public static final int TEST_OPEN
Tells to perform tests when opening the tag.

See Also:
Constant Field Values

TEST_CLOSE

public static final int TEST_CLOSE
Tells to perform tests when closing the tag.

See Also:
Constant Field Values

tag

protected BaseDocumentTag tag
The tag to test.

Constructor Detail

AbstractTagTest

public AbstractTagTest()
Constructs a AbstractTagTest instance with no specific attributes.


AbstractTagTest

public AbstractTagTest(int testMode)
Constructs a AbstractTagTest instance with specific attributes.

Parameters:
testMode - The initial test mode.
Method Detail

setup

protected void setup(BaseDocumentTag tag)
Sets up the test.

Parameters:
tag - The tag to test.

performTest

public abstract void performTest()
                          throws DocumentHandlerException
Performs the test.

Throws:
DocumentHandlerException - In case a document handler problem occurred, during the tests.

doIt

protected void doIt()
             throws DocumentHandlerException
Performs the tests, sets the testPassed flag, in case the test was successful.

Throws:
DocumentHandlerException - In case a document handler problem occurred, during the tests.

getTag

public BaseDocumentTag getTag()
Gets the attached document tag instance.

Returns:
The current document tag instance.

getTestMode

public int getTestMode()
Gets the current test mode.

Returns:
The current test mode.

isTestPassed

public boolean isTestPassed()
Tells, whether or not the test has been passed.

Returns:
true, if the test has been successfully passed, else false.

getStringAttribute

protected String getStringAttribute(String name)
                             throws TagAttributeException
Gets a string attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getStringStyleAttribute

protected String getStringStyleAttribute(String name)
                                  throws TagAttributeException
Gets a string style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getFloatAttribute

protected float getFloatAttribute(String name)
                           throws TagAttributeException
Gets a float attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getFloatStyleAttribute

protected float getFloatStyleAttribute(String name)
                                throws TagAttributeException
Gets a float style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getIntegerAttribute

protected int getIntegerAttribute(String name)
                           throws TagAttributeException
Gets a integer style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getIntegerStyleAttribute

protected int getIntegerStyleAttribute(String name)
                                throws TagAttributeException
Gets a integer style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getDimensionAttribute

protected float getDimensionAttribute(String name)
                               throws TagAttributeException
Gets a dimension attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getDimensionStyleAttribute

protected float getDimensionStyleAttribute(String name)
                                    throws TagAttributeException
Gets a dimension style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getBooleanAttribute

protected boolean getBooleanAttribute(String name)
                               throws TagAttributeException
Gets a boolean attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getBooleanStyleAttribute

protected boolean getBooleanStyleAttribute(String name)
                                    throws TagAttributeException
Gets a boolean style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getColorAttribute

protected Color getColorAttribute(String name)
                           throws TagAttributeException
Gets a color attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getColorStyleAttribute

protected Color getColorStyleAttribute(String name)
                                throws TagAttributeException
Gets a color style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getHorizontalAlignmentAttribute

protected int getHorizontalAlignmentAttribute(String name)
                                       throws TagAttributeException
Gets a horizontal alignment attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getHorizontalAlignmentStyleAttribute

protected int getHorizontalAlignmentStyleAttribute(String name)
                                            throws TagAttributeException
Gets a horizontal alignment style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getVerticalAlignmentAttribute

protected int getVerticalAlignmentAttribute(String name)
                                     throws TagAttributeException
Gets a vertical alignment attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getVerticalAlignmentStyleAttribute

protected int getVerticalAlignmentStyleAttribute(String name)
                                          throws TagAttributeException
Gets a vertical alignment style attribute.

Parameters:
name - The attribute name.
Returns:
The according value.
Throws:
TagAttributeException - If the item contains an invalid value or an required attribute was not defined.

getContent

protected String getContent()
Gets the tags textual content.

Returns:
The tags textual content.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.