01: package com.silvermindsoftware.hitch.config;
02:
03: /**
04: * Copyright 2007 Brandon Goodin
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: public class ModelObjectConfig {
20:
21: private String modelField;
22: private boolean autoBind = true;
23: private boolean isDefault = false;
24: private String[] ignoreFields = new String[] {};
25:
26: public ModelObjectConfig(String modelField) {
27: this .modelField = modelField;
28: }
29:
30: public ModelObjectConfig(String modelField, boolean isDefault) {
31: this .modelField = modelField;
32: this .isDefault = isDefault;
33: }
34:
35: public ModelObjectConfig(String modelField, boolean isDefault,
36: boolean autoBind) {
37: this .modelField = modelField;
38: this .isDefault = isDefault;
39: this .autoBind = autoBind;
40: }
41:
42: public ModelObjectConfig(String modelField, boolean isDefault,
43: boolean autoBind, String[] ignoreFields) {
44: this .modelField = modelField;
45: this .autoBind = autoBind;
46: this .isDefault = isDefault;
47: this .ignoreFields = ignoreFields;
48: }
49:
50: public void setModelField(String modelField) {
51: this .modelField = modelField;
52: }
53:
54: public ModelObjectConfig setAutoBind(boolean autoBind) {
55: this .autoBind = autoBind;
56: return this ;
57: }
58:
59: public ModelObjectConfig setDefault(boolean aDefault) {
60: isDefault = aDefault;
61: return this ;
62: }
63:
64: public ModelObjectConfig setIgnoreFields(String[] ignoreFields) {
65: this .ignoreFields = ignoreFields;
66: return this ;
67: }
68:
69: public String getModelField() {
70: return modelField;
71: }
72:
73: public boolean isAutoBind() {
74: return autoBind;
75: }
76:
77: public boolean isDefault() {
78: return isDefault;
79: }
80:
81: public String[] getIgnoreFields() {
82: return ignoreFields;
83: }
84: }
|