01: /**
02: * Licensed under the Common Development and Distribution License,
03: * you may not use this file except in compliance with the License.
04: * You may obtain a copy of the License at
05: *
06: * http://www.sun.com/cddl/
07: *
08: * Unless required by applicable law or agreed to in writing, software
09: * distributed under the License is distributed on an "AS IS" BASIS,
10: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11: * implied. See the License for the specific language governing
12: * permissions and limitations under the License.
13: */package com.sun.facelets.tag;
14:
15: /**
16: * Representation of a Tag in the Facelet definition
17: *
18: * @author Jacob Hookom
19: * @version $Id: Tag.java,v 1.4 2005/08/24 04:38:48 jhook Exp $
20: */
21: public final class Tag {
22: private final TagAttributes attributes;
23:
24: private final Location location;
25:
26: private final String namespace;
27:
28: private final String localName;
29:
30: private final String qName;
31:
32: public Tag(Location location, String namespace, String localName,
33: String qName, TagAttributes attributes) {
34: this .location = location;
35: this .namespace = namespace;
36: this .localName = localName;
37: this .qName = qName;
38: this .attributes = attributes;
39: }
40:
41: public Tag(Tag orig, TagAttributes attributes) {
42: this (orig.getLocation(), orig.getNamespace(), orig
43: .getLocalName(), orig.getQName(), attributes);
44: }
45:
46: /**
47: * All TagAttributes specified
48: *
49: * @return all TagAttributes specified
50: */
51: public TagAttributes getAttributes() {
52: return attributes;
53: }
54:
55: /**
56: * Local name of the tag <my:tag /> would be "tag"
57: *
58: * @return local name of the tag
59: */
60: public String getLocalName() {
61: return localName;
62: }
63:
64: /**
65: * Location of the Tag in the Facelet file
66: *
67: * @return location of the Tag in the Facelet file
68: */
69: public Location getLocation() {
70: return location;
71: }
72:
73: /**
74: * The resolved Namespace for this tag
75: *
76: * @return the resolved namespace for this tag
77: */
78: public String getNamespace() {
79: return namespace;
80: }
81:
82: /**
83: * Get the qualified name for this tag <my:tag /> would be "my:tag"
84: *
85: * @return qualified name of the tag
86: */
87: public String getQName() {
88: return qName;
89: }
90:
91: /*
92: * (non-Javadoc)
93: *
94: * @see java.lang.Object#toString()
95: */
96: public String toString() {
97: return this .location + " <" + this .qName + ">";
98: }
99: }
|