001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.commons.betwixt;
019:
020: import org.apache.commons.beanutils.DynaBean;
021: import org.apache.commons.beanutils.DynaClass;
022: import org.apache.commons.beanutils.DynaProperty;
023:
024: /** <p>Test bean which extends DynaBean but has a .betwixt file.</p>
025: *
026: * @author Robert Burrell Donkin
027: * @version $Revision: 438373 $
028: */
029: public class DynaWithDotBetwixt implements DynaBean {
030:
031: private String notDynaProperty;
032: private String dynaProperty;
033:
034: public DynaWithDotBetwixt() {
035: this ("DEFAUL_NOT_DYNA", "DEFAULT_DYNA");
036: }
037:
038: public DynaWithDotBetwixt(String notDynaProperty,
039: String dynaProperty) {
040: this .notDynaProperty = notDynaProperty;
041: this .dynaProperty = dynaProperty;
042: }
043:
044: public String getNotDynaProperty() {
045: return notDynaProperty;
046: }
047:
048: public String fiddleDyna() {
049: return dynaProperty;
050: }
051:
052: public boolean contains(String name, String key) {
053: return false;
054: }
055:
056: public Object get(String name) {
057: return dynaProperty;
058: }
059:
060: public Object get(String name, int index) {
061: return dynaProperty;
062: }
063:
064: public Object get(String name, String key) {
065: return dynaProperty;
066: }
067:
068: public DynaClass getDynaClass() {
069: return new DynaClass() {
070: public DynaProperty[] getDynaProperties() {
071: DynaProperty[] properties = { new DynaProperty(
072: "DynaProp", String.class) };
073: return properties;
074: }
075:
076: public String getName() {
077: return "DynaWithDotBetwixtClass";
078: }
079:
080: public DynaBean newInstance() {
081: return new DynaWithDotBetwixt();
082: }
083:
084: public DynaProperty getDynaProperty(String name) {
085: if ("DynaProp".equals(name)) {
086: return new DynaProperty("DynaProp", String.class);
087: }
088: return null;
089: }
090: };
091: }
092:
093: public void remove(String name, String key) {
094: }
095:
096: public void set(String name, Object value) {
097: }
098:
099: public void set(String name, int index, Object value) {
100: }
101:
102: public void set(String name, String key, Object value) {
103: }
104:
105: }
|