Main Page Packages Class Hierarchy Compound List File List Compound Members

# characterdataindexsizeerrsubstringoffsetgreater Class Reference

Inherits DOMTestCase.

List of all members.

## Public Methods
| characterdataindexsizeerrsubstringoffsetgreater (DOMTestDocumentBuilderFactory factory)
void | runTest () throws java.lang.Throwable
String | getTargetURI ()
## Static Public Methods
void | main (String[] args)

## Detailed Description

The "substringData(offset,count)" method raises an INDEX_SIZE_ERR DOMException if the specified offset is greater than the number of characters in the string.

Retrieve the character data of the last child of the first employee and invoke its "substringData(offset,count) method with offset=40 and count=3. It should raise the desired exception since the offsets value is greater than the length.

Author:
  NIST , Mary Brady

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])

Definition at line 49 of file characterdataindexsizeerrsubstringoffsetgreater.java.

## Constructor & Destructor Documentation

characterdataindexsizeerrsubstringoffsetgreater::characterdataindexsizeerrsubstringoffsetgreater | ( | DOMTestDocumentBuilderFactory | factory | ) | `[inline]`

| Definition at line 51 of file characterdataindexsizeerrsubstringoffsetgreater.java.
    00052  {
    00053       super(factory);
    00054
    00055    }

## Member Function Documentation

String characterdataindexsizeerrsubstringoffsetgreater::getTargetURI | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTest. Definition at line 81 of file characterdataindexsizeerrsubstringoffsetgreater.java.
    00081                                 {
    00082       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringoffsetgreater";
    00083    }

void characterdataindexsizeerrsubstringoffsetgreater::main | ( | String | args[] | ) | `[inline, static]`

| Definition at line 84 of file characterdataindexsizeerrsubstringoffsetgreater.java. References DOMTestCase::doMain().
    00084                                           {
    00085         DOMTestCase.doMain(characterdataindexsizeerrsubstringoffsetgreater.class,args);
    00086    }

void characterdataindexsizeerrsubstringoffsetgreater::runTest | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestCase. Definition at line 57 of file characterdataindexsizeerrsubstringoffsetgreater.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00057                                                     {
    00058       Document doc;
    00059       NodeList elementList;
    00060       Node nameNode;
    00061       CharacterData child;
    00062       String badString;
    00063       doc = load("staff");
    00064       elementList = doc.getElementsByTagName("address");
    00065       nameNode = elementList.item(0);
    00066       child = (CharacterData)nameNode.getFirstChild();
    00067
    00068         {
    00069                 boolean success = false;
    00070                 try {
    00071                         badString = child.substringData(40,3);
    00072
    00073                 }
    00074                 catch(DOMException ex) {
    00075                         success = (ex.code == DOMException.INDEX_SIZE_ERR);
    00076                 }
    00077                 assertTrue("characterdataIndexSizeErrSubstringOffsetGreaterAssert",success);
    00078         }
    00079
    00080    }

The documentation for this class was generated from the following file:

- characterdataindexsizeerrsubstringoffsetgreater.java