001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.kfs.sec.businessobject;
017
018 import java.util.LinkedHashMap;
019
020 import org.kuali.kfs.sec.SecPropertyConstants;
021 import org.kuali.rice.kns.bo.TransientBusinessObjectBase;
022
023
024 /**
025 * Holds fields that provide metadata information for a security attribute
026 */
027 public class SecurityAttributeMetadata extends TransientBusinessObjectBase {
028 private Class attributeClass;
029 private String attributeField;
030 private String attributeNameField;
031
032 public SecurityAttributeMetadata() {
033 }
034
035 public SecurityAttributeMetadata(Class attributeClass, String attributeField) {
036 this.attributeClass = attributeClass;
037 this.attributeField = attributeField;
038 }
039
040 public SecurityAttributeMetadata(Class attributeClass, String attributeField, String attributeNameField) {
041 this.attributeClass = attributeClass;
042 this.attributeField = attributeField;
043 this.attributeNameField = attributeNameField;
044 }
045
046 /**
047 * Gets the attributeClass attribute.
048 *
049 * @return Returns the attributeClass.
050 */
051 public Class getAttributeClass() {
052 return attributeClass;
053 }
054
055
056 /**
057 * Sets the attributeClass attribute value.
058 *
059 * @param attributeClass The attributeClass to set.
060 */
061 public void setAttributeClass(Class attributeClass) {
062 this.attributeClass = attributeClass;
063 }
064
065
066 /**
067 * Gets the attributeField attribute.
068 *
069 * @return Returns the attributeField.
070 */
071 public String getAttributeField() {
072 return attributeField;
073 }
074
075
076 /**
077 * Sets the attributeField attribute value.
078 *
079 * @param attributeField The attributeField to set.
080 */
081 public void setAttributeField(String attributeField) {
082 this.attributeField = attributeField;
083 }
084
085
086 /**
087 * Gets the attributeNameField attribute.
088 *
089 * @return Returns the attributeNameField.
090 */
091 public String getAttributeNameField() {
092 return attributeNameField;
093 }
094
095 /**
096 * Sets the attributeNameField attribute value.
097 *
098 * @param attributeNameField The attributeNameField to set.
099 */
100 public void setAttributeNameField(String attributeNameField) {
101 this.attributeNameField = attributeNameField;
102 }
103
104 @Override
105 protected LinkedHashMap toStringMapper() {
106 LinkedHashMap m = new LinkedHashMap();
107
108 m.put(SecPropertyConstants.ATTRIBUTE_ID, this.attributeField);
109
110 return m;
111 }
112
113 }