001: /*
002: * Copyright 2002-2007 the original author or authors.
003: *
004: * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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:
017: package org.springframework.beans.factory.xml;
018:
019: import org.springframework.beans.factory.parsing.DefaultsDefinition;
020:
021: /**
022: * Simple JavaBean that holds the defaults specified at the <code>%lt;beans></code>
023: * level in a standard Spring XML bean definition document:
024: * <code>default-lazy-init</code>, <code>default-autowire</code>, etc
025: *
026: * @author Juergen Hoeller
027: * @since 2.0.2
028: */
029: public class DocumentDefaultsDefinition implements DefaultsDefinition {
030:
031: private String lazyInit;
032:
033: private String merge;
034:
035: private String autowire;
036:
037: private String dependencyCheck;
038:
039: private String autowireCandidates;
040:
041: private String initMethod;
042:
043: private String destroyMethod;
044:
045: private Object source;
046:
047: /**
048: * Set the default lazy-init flag for the document that's currently parsed.
049: */
050: public void setLazyInit(String lazyInit) {
051: this .lazyInit = lazyInit;
052: }
053:
054: /**
055: * Return the default lazy-init flag for the document that's currently parsed.
056: */
057: public String getLazyInit() {
058: return this .lazyInit;
059: }
060:
061: /**
062: * Set the default merge setting for the document that's currently parsed.
063: */
064: public void setMerge(String merge) {
065: this .merge = merge;
066: }
067:
068: /**
069: * Return the default merge setting for the document that's currently parsed.
070: */
071: public String getMerge() {
072: return this .merge;
073: }
074:
075: /**
076: * Set the default autowire setting for the document that's currently parsed.
077: */
078: public void setAutowire(String autowire) {
079: this .autowire = autowire;
080: }
081:
082: /**
083: * Return the default autowire setting for the document that's currently parsed.
084: */
085: public String getAutowire() {
086: return this .autowire;
087: }
088:
089: /**
090: * Set the default dependency-check setting for the document that's currently parsed.
091: */
092: public void setDependencyCheck(String dependencyCheck) {
093: this .dependencyCheck = dependencyCheck;
094: }
095:
096: /**
097: * Return the default dependency-check setting for the document that's currently parsed.
098: */
099: public String getDependencyCheck() {
100: return this .dependencyCheck;
101: }
102:
103: /**
104: * Set the default autowire-candidate pattern for the document that's currently parsed.
105: * Also accepts a comma-separated list of patterns.
106: */
107: public void setAutowireCandidates(String autowireCandidates) {
108: this .autowireCandidates = autowireCandidates;
109: }
110:
111: /**
112: * Return the default autowire-candidate pattern for the document that's currently parsed.
113: * May also return a comma-separated list of patterns.
114: */
115: public String getAutowireCandidates() {
116: return this .autowireCandidates;
117: }
118:
119: /**
120: * Set the default init-method setting for the document that's currently parsed.
121: */
122: public void setInitMethod(String initMethod) {
123: this .initMethod = initMethod;
124: }
125:
126: /**
127: * Return the default init-method setting for the document that's currently parsed.
128: */
129: public String getInitMethod() {
130: return this .initMethod;
131: }
132:
133: /**
134: * Set the default destroy-method setting for the document that's currently parsed.
135: */
136: public void setDestroyMethod(String destroyMethod) {
137: this .destroyMethod = destroyMethod;
138: }
139:
140: /**
141: * Return the default destroy-method setting for the document that's currently parsed.
142: */
143: public String getDestroyMethod() {
144: return this .destroyMethod;
145: }
146:
147: /**
148: * Set the configuration source <code>Object</code> for this metadata element.
149: * <p>The exact type of the object will depend on the configuration mechanism used.
150: */
151: public void setSource(Object source) {
152: this .source = source;
153: }
154:
155: public Object getSource() {
156: return this.source;
157: }
158:
159: }
|