trunk/XMLv2__DOMException.st
changeset 0 5057afe1ec87
equal deleted inserted replaced
-1:000000000000 0:5057afe1ec87
       
     1 "{ Package: 'stx:goodies/xmlsuite' }"
       
     2 
       
     3 "{ NameSpace: XMLv2 }"
       
     4 
       
     5 SAXError subclass:#DOMException
       
     6 	instanceVariableNames:'code'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'XML Suite-Exceptions'
       
    10 !
       
    11 
       
    12 
       
    13 !DOMException class methodsFor:'error codes'!
       
    14 
       
    15 DOMSTRING_SIZE_ERR
       
    16     "If the specified range of text does not fit into a DOMString."
       
    17 
       
    18     ^2
       
    19 
       
    20     "Created: / 08-05-2005 / 18:12:21 / janfrog"
       
    21 !
       
    22 
       
    23 HIERARCHY_REQUEST_ERR
       
    24     "If any Node is inserted somewhere it doesn't belong."
       
    25 
       
    26     ^3
       
    27 
       
    28     "Created: / 08-05-2005 / 18:12:46 / janfrog"
       
    29 !
       
    30 
       
    31 INDEX_SIZE_ERR
       
    32     "If index or size is negative, or greater than the allowed value."
       
    33 
       
    34     ^1
       
    35 
       
    36     "Created: / 08-05-2005 / 18:11:53 / janfrog"
       
    37 !
       
    38 
       
    39 INUSE_ATTRIBUTE_ERR
       
    40     "If an attempt is made to add an attribute that is already in use elsewhere."
       
    41 
       
    42     ^10
       
    43 
       
    44     "Created: / 08-05-2005 / 18:14:24 / janfrog"
       
    45 !
       
    46 
       
    47 INVALID_ACCESS_ERR
       
    48     "If a parameter or an operation is not supported by the underlying object."
       
    49 
       
    50     ^15
       
    51 
       
    52     "Created: / 08-05-2005 / 18:16:14 / janfrog"
       
    53 !
       
    54 
       
    55 INVALID_CHARACTER_ERR
       
    56     "If an invalid or illegal character is specified, such as in an XML name."
       
    57 
       
    58     ^5
       
    59 
       
    60     "Created: / 08-05-2005 / 18:13:07 / janfrog"
       
    61 !
       
    62 
       
    63 INVALID_MODIFICATION_ERR
       
    64     "If an attempt is made to modify the type of the underlying object."
       
    65 
       
    66     ^13
       
    67 
       
    68     "Created: / 08-05-2005 / 18:15:16 / janfrog"
       
    69 !
       
    70 
       
    71 INVALID_STATE_ERR
       
    72     "If an attempt is made to use an object that is not, or is no longer, usable."
       
    73 
       
    74     ^11
       
    75 
       
    76     "Created: / 08-05-2005 / 18:14:48 / janfrog"
       
    77 !
       
    78 
       
    79 NAMESPACE_ERR
       
    80     "If an attempt is made to create or change an object in a way which is incorrect
       
    81     with regard to namespaces."
       
    82 
       
    83     ^14
       
    84 
       
    85     "Created: / 08-05-2005 / 18:15:29 / janfrog"
       
    86 !
       
    87 
       
    88 NOT_FOUND_ERR
       
    89     "If an attempt is made to reference a Node in a context where it does not exist."
       
    90 
       
    91     ^8
       
    92 
       
    93     "Created: / 08-05-2005 / 18:13:48 / janfrog"
       
    94 !
       
    95 
       
    96 NOT_SUPPORTED_ERR
       
    97     "If the implementation does not support the requested type of object or operation."
       
    98 
       
    99     ^9
       
   100 
       
   101     "Created: / 08-05-2005 / 18:14:10 / janfrog"
       
   102 !
       
   103 
       
   104 NO_DATA_ALLOWED_ERR
       
   105     "If data is specified for a Node which does not support data."
       
   106 
       
   107     ^6
       
   108 
       
   109     "Created: / 08-05-2005 / 18:13:22 / janfrog"
       
   110 !
       
   111 
       
   112 NO_MODIFICATION_ALLOWED_ERR
       
   113     "If an attempt is made to modify an object where modifications are not allowed."
       
   114 
       
   115     ^7
       
   116 
       
   117     "Created: / 08-05-2005 / 18:13:31 / janfrog"
       
   118 !
       
   119 
       
   120 SYNTAX_ERR
       
   121     "If an invalid or illegal string is specified."
       
   122 
       
   123     ^12
       
   124 
       
   125     "Created: / 08-05-2005 / 18:14:57 / janfrog"
       
   126 !
       
   127 
       
   128 TYPE_MISMATCH
       
   129     "If the type of an object is incompatible with the expected type of the parameter
       
   130     associated to the object."
       
   131 
       
   132     ^17
       
   133 
       
   134     "Created: / 08-05-2005 / 18:16:46 / janfrog"
       
   135 !
       
   136 
       
   137 VALIDATION_ERR
       
   138     "If a call to a method such as insertBefore or removeChild would make the Node invalid
       
   139     with respect to 'partial validity', this exception would be raised and the operation would
       
   140     not be done. This code is used in [DOM Level 3 Validation]. Refer to this specification
       
   141     for further information."
       
   142 
       
   143     ^16
       
   144 
       
   145     "Created: / 08-05-2005 / 18:16:26 / janfrog"
       
   146 !
       
   147 
       
   148 WRONG_DOCUMENT_ERR
       
   149     "If a Node is used in a different document than the one that created it (that doesn't
       
   150     support it)."
       
   151 
       
   152     ^4
       
   153 
       
   154     "Created: / 08-05-2005 / 18:12:56 / janfrog"
       
   155 ! !
       
   156 
       
   157 !DOMException class methodsFor:'raising'!
       
   158 
       
   159 raiseErrorString:aString withCode:anIntegerOrSymbol
       
   160 
       
   161     | code |
       
   162     code := anIntegerOrSymbol isInteger 
       
   163                 ifTrue:[anIntegerOrSymbol]
       
   164                 ifFalse:[self perform:anIntegerOrSymbol].
       
   165 
       
   166     ^self new
       
   167         errorString:aString;
       
   168         code:code;
       
   169         raise.
       
   170 
       
   171     "Created: / 08-05-2005 / 18:19:19 / janfrog"
       
   172 ! !
       
   173 
       
   174 !DOMException methodsFor:'accessing'!
       
   175 
       
   176 code
       
   177     ^code
       
   178 
       
   179     "Created: / 17-06-2005 / 12:02:25 / janfrog"
       
   180 !
       
   181 
       
   182 code:anIntegerOrSymbol
       
   183 
       
   184     code := anIntegerOrSymbol isSymbol
       
   185                 ifTrue:[self class perform:anIntegerOrSymbol]
       
   186                 ifFalse:[anIntegerOrSymbol]
       
   187 
       
   188     "Created: / 17-06-2005 / 12:03:15 / janfrog"
       
   189 ! !
       
   190 
       
   191 !DOMException class methodsFor:'documentation'!
       
   192 
       
   193 version
       
   194     ^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/XMLv2__DOMException.st,v 1.2 2006-12-07 08:17:06 vranyj1 Exp $'
       
   195 ! !