AttributesImpl.java
2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Decompiled with CFR 0_118.
*/
package com.day.crx.packaging.impl.proxy;
import org.xml.sax.Attributes;
public class AttributesImpl
extends org.xml.sax.helpers.AttributesImpl {
public static final Attributes EMPTY_ATTRIBUTES = new AttributesImpl();
public static final String CDATA = "CDATA";
public static final String ENTITY = "ENTITY";
public static final String ENTITIES = "ENTITIES";
public static final String ID = "ID";
public static final String IDREF = "IDREF";
public static final String IDREFS = "IDREFS";
public static final String NAME = "NAME";
public static final String NAMES = "NAMES";
public static final String NMTOKEN = "NMTOKEN";
public static final String NMTOKENS = "NMTOKENS";
public static final String NOTATION = "NOTATION";
public static final String NUMBER = "NUMBER";
public static final String NUMBERS = "NUMBERS";
public static final String NUTOKEN = "NUTOKEN";
public static final String NUTOKENS = "NUTOKENS";
public static Attributes update(Attributes attributes, String name, String value) {
AttributesImpl update = new AttributesImpl(attributes);
int index = update.getIndex(name);
if (index != -1) {
update.setValue(index, value);
} else {
update.addCDATAAttribute(name, value);
}
return update;
}
public AttributesImpl() {
}
public AttributesImpl(Attributes attr) {
super(attr);
}
public void addCDATAAttribute(String localName, String value) {
this.addAttribute("", localName, localName, "CDATA", value);
}
public void addCDATAAttribute(String namespace, String localName, String value) {
this.addAttribute(namespace, localName, localName, "CDATA", value);
}
public void addCDATAAttribute(String uri, String localName, String qName, String value) {
this.addAttribute(uri, localName, qName, "CDATA", value);
}
public void removeAttribute(String localName) {
int index = this.getIndex(localName);
if (index != -1) {
this.removeAttribute(index);
}
}
public void removeAttribute(String uri, String localName) {
int index = this.getIndex(uri, localName);
if (index != -1) {
this.removeAttribute(index);
}
}
}