001: package com.silvermindsoftware.hitch.config;
002:
003: /**
004: * Copyright 2007 Brandon Goodin
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * 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: */
018:
019: import com.silvermindsoftware.hitch.ReadOnly;
020:
021: public class BoundComponentConfig {
022:
023: private Class type = void.class;
024: private String componentFieldName;
025: private String modelPropertyName;
026: private Class handlerClass = void.class;
027: private String[] handlerParameters = new String[] {};
028: private ReadOnly readOnly = ReadOnly.DEFAULT;
029:
030: public BoundComponentConfig(String sharedPropertyName) {
031:
032: this .componentFieldName = sharedPropertyName;
033: this .modelPropertyName = sharedPropertyName;
034:
035: }
036:
037: public BoundComponentConfig(String sharedPropertyName,
038: Class handlerClass) {
039:
040: this .componentFieldName = sharedPropertyName;
041: this .modelPropertyName = sharedPropertyName;
042: this .handlerClass = handlerClass;
043:
044: }
045:
046: public BoundComponentConfig(String sharedPropertyName,
047: String[] handlerParameters) {
048:
049: this .componentFieldName = sharedPropertyName;
050: this .modelPropertyName = sharedPropertyName;
051: this .handlerParameters = handlerParameters;
052:
053: }
054:
055: public BoundComponentConfig(String sharedPropertyName,
056: Class handlerClass, String[] handlerParameters) {
057:
058: this .componentFieldName = sharedPropertyName;
059: this .modelPropertyName = sharedPropertyName;
060: this .handlerClass = handlerClass;
061: this .handlerParameters = handlerParameters;
062:
063: }
064:
065: public BoundComponentConfig(String componentFieldName,
066: String modelPropertyName) {
067:
068: this .componentFieldName = componentFieldName;
069: this .modelPropertyName = modelPropertyName;
070:
071: }
072:
073: public BoundComponentConfig(String componentFieldName,
074: String modelPropertyName, Class handlerClass) {
075:
076: this .componentFieldName = componentFieldName;
077: this .modelPropertyName = modelPropertyName;
078: this .handlerClass = handlerClass;
079:
080: }
081:
082: public BoundComponentConfig(String componentFieldName,
083: String modelPropertyName, String[] handlerParameters) {
084:
085: this .componentFieldName = componentFieldName;
086: this .modelPropertyName = modelPropertyName;
087: this .handlerParameters = handlerParameters;
088:
089: }
090:
091: public BoundComponentConfig(String componentFieldName,
092: String modelPropertyName, Class handlerClass,
093: String[] handlerParameters) {
094:
095: this .componentFieldName = componentFieldName;
096: this .modelPropertyName = modelPropertyName;
097: this .handlerClass = handlerClass;
098: this .handlerParameters = handlerParameters;
099:
100: }
101:
102: public BoundComponentConfig(String componentFieldName,
103: String modelPropertyName, Class handlerClass,
104: String[] handlerParameters, ReadOnly readOnly, Class type) {
105:
106: this .componentFieldName = componentFieldName;
107: this .modelPropertyName = modelPropertyName;
108: this .handlerClass = handlerClass;
109: this .handlerParameters = handlerParameters;
110: this .readOnly = readOnly;
111: this .type = type;
112:
113: }
114:
115: public String getComponentFieldName() {
116: return componentFieldName;
117: }
118:
119: public String getModelPropertyName() {
120: return modelPropertyName;
121: }
122:
123: public Class getHandlerClass() {
124: return handlerClass;
125: }
126:
127: public String[] getHandlerParameters() {
128: return handlerParameters;
129: }
130:
131: public ReadOnly getReadOnly() {
132: return readOnly;
133: }
134:
135: public Class getType() {
136: return type;
137: }
138:
139: }
|