You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2012/04/05 17:46:40 UTC
svn commit: r1309907 - in
/commons/proper/digester/trunk/annotations-processor/src/test/java/org: ./
apache/ apache/commons/ apache/commons/digester3/
apache/commons/digester3/annotations/
apache/commons/digester3/annotations/processor/
Author: simonetripodi
Date: Thu Apr 5 15:46:39 2012
New Revision: 1309907
URL: http://svn.apache.org/viewvc?rev=1309907&view=rev
Log:
just added few annotated classes with Digester annotations for testing purposes
Added:
commons/proper/digester/trunk/annotations-processor/src/test/java/org/
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java (with props)
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java (with props)
commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java (with props)
Added: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java?rev=1309907&view=auto
==============================================================================
--- commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java (added)
+++ commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java Thu Apr 5 15:46:39 2012
@@ -0,0 +1,173 @@
+package org.apache.commons.digester3.annotations.processor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
+import org.apache.commons.digester3.annotations.rules.ObjectCreate;
+import org.apache.commons.digester3.annotations.rules.SetNext;
+
+@ObjectCreate( pattern = "rss/channel" )
+public final class Channel
+{
+
+ private final List<Item> items = new ArrayList<Item>();
+
+ @BeanPropertySetter( pattern = "rss/channel/title" )
+ private String title;
+
+ @BeanPropertySetter( pattern = "rss/channel/link" )
+ private String link;
+
+ @BeanPropertySetter( pattern = "rss/channel/description" )
+ private String description;
+
+ @BeanPropertySetter( pattern = "rss/channel/language" )
+ private String language;
+
+ private Image image;
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( String title )
+ {
+ this.title = title;
+ }
+
+ public String getLink()
+ {
+ return link;
+ }
+
+ public void setLink( String link )
+ {
+ this.link = link;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ public String getLanguage()
+ {
+ return language;
+ }
+
+ public void setLanguage( String language )
+ {
+ this.language = language;
+ }
+
+ public List<Item> getItems()
+ {
+ return items;
+ }
+
+ public Image getImage()
+ {
+ return image;
+ }
+
+ @SetNext
+ public void setImage( Image image )
+ {
+ this.image = image;
+ }
+
+ @SetNext
+ public void addItem( Item item )
+ {
+ this.items.add( item );
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ return true;
+ if ( obj == null )
+ return false;
+ if ( getClass() != obj.getClass() )
+ return false;
+ Channel other = (Channel) obj;
+ if ( description == null )
+ {
+ if ( other.description != null )
+ return false;
+ }
+ else if ( !description.equals( other.description ) )
+ return false;
+ if ( image == null )
+ {
+ if ( other.image != null )
+ return false;
+ }
+ else if ( !image.equals( other.image ) )
+ return false;
+ if ( items == null )
+ {
+ if ( other.items != null )
+ return false;
+ }
+ else if ( !items.equals( other.items ) )
+ return false;
+ if ( language == null )
+ {
+ if ( other.language != null )
+ return false;
+ }
+ else if ( !language.equals( other.language ) )
+ return false;
+ if ( link == null )
+ {
+ if ( other.link != null )
+ return false;
+ }
+ else if ( !link.equals( other.link ) )
+ return false;
+ if ( title == null )
+ {
+ if ( other.title != null )
+ return false;
+ }
+ else if ( !title.equals( other.title ) )
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Channel [description=" + description + ", image=" + image + ", items=" + items + ", language="
+ + language + ", link=" + link + ", title=" + title + "]";
+ }
+
+}
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Channel.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java?rev=1309907&view=auto
==============================================================================
--- commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java (added)
+++ commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java Thu Apr 5 15:46:39 2012
@@ -0,0 +1,159 @@
+package org.apache.commons.digester3.annotations.processor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
+import org.apache.commons.digester3.annotations.rules.ObjectCreate;
+
+@ObjectCreate( pattern = "rss/channel/image" )
+public final class Image
+{
+
+ @BeanPropertySetter( pattern = "rss/channel/image/description" )
+ private String description;
+
+ @BeanPropertySetter( pattern = "rss/channel/image/width" )
+ private int width;
+
+ @BeanPropertySetter( pattern = "rss/channel/image/height" )
+ private int height;
+
+ @BeanPropertySetter( pattern = "rss/channel/image/link" )
+ private String link;
+
+ @BeanPropertySetter( pattern = "rss/channel/image/title" )
+ private String title;
+
+ @BeanPropertySetter( pattern = "rss/channel/image/url" )
+ private String url;
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public void setWidth( int width )
+ {
+ this.width = width;
+ }
+
+ public int getHeight()
+ {
+ return height;
+ }
+
+ public void setHeight( int height )
+ {
+ this.height = height;
+ }
+
+ public String getLink()
+ {
+ return link;
+ }
+
+ public void setLink( String link )
+ {
+ this.link = link;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( String title )
+ {
+ this.title = title;
+ }
+
+ public String getUrl()
+ {
+ return url;
+ }
+
+ public void setUrl( String url )
+ {
+ this.url = url;
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ return true;
+ if ( obj == null )
+ return false;
+ if ( getClass() != obj.getClass() )
+ return false;
+ Image other = (Image) obj;
+ if ( description == null )
+ {
+ if ( other.description != null )
+ return false;
+ }
+ else if ( !description.equals( other.description ) )
+ return false;
+ if ( height != other.height )
+ return false;
+ if ( link == null )
+ {
+ if ( other.link != null )
+ return false;
+ }
+ else if ( !link.equals( other.link ) )
+ return false;
+ if ( title == null )
+ {
+ if ( other.title != null )
+ return false;
+ }
+ else if ( !title.equals( other.title ) )
+ return false;
+ if ( url == null )
+ {
+ if ( other.url != null )
+ return false;
+ }
+ else if ( !url.equals( other.url ) )
+ return false;
+ if ( width != other.width )
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Image [description=" + description + ", height=" + height + ", link=" + link + ", title=" + title
+ + ", url=" + url + ", width=" + width + "]";
+ }
+
+}
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Image.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java?rev=1309907&view=auto
==============================================================================
--- commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java (added)
+++ commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java Thu Apr 5 15:46:39 2012
@@ -0,0 +1,108 @@
+package org.apache.commons.digester3.annotations.processor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
+import org.apache.commons.digester3.annotations.rules.ObjectCreate;
+
+@ObjectCreate( pattern = "rss/channel/item" )
+public final class Item
+{
+
+ @BeanPropertySetter( pattern = "rss/channel/item/description" )
+ private String description;
+
+ @BeanPropertySetter( pattern = "rss/channel/item/link" )
+ private String link;
+
+ @BeanPropertySetter( pattern = "rss/channel/item/title" )
+ private String title;
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ public String getLink()
+ {
+ return link;
+ }
+
+ public void setLink( String link )
+ {
+ this.link = link;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( String title )
+ {
+ this.title = title;
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ return true;
+ if ( obj == null )
+ return false;
+ if ( getClass() != obj.getClass() )
+ return false;
+ Item other = (Item) obj;
+ if ( description == null )
+ {
+ if ( other.description != null )
+ return false;
+ }
+ else if ( !description.equals( other.description ) )
+ return false;
+ if ( link == null )
+ {
+ if ( other.link != null )
+ return false;
+ }
+ else if ( !link.equals( other.link ) )
+ return false;
+ if ( title == null )
+ {
+ if ( other.title != null )
+ return false;
+ }
+ else if ( !title.equals( other.title ) )
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Item [description=" + description + ", link=" + link + ", title=" + title + "]";
+ }
+
+}
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/proper/digester/trunk/annotations-processor/src/test/java/org/apache/commons/digester3/annotations/processor/Item.java
------------------------------------------------------------------------------
svn:mime-type = text/plain