01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.jsp.support;
16:
17: import java.io.Serializable;
18: import org.w3c.dom.Element;
19: import org.w3c.dom.NodeList;
20:
21: public class TagInfo implements Serializable {
22: protected String tagName;
23:
24: protected String tagClassName;
25:
26: public String getTagClassName() {
27: return tagClassName;
28: }
29:
30: public void setTagClassName(String tagClassName) {
31: this .tagClassName = tagClassName;
32: }
33:
34: public String getTagName() {
35: return tagName;
36: }
37:
38: public void setTagName(String tagName) {
39: this .tagName = tagName;
40: }
41:
42: public static TagInfo readTagInfo(Element tagElement) {
43:
44: TagInfo tag = new TagInfo();
45:
46: NodeList nameElements = tagElement.getElementsByTagName("name");
47: Element nameElement = (Element) nameElements.item(0);
48: tag.setTagName(nameElement.getFirstChild().getNodeValue());
49:
50: NodeList classElements = tagElement
51: .getElementsByTagName("tag-class");
52: Element classElement = (Element) classElements.item(0);
53: tag
54: .setTagClassName(classElement.getFirstChild()
55: .getNodeValue());
56:
57: return tag;
58: }
59: }
|