001: /**
002: *
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */package org.apache.openejb.jee;
018:
019: import javax.xml.bind.annotation.XmlAccessType;
020: import javax.xml.bind.annotation.XmlAccessorType;
021: import javax.xml.bind.annotation.XmlAttribute;
022: import javax.xml.bind.annotation.XmlElement;
023: import javax.xml.bind.annotation.XmlID;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.XmlTransient;
026: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
027: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028:
029: /**
030: * The security-role-refType contains the declaration of a
031: * security role reference in a component's or a
032: * Deployment Component's code. The declaration consists of an
033: * optional description, the security role name used in the
034: * code, and an optional link to a security role. If the
035: * security role is not specified, the Deployer must choose an
036: * appropriate security role.
037: */
038: @XmlAccessorType(XmlAccessType.FIELD)
039: @XmlType(name="security-role-refType",propOrder={"descriptions","roleName","roleLink"})
040: public class SecurityRoleRef {
041:
042: @XmlElement(name="role-name",required=true)
043: protected String roleName;
044: @XmlElement(name="role-link")
045: protected String roleLink;
046: @XmlAttribute
047: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
048: @XmlID
049: protected String id;
050:
051: @XmlTransient
052: protected TextMap description = new TextMap();
053:
054: public SecurityRoleRef() {
055: }
056:
057: public SecurityRoleRef(String roleName) {
058: this .roleName = roleName;
059: }
060:
061: public SecurityRoleRef(String roleName, String roleLink) {
062: this .roleName = roleName;
063: this .roleLink = roleLink;
064: }
065:
066: @XmlElement(name="description",required=true)
067: public Text[] getDescriptions() {
068: return description.toArray();
069: }
070:
071: public void setDescriptions(Text[] text) {
072: description.set(text);
073: }
074:
075: public String getDescription() {
076: return description.get();
077: }
078:
079: public String getRoleName() {
080: return roleName;
081: }
082:
083: public void setRoleName(String value) {
084: this .roleName = value;
085: }
086:
087: public String getRoleLink() {
088: return roleLink;
089: }
090:
091: public void setRoleLink(String value) {
092: this .roleLink = value;
093: }
094:
095: public String getId() {
096: return id;
097: }
098:
099: public void setId(String value) {
100: this.id = value;
101: }
102:
103: }
|