equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
165 } |
165 } |
166 |
166 |
167 /** |
167 /** |
168 * Set the attribute value. |
168 * Set the attribute value. |
169 */ |
169 */ |
|
170 @SuppressWarnings("unchecked") // Checked with instanceof |
170 public void set(String name, Object obj) throws IOException { |
171 public void set(String name, Object obj) throws IOException { |
171 if (name.equalsIgnoreCase(DESCRIPTIONS)) { |
172 if (name.equalsIgnoreCase(DESCRIPTIONS)) { |
172 if (!(obj instanceof List)) { |
173 if (!(obj instanceof List)) { |
173 throw new IOException("Attribute value should be of type List."); |
174 throw new IOException("Attribute value should be of type List."); |
174 } |
175 } |
182 } |
183 } |
183 |
184 |
184 /** |
185 /** |
185 * Get the attribute value. |
186 * Get the attribute value. |
186 */ |
187 */ |
187 public Object get(String name) throws IOException { |
188 public List<AccessDescription> get(String name) throws IOException { |
188 if (name.equalsIgnoreCase(DESCRIPTIONS)) { |
189 if (name.equalsIgnoreCase(DESCRIPTIONS)) { |
189 return accessDescriptions; |
190 return accessDescriptions; |
190 } else { |
191 } else { |
191 throw new IOException("Attribute name [" + name + |
192 throw new IOException("Attribute name [" + name + |
192 "] not recognized by " + |
193 "] not recognized by " + |