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 variableType provides information on the scripting
030: * variables defined by using this tag. It is a (translation
031: * time) error for a tag that has one or more variable
032: * subelements to have a TagExtraInfo class that returns a
033: * non-null value from a call to getVariableInfo().
034: * <p/>
035: * The subelements of variableType are of the form:
036: * <p/>
037: * description Optional description of this
038: * variable
039: * <p/>
040: * name-given The variable name as a constant
041: * <p/>
042: * name-from-attribute The name of an attribute whose
043: * (translation time) value will
044: * give the name of the
045: * variable. One of name-given or
046: * name-from-attribute is required.
047: * <p/>
048: * variable-class Name of the class of the variable.
049: * java.lang.String is default.
050: * <p/>
051: * declare Whether the variable is declared
052: * or not. True is the default.
053: * <p/>
054: * scope The scope of the scripting varaible
055: * defined. NESTED is default.
056: */
057: @XmlAccessorType(XmlAccessType.FIELD)
058: @XmlType(name="variableType",propOrder={"descriptions","nameGiven","nameFromAttribute","variableClass","declare","scope"})
059: public class Variable {
060: @XmlTransient
061: protected TextMap description = new TextMap();
062: @XmlElement(name="name-given")
063: protected String nameGiven;
064: @XmlElement(name="name-from-attribute")
065: protected String nameFromAttribute;
066: @XmlElement(name="variable-class")
067: protected String variableClass;
068: protected String declare;
069: protected String scope;
070: @XmlAttribute
071: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
072: @XmlID
073: protected String id;
074:
075: @XmlElement(name="description",required=true)
076: public Text[] getDescriptions() {
077: return description.toArray();
078: }
079:
080: public void setDescriptions(Text[] text) {
081: description.set(text);
082: }
083:
084: public String getDescription() {
085: return description.get();
086: }
087:
088: public String getNameGiven() {
089: return nameGiven;
090: }
091:
092: public void setNameGiven(String value) {
093: this .nameGiven = value;
094: }
095:
096: public String getNameFromAttribute() {
097: return nameFromAttribute;
098: }
099:
100: public void setNameFromAttribute(String value) {
101: this .nameFromAttribute = value;
102: }
103:
104: public String getVariableClass() {
105: return variableClass;
106: }
107:
108: public void setVariableClass(String value) {
109: this .variableClass = value;
110: }
111:
112: public String getDeclare() {
113: return declare;
114: }
115:
116: public void setDeclare(String value) {
117: this .declare = value;
118: }
119:
120: public String getScope() {
121: return scope;
122: }
123:
124: public void setScope(String value) {
125: this .scope = value;
126: }
127:
128: public String getId() {
129: return id;
130: }
131:
132: public void setId(String value) {
133: this.id = value;
134: }
135: }
|