001    /*
002     *   Copyright (C) Christian Schulte, 2005-206
003     *   All rights reserved.
004     *
005     *   Redistribution and use in source and binary forms, with or without
006     *   modification, are permitted provided that the following conditions
007     *   are met:
008     *
009     *     o Redistributions of source code must retain the above copyright
010     *       notice, this list of conditions and the following disclaimer.
011     *
012     *     o Redistributions in binary form must reproduce the above copyright
013     *       notice, this list of conditions and the following disclaimer in
014     *       the documentation and/or other materials provided with the
015     *       distribution.
016     *
017     *   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
018     *   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
019     *   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
020     *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
021     *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
022     *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
023     *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
024     *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025     *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
026     *   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027     *
028     *   $JOMC: TestUnmarshallerListener.java 3958 2011-11-18 22:32:23Z schulte2005 $
029     *
030     */
031    package org.jomc.modlet.test.support;
032    
033    import java.net.URL;
034    import javax.xml.bind.Unmarshaller;
035    
036    /**
037     * {@code Unmarshaller.Listener} test implementation.
038     *
039     * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a> 1.0
040     * @version $JOMC: TestUnmarshallerListener.java 3958 2011-11-18 22:32:23Z schulte2005 $
041     */
042    public final class TestUnmarshallerListener extends Unmarshaller.Listener
043    {
044    
045        private boolean booleanProperty;
046    
047        private char characterProperty;
048    
049        private byte byteProperty;
050    
051        private short shortProperty;
052    
053        private int intProperty;
054    
055        private long longProperty;
056    
057        private float floatProperty;
058    
059        private double doubleProperty;
060    
061        private String stringProperty;
062    
063        private String stringPropertyWithoutSetter;
064    
065        private String stringPropertyWithoutGetter;
066    
067        private URL urlProperty;
068    
069        private Thread.State enumProperty;
070    
071        private Object objectProperty;
072    
073        /** Creates a new {@code TestUnmarshallerListener} instance. */
074        public TestUnmarshallerListener()
075        {
076            super();
077        }
078    
079        @Override
080        public void beforeUnmarshal( final Object target, final Object parent )
081        {
082            System.out.println( this.getClass().getName() + ": beforeUnmarshal(" + target + ", " + parent + ")" );
083        }
084    
085        @Override
086        public void afterUnmarshal( final Object target, final Object parent )
087        {
088            System.out.println( this.getClass().getName() + ": afterUnmarshal(" + target + ", " + parent + ")" );
089        }
090    
091        public boolean isBooleanProperty()
092        {
093            return this.booleanProperty;
094        }
095    
096        public void setBooleanProperty( final boolean value )
097        {
098            this.booleanProperty = value;
099        }
100    
101        public char getCharacterProperty()
102        {
103            return this.characterProperty;
104        }
105    
106        public void setCharacterProperty( final char value )
107        {
108            this.characterProperty = value;
109        }
110    
111        public byte getByteProperty()
112        {
113            return this.byteProperty;
114        }
115    
116        public void setByteProperty( final byte value )
117        {
118            this.byteProperty = value;
119        }
120    
121        public short getShortProperty()
122        {
123            return this.shortProperty;
124        }
125    
126        public void setShortProperty( final short value )
127        {
128            this.shortProperty = value;
129        }
130    
131        public int getIntProperty()
132        {
133            return this.intProperty;
134        }
135    
136        public void setIntProperty( final int value )
137        {
138            this.intProperty = value;
139        }
140    
141        public long getLongProperty()
142        {
143            return this.longProperty;
144        }
145    
146        public void setLongProperty( final long value )
147        {
148            this.longProperty = value;
149        }
150    
151        public float getFloatProperty()
152        {
153            return this.floatProperty;
154        }
155    
156        public void setFloatProperty( final float value )
157        {
158            this.floatProperty = value;
159        }
160    
161        public double getDoubleProperty()
162        {
163            return this.doubleProperty;
164        }
165    
166        public void setDoubleProperty( final double value )
167        {
168            this.doubleProperty = value;
169        }
170    
171        public String getStringProperty()
172        {
173            return this.stringProperty;
174        }
175    
176        public void setStringProperty( final String value )
177        {
178            this.stringProperty = value;
179        }
180    
181        public String getStringPropertyWithoutSetter()
182        {
183            return this.stringPropertyWithoutSetter;
184        }
185    
186        public void setStringPropertyWithoutGetter( final String value )
187        {
188            this.stringPropertyWithoutGetter = value;
189        }
190    
191        public URL getUrlProperty()
192        {
193            return this.urlProperty;
194        }
195    
196        public void setUrlProperty( final URL value )
197        {
198            this.urlProperty = value;
199        }
200    
201        public Thread.State getEnumProperty()
202        {
203            return this.enumProperty;
204        }
205    
206        public void setEnumProperty( final Thread.State value )
207        {
208            this.enumProperty = value;
209        }
210    
211        public Object getObjectProperty()
212        {
213            return this.objectProperty;
214        }
215    
216        public void setObjectProperty( final Object value )
217        {
218            this.objectProperty = value;
219        }
220    
221    }