001: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal;
007:
008: /**
009: * Represents the channel parameters that are part of a ChannelDefinition.
010: * ChannelParameters define named parameters along with values for those
011: * parameters and an indication of whether it is permissible to override those
012: * default values.
013: * @author <a href="mailto:mvi@immagic.com">Michael Ivanov</a>
014: * @version $Revision: 35317 $ $Date: 2005-01-12 15:26:56 -0700 (Wed, 12 Jan 2005) $
015: */
016:
017: /**
018: * Describes a channel definition parameter.
019: * A channel can have zero or more parameters.
020: */
021: public class ChannelParameter {
022:
023: /** The name of the parameter. */
024: String name;
025:
026: /** A default value for the parameter. */
027: String value;
028:
029: /** True if the default value may be overridden. */
030: boolean override;
031:
032: /** A description of the parameter. */
033: String descr;
034:
035: /**
036: * Instantiate a ChannelParameter with a particular name, value, and
037: * indication of whether it can be overridden.
038: * @param name - the name of the channel parameter
039: * @param value - the value of the channel parameter
040: * @param override - "Y" if overridable, "N" otherwise.
041: * @deprecated resolve override to a boolean and use the other constructor
042: */
043: public ChannelParameter(String name, String value, String override) {
044: this (name, value, RDBMServices.dbFlag(override));
045: }
046:
047: /**
048: * Instantiate a ChannelParameter with a particular name, default value,
049: * and indication of whether it can be overridden.
050: * @param name name of the channel parameter.
051: * @param value default value for the parameter.
052: * @param override true if the default value may be overridden.
053: */
054: public ChannelParameter(String name, String value, boolean override) {
055: this .name = name;
056: this .value = value;
057: this .override = override;
058: }
059:
060: // Getter methods
061:
062: /**
063: * Get the name of the channel parameter.
064: * @return the name of the channel parameter.
065: */
066: public String getName() {
067: return this .name;
068: }
069:
070: /**
071: * Get the default value of the channel parameter.
072: * @return the default value for this channel parameter.
073: */
074: public String getValue() {
075: return this .value;
076: }
077:
078: /**
079: * Get whether the value of this channel parameter may be overridden.
080: * @return true if value may be overridden, false otherwise.
081: */
082: public boolean getOverride() {
083: return this .override;
084: }
085:
086: /**
087: * Get a description of this channel parameter.
088: * @return a description of this channel parameter.
089: */
090: public String getDescription() {
091: return this .descr;
092: }
093:
094: // Setter methods
095:
096: /**
097: * Set the name of the channel parameter.
098: * @param name the name of the channel parameter
099: */
100: public void setName(String name) {
101: this .name = name;
102: }
103:
104: /**
105: * Set the default value for this channel parameter.
106: * @param value the default value for this channel parameter.
107: */
108: public void setValue(String value) {
109: this .value = value;
110: }
111:
112: /**
113: * Set whether this channel parameter may be overridden.
114: * @param override true if the channel parameter may be overridden.
115: */
116: public void setOverride(boolean override) {
117: this .override = override;
118: }
119:
120: /**
121: * Set the description of this channel parameter.
122: * @param descr description of this channel parameter.
123: */
124: public void setDescription(String descr) {
125: this.descr = descr;
126: }
127: }
|