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: package org.apache.commons.beanutils.bugs.other;
018:
019: import org.apache.commons.beanutils.bugs.Jira273TestCase;
020:
021: /**
022: * Factory which creates beans for {@link Jira273TestCase}.
023: *
024: * @version $Revision: 555172 $ $Date: 2007-07-11 06:18:17 +0100 (Wed, 11 Jul 2007) $
025: */
026: public class Jira273BeanFactory {
027:
028: /**
029: * Factory method which creates annonymous
030: * {@link PublicBeanWithMethod} with method NOT overriden.
031: *
032: * @return a new annonymous {@link PublicBeanWithMethod}.
033: */
034: public static Object createAnnonymousOverriden() {
035: return new PublicBeanWithMethod() {
036: public String getBeanValue() {
037: return "AnnonymousOverriden";
038: }
039: };
040: }
041:
042: /**
043: * Factory method which creates annonymous
044: * {@link PublicBeanWithMethod} with method overriden.
045: *
046: * @return a new annonymous {@link PublicBeanWithMethod}.
047: */
048: public static Object createAnnonymousNotOverriden() {
049: return new PublicBeanWithMethod() {
050: };
051: }
052:
053: /**
054: * Factory method which creates {@link PrivatePublicOverriden}.
055: *
056: * @return a new {@link PrivatePublicOverriden}.
057: */
058: public static Object createPrivatePublicOverriden() {
059: return new PrivatePublicOverriden();
060: }
061:
062: /**
063: * Factory method which creates {@link PrivatePrivatePublicOverriden}.
064: *
065: * @return a new {@link PrivatePrivatePublicOverriden}.
066: */
067: public static Object createPrivatePrivatePublicOverriden() {
068: return new PrivatePrivatePublicOverriden();
069: }
070:
071: /**
072: * Factory method which creates {@link PrivatePrivatePublicNotOverriden}.
073: *
074: * @return a new {@link PrivatePrivatePublicNotOverriden}.
075: */
076: public static Object createPrivatePrivatePublicNotOverriden() {
077: return new PrivatePrivatePublicNotOverriden();
078: }
079:
080: /**
081: * Factory method which creates {@link PrivatePublicNotOverriden}.
082: *
083: * @return a new {@link PrivatePublicNotOverriden}.
084: */
085: public static Object createPrivatePublicNotOverriden() {
086: return new PrivatePublicNotOverriden();
087: }
088:
089: private static class PrivateBeanWithMethod {
090: public String getBeanValue() {
091: return "PrivateBeanWithMethod";
092: }
093: }
094:
095: public static class PublicBeanWithMethod {
096: public String getBeanValue() {
097: return "PublicBeanWithMethod";
098: }
099: }
100:
101: private static class PrivatePublicOverriden extends
102: PublicBeanWithMethod {
103: public String getBeanValue() {
104: return "PrivatePublicOverriden";
105: }
106: }
107:
108: private static class PrivatePublicNotOverriden extends
109: PublicBeanWithMethod {
110: }
111:
112: private static class PrivatePrivatePublicOverriden extends
113: PrivatePublicNotOverriden {
114: public String getBeanValue() {
115: return "PrivatePrivatePublicOverriden";
116: }
117: }
118:
119: private static class PrivatePrivatePublicNotOverriden extends
120: PrivatePublicNotOverriden {
121: }
122: }
|