View Javadoc

1   /*
2    *   Copyright (C) Christian Schulte, 2005-206
3    *   All rights reserved.
4    *
5    *   Redistribution and use in source and binary forms, with or without
6    *   modification, are permitted provided that the following conditions
7    *   are met:
8    *
9    *     o Redistributions of source code must retain the above copyright
10   *       notice, this list of conditions and the following disclaimer.
11   *
12   *     o Redistributions in binary form must reproduce the above copyright
13   *       notice, this list of conditions and the following disclaimer in
14   *       the documentation and/or other materials provided with the
15   *       distribution.
16   *
17   *   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
18   *   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
19   *   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20   *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
21   *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22   *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23   *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24   *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25   *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26   *   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27   *
28   *   $JOMC: TestUnmarshallerListener.java 3958 2011-11-18 22:32:23Z schulte2005 $
29   *
30   */
31  package org.jomc.modlet.test.support;
32  
33  import java.net.URL;
34  import javax.xml.bind.Unmarshaller;
35  
36  /**
37   * {@code Unmarshaller.Listener} test implementation.
38   *
39   * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a> 1.0
40   * @version $JOMC: TestUnmarshallerListener.java 3958 2011-11-18 22:32:23Z schulte2005 $
41   */
42  public final class TestUnmarshallerListener extends Unmarshaller.Listener
43  {
44  
45      private boolean booleanProperty;
46  
47      private char characterProperty;
48  
49      private byte byteProperty;
50  
51      private short shortProperty;
52  
53      private int intProperty;
54  
55      private long longProperty;
56  
57      private float floatProperty;
58  
59      private double doubleProperty;
60  
61      private String stringProperty;
62  
63      private String stringPropertyWithoutSetter;
64  
65      private String stringPropertyWithoutGetter;
66  
67      private URL urlProperty;
68  
69      private Thread.State enumProperty;
70  
71      private Object objectProperty;
72  
73      /** Creates a new {@code TestUnmarshallerListener} instance. */
74      public TestUnmarshallerListener()
75      {
76          super();
77      }
78  
79      @Override
80      public void beforeUnmarshal( final Object target, final Object parent )
81      {
82          System.out.println( this.getClass().getName() + ": beforeUnmarshal(" + target + ", " + parent + ")" );
83      }
84  
85      @Override
86      public void afterUnmarshal( final Object target, final Object parent )
87      {
88          System.out.println( this.getClass().getName() + ": afterUnmarshal(" + target + ", " + parent + ")" );
89      }
90  
91      public boolean isBooleanProperty()
92      {
93          return this.booleanProperty;
94      }
95  
96      public void setBooleanProperty( final boolean value )
97      {
98          this.booleanProperty = value;
99      }
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 }