| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
package org.apache.tapestry5.dom; |
| 16 | |
|
| 17 | |
import org.apache.tapestry5.internal.TapestryInternalUtils; |
| 18 | |
|
| 19 | |
import java.util.Map; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
public class Attribute |
| 28 | |
{ |
| 29 | |
private final Element element; |
| 30 | |
|
| 31 | |
private final String namespace; |
| 32 | |
|
| 33 | |
private final String name; |
| 34 | |
|
| 35 | |
String value; |
| 36 | |
|
| 37 | |
Attribute nextAttribute; |
| 38 | |
|
| 39 | |
Attribute(Element element, String namespace, String name, String value, Attribute nextAttribute) |
| 40 | 110252 | { |
| 41 | 110252 | this.element = element; |
| 42 | 110252 | this.namespace = namespace; |
| 43 | 110252 | this.name = name; |
| 44 | 110252 | this.value = value; |
| 45 | 110252 | this.nextAttribute = nextAttribute; |
| 46 | 110252 | } |
| 47 | |
|
| 48 | |
public String getName() |
| 49 | |
{ |
| 50 | 1422 | return name; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public String getNamespace() |
| 54 | |
{ |
| 55 | 110682 | return namespace; |
| 56 | |
} |
| 57 | |
|
| 58 | |
public String getValue() |
| 59 | |
{ |
| 60 | 2 | return value; |
| 61 | |
} |
| 62 | |
|
| 63 | |
void render(MarkupModel model, StringBuilder builder, Map<String, String> namespaceURIToPrefix) |
| 64 | |
{ |
| 65 | 110682 | builder.append(" "); |
| 66 | 110682 | builder.append(element.toPrefixedName(namespaceURIToPrefix, namespace, name)); |
| 67 | 110682 | builder.append("="); |
| 68 | 110682 | builder.append(model.getAttributeQuote()); |
| 69 | 110682 | model.encodeQuoted(value, builder); |
| 70 | 110682 | builder.append(model.getAttributeQuote()); |
| 71 | 110682 | } |
| 72 | |
|
| 73 | |
boolean matches(String namespace, String name) |
| 74 | |
{ |
| 75 | 34178 | return TapestryInternalUtils.isEqual(this.namespace, namespace) && |
| 76 | |
this.name.equalsIgnoreCase(name); |
| 77 | |
} |
| 78 | |
} |