View Javadoc

1   /*
2    * Copyright (c) 2007, James Leigh All rights reserved.
3    * 
4    * Redistribution and use in source and binary forms, with or without
5    * modification, are permitted provided that the following conditions are met:
6    * 
7    * - Redistributions of source code must retain the above copyright notice, this
8    *   list of conditions and the following disclaimer.
9    * - Redistributions in binary form must reproduce the above copyright notice,
10   *   this list of conditions and the following disclaimer in the documentation
11   *   and/or other materials provided with the distribution. 
12   * - Neither the name of the openrdf.org nor the names of its contributors may
13   *   be used to endorse or promote products derived from this software without
14   *   specific prior written permission.
15   * 
16   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26   * POSSIBILITY OF SUCH DAMAGE.
27   * 
28   */
29  package org.openrdf.elmo.sesame.behaviours;
30  
31  import java.util.Collection;
32  import java.util.Iterator;
33  import java.util.List;
34  import java.util.ListIterator;
35  
36  import org.openrdf.elmo.Entity;
37  import org.openrdf.elmo.annotations.rdf;
38  
39  /**
40   * This class exists to disable SesameContainer behaviour when creating an
41   * rdf:List.  It does this by overriding all of its methods.
42   * 
43   * @author James Leigh
44   * 
45   */
46  @rdf("http://www.w3.org/1999/02/22-rdf-syntax-ns#List")
47  public class SesameContainerDisabler extends SesameContainer {
48  
49  	public SesameContainerDisabler(Entity bean) {
50  		super(bean);
51  	}
52  
53  	@Override
54  	public boolean equals(Object o) {
55  		return false;
56  	}
57  
58  	@Override
59  	public int hashCode() {
60  		return 0;
61  	}
62  
63  	@Override
64  	public String toString() {
65  		return null;
66  	}
67  
68  	@Override
69  	public void add(int index, Object obj) {
70  	}
71  
72  	@Override
73  	public boolean add(Object o) {
74  		return false;
75  	}
76  
77  	@Override
78  	public boolean addAll(Collection<? extends Object> c) {
79  		return false;
80  	}
81  
82  	@Override
83  	public boolean addAll(int index, Collection<? extends Object> c) {
84  		return false;
85  	}
86  
87  	@Override
88  	public void clear() {
89  	}
90  
91  	@Override
92  	public boolean contains(Object o) {
93  		return false;
94  	}
95  
96  	@Override
97  	public boolean containsAll(Collection<?> c) {
98  		return false;
99  	}
100 
101 	@Override
102 	public Object get(int index) {
103 		return null;
104 	}
105 
106 	@Override
107 	public int indexOf(Object o) {
108 		return 0;
109 	}
110 
111 	@Override
112 	public boolean isEmpty() {
113 		return false;
114 	}
115 
116 	@Override
117 	public Iterator<Object> iterator() {
118 		return null;
119 	}
120 
121 	@Override
122 	public int lastIndexOf(Object o) {
123 		return 0;
124 	}
125 
126 	@Override
127 	public ListIterator<Object> listIterator() {
128 		return null;
129 	}
130 
131 	@Override
132 	public ListIterator<Object> listIterator(int index) {
133 		return null;
134 	}
135 
136 	@Override
137 	public void merge(Object source) {
138 	}
139 
140 	@Override
141 	public void refresh() {
142 	}
143 
144 	@Override
145 	public Object remove(int index) {
146 		return null;
147 	}
148 
149 	@Override
150 	public boolean remove(Object o) {
151 		return false;
152 	}
153 
154 	@Override
155 	public boolean removeAll(Collection<?> c) {
156 		return false;
157 	}
158 
159 	@Override
160 	public boolean retainAll(Collection<?> c) {
161 		return false;
162 	}
163 
164 	@Override
165 	public Object set(int index, Object obj) {
166 		return null;
167 	}
168 
169 	@Override
170 	public int size() {
171 		return 0;
172 	}
173 
174 	@Override
175 	public List<Object> subList(int fromIndex, int toIndex) {
176 		return null;
177 	}
178 
179 	@Override
180 	public Object[] toArray() {
181 		return null;
182 	}
183 
184 	@Override
185 	public <T> T[] toArray(T[] a) {
186 		return null;
187 	}
188 
189 	@Override
190 	protected void removeRange(int fromIndex, int toIndex) {
191 	}
192 
193 }