@@ -133,12 +133,12 @@ - init { Class c = isa; [self release]; - @throw [OFNotImplementedException newWithClass: c - selector: _cmd]; + @throw [OFNotImplementedException exceptionWithClass: c + selector: _cmd]; } - initWithName: (OFString*)name_ { return [self initWithName: name_ @@ -168,12 +168,13 @@ { self = [super init]; @try { if (name_ == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; name = [name_ copy]; ns = [ns_ copy]; namespaces = [[OFMutableDictionary alloc] @@ -195,12 +196,13 @@ { self = [super init]; @try { if (characters_ == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; characters = [characters_ copy]; } @catch (id e) { [self release]; @throw e; @@ -213,12 +215,13 @@ { self = [super init]; @try { if (CDATA_ == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; CDATA = [CDATA_ copy]; } @catch (id e) { [self release]; @throw e; @@ -231,12 +234,13 @@ { self = [super init]; @try { if (comment_ == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; comment = [comment_ copy]; } @catch (id e) { [self release]; @throw e; @@ -249,12 +253,13 @@ { self = [super init]; @try { if (element == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; name = [element->name copy]; ns = [element->ns copy]; defaultNamespace = [element->defaultNamespace copy]; attributes = [element->attributes mutableCopy]; @@ -281,12 +286,12 @@ c = isa; [self release]; if (string == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; pool = [[OFAutoreleasePool alloc] init]; parser = [OFXMLParser parser]; builder = [OFXMLElementBuilder elementBuilder]; @@ -297,12 +302,12 @@ [builder setDelegate: delegate]; [parser parseString: string]; if (![parser finishedParsing]) - @throw [OFMalformedXMLException newWithClass: c - parser: parser]; + @throw [OFMalformedXMLException exceptionWithClass: c + parser: parser]; self = [delegate->element retain]; [pool release]; @@ -331,12 +336,12 @@ [builder setDelegate: delegate]; [parser parseFile: path]; if (![parser finishedParsing]) - @throw [OFMalformedXMLException newWithClass: c - parser: parser]; + @throw [OFMalformedXMLException exceptionWithClass: c + parser: parser]; self = [delegate->element retain]; [pool release]; @@ -352,12 +357,13 @@ OFXMLElement *attributesElement, *namespacesElement; OFXMLElement *childrenElement; if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; name = [[[element attributeForName: @"name"] stringValue] copy]; ns = [[[element attributeForName: @"namespace"] stringValue] copy]; defaultNamespace = [[[element attributeForName: @@ -391,12 +397,13 @@ if (!((name != nil || ns != nil || defaultNamespace != nil || [attributes count] > 0 || [namespaces count] > 0 || [children count] > 0) ^ (characters != nil) ^ (CDATA != nil) ^ (comment != nil))) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: isa + selector: _cmd]; [pool release]; } @catch (id e) { [self release]; @throw e; @@ -406,12 +413,12 @@ } - (void)setName: (OFString*)name_ { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; OF_SETTER(name, name_, YES, YES) } - (OFString*)name @@ -420,12 +427,12 @@ } - (void)setNamespace: (OFString*)ns_ { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; OF_SETTER(ns, ns_, YES, YES) } - (OFString*)namespace @@ -646,12 +653,13 @@ if ([attributesCArray[j] namespace] != nil && (attributePrefix = [allNamespaces objectForKey: [attributesCArray[j] namespace]]) == nil) @throw [OFUnboundNamespaceException - newWithClass: isa - namespace: [attributesCArray[j] namespace]]; + exceptionWithClass: isa + namespace: [attributesCArray[j] + namespace]]; length += [attributeName UTF8StringLength] + (attributePrefix != nil ? [attributePrefix UTF8StringLength] + 1 : 0) + [tmp UTF8StringLength] + 4; @@ -879,12 +887,12 @@ } - (void)addAttribute: (OFXMLAttribute*)attribute { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; if (attributes == nil) attributes = [[OFMutableArray alloc] init]; if ([self attributeForName: attribute->name @@ -905,12 +913,12 @@ stringValue: (OFString*)stringValue { OFAutoreleasePool *pool; if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; pool = [[OFAutoreleasePool alloc] init]; [self addAttribute: [OFXMLAttribute attributeWithName: name_ namespace: ns_ stringValue: stringValue]]; @@ -988,12 +996,12 @@ - (void)setPrefix: (OFString*)prefix forNamespace: (OFString*)ns_ { if (name == nil || prefix == nil || [prefix isEqual: @""]) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; if (ns_ == nil) ns_ = @""; [namespaces setObject: prefix forKey: ns_]; @@ -1010,32 +1018,32 @@ } - (OFString*)defaultNamespace { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; return [[defaultNamespace retain] autorelease]; } - (void)setDefaultNamespace: (OFString*)ns_ { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; OFString *old = defaultNamespace; defaultNamespace = [ns_ copy]; [old release]; } - (void)addChild: (OFXMLElement*)child { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; if (children == nil) children = [[OFMutableArray alloc] init]; [children addObject: child]; @@ -1042,12 +1050,12 @@ } - (void)removeChild: (OFXMLElement*)child { if (name == nil) - @throw [OFInvalidArgumentException newWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException exceptionWithClass: isa + selector: _cmd]; [children removeObject: child]; } - (OFXMLElement*)elementForName: (OFString*)elementName