Save This Page
Home » openejb-3.1.2-src » org.apache » openejb » jee » [javadoc | source]
    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   package org.apache.openejb.jee;
   18   
   19   import javax.xml.bind.annotation.XmlAccessType;
   20   import javax.xml.bind.annotation.XmlAccessorType;
   21   import javax.xml.bind.annotation.XmlAttribute;
   22   import javax.xml.bind.annotation.XmlElement;
   23   import javax.xml.bind.annotation.XmlID;
   24   import javax.xml.bind.annotation.XmlTransient;
   25   import javax.xml.bind.annotation.XmlType;
   26   import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
   27   import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
   28   import java.util.ArrayList;
   29   import java.util.Collection;
   30   import java.util.List;
   31   import java.util.Map;
   32   
   33   /**
   34    * The function element is used to provide information on each
   35    * function in the tag library that is to be exposed to the EL.
   36    * <p/>
   37    * The function element may have several subelements defining:
   38    * <p/>
   39    * description         Optional tag-specific information
   40    * <p/>
   41    * display-name        A short name that is intended to be displayed
   42    * by tools
   43    * <p/>
   44    * icon                Optional icon element that can be used by tools
   45    * <p/>
   46    * name                A unique name for this function
   47    * <p/>
   48    * function-class      Provides the name of the Java class that
   49    * implements the function
   50    * <p/>
   51    * function-signature  Provides the signature, as in the Java Language
   52    * Specification, of the Java method that is to be
   53    * used to implement the function.
   54    * <p/>
   55    * example             Optional informal description of an
   56    * example of a use of this function
   57    * <p/>
   58    * function-extension  Zero or more extensions that provide extra
   59    * information about this function, for tool
   60    * consumption
   61    */
   62   @XmlAccessorType(XmlAccessType.FIELD)
   63   @XmlType(name = "functionType", propOrder = {
   64       "descriptions",
   65       "displayNames",
   66       "icon",
   67       "name",
   68       "functionClass",
   69       "functionSignature",
   70       "example",
   71       "functionExtension"
   72   })
   73   public class Function {
   74       @XmlTransient
   75       protected TextMap description = new TextMap();
   76       @XmlTransient
   77       protected TextMap displayName = new TextMap();
   78       @XmlElement(name = "icon", required = true)
   79       protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
   80   
   81       @XmlElement(required = true)
   82       protected String name;
   83       @XmlElement(name = "function-class", required = true)
   84       protected String functionClass;
   85       @XmlElement(name = "function-signature", required = true)
   86       protected String functionSignature;
   87       protected String example;
   88       @XmlElement(name = "function-extension")
   89       protected List<TldExtension> functionExtension;
   90       @XmlAttribute
   91       @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
   92       @XmlID
   93       protected String id;
   94   
   95       @XmlElement(name = "description", required = true)
   96       public Text[] getDescriptions() {
   97           return description.toArray();
   98       }
   99   
  100       public void setDescriptions(Text[] text) {
  101           description.set(text);
  102       }
  103   
  104       public String getDescription() {
  105           return description.get();
  106       }
  107   
  108       @XmlElement(name = "display-name", required = true)
  109       public Text[] getDisplayNames() {
  110           return displayName.toArray();
  111       }
  112   
  113       public void setDisplayNames(Text[] text) {
  114           displayName.set(text);
  115       }
  116   
  117       public String getDisplayName() {
  118           return displayName.get();
  119       }
  120   
  121       public Collection<Icon> getIcons() {
  122           if (icon == null) {
  123               icon = new LocalCollection<Icon>();
  124           }
  125           return icon;
  126       }
  127   
  128       public Map<String, Icon> getIconMap() {
  129           if (icon == null) {
  130               icon = new LocalCollection<Icon>();
  131           }
  132           return icon.toMap();
  133       }
  134   
  135       public Icon getIcon() {
  136           return icon.getLocal();
  137       }
  138   
  139       public String getName() {
  140           return name;
  141       }
  142   
  143       public void setName(String value) {
  144           this.name = value;
  145       }
  146   
  147       public String getFunctionClass() {
  148           return functionClass;
  149       }
  150   
  151       public void setFunctionClass(String value) {
  152           this.functionClass = value;
  153       }
  154   
  155       public String getFunctionSignature() {
  156           return functionSignature;
  157       }
  158   
  159       public void setFunctionSignature(String value) {
  160           this.functionSignature = value;
  161       }
  162   
  163       public String getExample() {
  164           return example;
  165       }
  166   
  167       public void setExample(String value) {
  168           this.example = value;
  169       }
  170   
  171       public List<TldExtension> getFunctionExtension() {
  172           if (functionExtension == null) {
  173               functionExtension = new ArrayList<TldExtension>();
  174           }
  175           return this.functionExtension;
  176       }
  177   
  178       public String getId() {
  179           return id;
  180       }
  181   
  182       public void setId(String value) {
  183           this.id = value;
  184       }
  185   }

Save This Page
Home » openejb-3.1.2-src » org.apache » openejb » jee » [javadoc | source]