001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.jee;
017:
018: import javax.xml.bind.annotation.XmlAccessType;
019: import javax.xml.bind.annotation.XmlAccessorType;
020: import javax.xml.bind.annotation.XmlAttribute;
021: import javax.xml.bind.annotation.XmlElement;
022: import javax.xml.bind.annotation.XmlID;
023: import javax.xml.bind.annotation.XmlTransient;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027:
028: /**
029: * The attribute element defines an attribute for the nesting
030: * tag. The attribute element may have several subelements
031: * defining:
032: * <p/>
033: * description a description of the attribute
034: * <p/>
035: * name the name of the attribute
036: * <p/>
037: * required whether the attribute is required or
038: * optional
039: * <p/>
040: * rtexprvalue whether the attribute is a runtime attribute
041: * <p/>
042: * type the type of the attributes
043: * <p/>
044: * fragment whether this attribute is a fragment
045: * <p/>
046: * deferred-value present if this attribute is to be parsed as a
047: * javax.el.ValueExpression
048: * <p/>
049: * deferred-method present if this attribute is to be parsed as a
050: * javax.el.MethodExpression
051: */
052: @XmlAccessorType(XmlAccessType.FIELD)
053: @XmlType(name="tld-attributeType",propOrder={"descriptions","name","required","rtexprvalue","type","deferredValue","deferredMethod","fragment"})
054: public class TldAttribute {
055: @XmlTransient
056: protected TextMap description = new TextMap();
057: @XmlElement(required=true)
058: protected String name;
059: protected String required;
060: protected String rtexprvalue;
061: protected String type;
062: @XmlElement(name="deferred-value")
063: protected TldDeferredValue deferredValue;
064: @XmlElement(name="deferred-method")
065: protected TldDeferredMethod deferredMethod;
066: protected String fragment;
067: @XmlAttribute
068: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
069: @XmlID
070: protected String id;
071:
072: @XmlElement(name="description",required=true)
073: public Text[] getDescriptions() {
074: return description.toArray();
075: }
076:
077: public void setDescriptions(Text[] text) {
078: description.set(text);
079: }
080:
081: public String getDescription() {
082: return description.get();
083: }
084:
085: public String getName() {
086: return name;
087: }
088:
089: public void setName(String value) {
090: this .name = value;
091: }
092:
093: public String getRequired() {
094: return required;
095: }
096:
097: public void setRequired(String value) {
098: this .required = value;
099: }
100:
101: public String getRtexprvalue() {
102: return rtexprvalue;
103: }
104:
105: public void setRtexprvalue(String value) {
106: this .rtexprvalue = value;
107: }
108:
109: public String getType() {
110: return type;
111: }
112:
113: public void setType(String value) {
114: this .type = value;
115: }
116:
117: public TldDeferredValue getDeferredValue() {
118: return deferredValue;
119: }
120:
121: public void setDeferredValue(TldDeferredValue value) {
122: this .deferredValue = value;
123: }
124:
125: public TldDeferredMethod getDeferredMethod() {
126: return deferredMethod;
127: }
128:
129: public void setDeferredMethod(TldDeferredMethod value) {
130: this .deferredMethod = value;
131: }
132:
133: public String getFragment() {
134: return fragment;
135: }
136:
137: public void setFragment(String value) {
138: this .fragment = value;
139: }
140:
141: public String getId() {
142: return id;
143: }
144:
145: public void setId(String value) {
146: this.id = value;
147: }
148: }
|