|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
Element.java | - | - | - | - |
|
1 | // Copyright 2004, 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.hivemind; | |
16 | ||
17 | import java.util.List; | |
18 | ||
19 | ||
20 | /** | |
21 | * Simplified read-only thread safe DOM. | |
22 | * Currently, no support for namespaces, but that may come. | |
23 | * | |
24 | * @author Howard Lewis Ship | |
25 | */ | |
26 | public interface Element extends Locatable | |
27 | { | |
28 | /** | |
29 | * Returns the name of the element, as in, the name of the tag for the element. | |
30 | */ | |
31 | public String getElementName(); | |
32 | ||
33 | /** | |
34 | * Returns an unmodifiable list of {@link Attribute} for this element. | |
35 | * May return an empty list, but won't return null. The attributes | |
36 | * are in no specific order. | |
37 | */ | |
38 | public List getAttributes(); | |
39 | ||
40 | /** | |
41 | * Returns the value for an attribute, or null if the attribute is not specified. | |
42 | */ | |
43 | ||
44 | public String getAttributeValue(String attributeName); | |
45 | ||
46 | /** | |
47 | * Returns true if this element contains no other elements. | |
48 | */ | |
49 | public boolean isEmpty(); | |
50 | ||
51 | /** | |
52 | * Returns an unmodifiable list of {@link Element} directly contained | |
53 | * by this element. May return an empty list, but won't return null. | |
54 | * The elements are returned in the order in which they were encountered | |
55 | * in the XML. | |
56 | */ | |
57 | public List getElements(); | |
58 | ||
59 | /** | |
60 | * Returns the content of the element. This is a concatination of | |
61 | * all the text directly enclosed by the element. Ignorable whitespace | |
62 | * is ignored. The content is trimmed of leading and trailing whitespace. | |
63 | */ | |
64 | ||
65 | public String getContent(); | |
66 | } |
|