Author: markt Date: Thu Jul 22 22:35:32 2010 New Revision: 966883 URL: http://svn.apache.org/viewvc?rev=966883&view=rev Log: Tab police: javax.el Thanks to Checkstyle
Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java tomcat/trunk/java/javax/el/ListELResolver.java tomcat/trunk/java/javax/el/MapELResolver.java tomcat/trunk/java/javax/el/PropertyNotFoundException.java tomcat/trunk/java/javax/el/ResourceBundleELResolver.java Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=966883&r1=966882&r2=966883&view=diff ============================================================================== --- tomcat/trunk/java/javax/el/ArrayELResolver.java (original) +++ tomcat/trunk/java/javax/el/ArrayELResolver.java Thu Jul 22 22:35:32 2010 @@ -24,149 +24,149 @@ import java.util.Iterator; public class ArrayELResolver extends ELResolver { - private final boolean readOnly; + private final boolean readOnly; - public ArrayELResolver() { - this.readOnly = false; - } + public ArrayELResolver() { + this.readOnly = false; + } - public ArrayELResolver(boolean readOnly) { - this.readOnly = readOnly; - } + public ArrayELResolver(boolean readOnly) { + this.readOnly = readOnly; + } - @Override + @Override public Object getValue(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base != null && base.getClass().isArray()) { - context.setPropertyResolved(true); - int idx = coerce(property); + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base != null && base.getClass().isArray()) { + context.setPropertyResolved(true); + int idx = coerce(property); if (idx < 0 || idx >= Array.getLength(base)) { return null; } return Array.get(base, idx); } - return null; - } + return null; + } - @Override + @Override public Class<?> getType(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base != null && base.getClass().isArray()) { - context.setPropertyResolved(true); - int idx = coerce(property); - checkBounds(base, idx); - return base.getClass().getComponentType(); - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } - return null; - } + if (base != null && base.getClass().isArray()) { + context.setPropertyResolved(true); + int idx = coerce(property); + checkBounds(base, idx); + return base.getClass().getComponentType(); + } + + return null; + } - @Override + @Override public void setValue(ELContext context, Object base, Object property, - Object value) throws NullPointerException, - PropertyNotFoundException, PropertyNotWritableException, - ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base != null && base.getClass().isArray()) { - context.setPropertyResolved(true); - - if (this.readOnly) { - throw new PropertyNotWritableException(message(context, - "resolverNotWriteable", new Object[] { base.getClass() - .getName() })); - } - - int idx = coerce(property); - checkBounds(base, idx); - if (value != null && - !base.getClass().getComponentType().isAssignableFrom( - value.getClass())) { - throw new ClassCastException(message(context, - "objectNotAssignable", - new Object[] {value.getClass().getName(), - base.getClass().getComponentType().getName()})); - } - Array.set(base, idx, value); - } - } + Object value) throws NullPointerException, + PropertyNotFoundException, PropertyNotWritableException, + ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base != null && base.getClass().isArray()) { + context.setPropertyResolved(true); + + if (this.readOnly) { + throw new PropertyNotWritableException(message(context, + "resolverNotWriteable", new Object[] { base.getClass() + .getName() })); + } + + int idx = coerce(property); + checkBounds(base, idx); + if (value != null && + !base.getClass().getComponentType().isAssignableFrom( + value.getClass())) { + throw new ClassCastException(message(context, + "objectNotAssignable", + new Object[] {value.getClass().getName(), + base.getClass().getComponentType().getName()})); + } + Array.set(base, idx, value); + } + } - @Override + @Override public boolean isReadOnly(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base != null && base.getClass().isArray()) { - context.setPropertyResolved(true); - int idx = coerce(property); - checkBounds(base, idx); - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base != null && base.getClass().isArray()) { + context.setPropertyResolved(true); + int idx = coerce(property); + checkBounds(base, idx); + } - return this.readOnly; - } + return this.readOnly; + } - @Override + @Override public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) { - if (base != null && base.getClass().isArray()) { - FeatureDescriptor[] descs = new FeatureDescriptor[Array.getLength(base)]; - for (int i = 0; i < descs.length; i++) { - descs[i] = new FeatureDescriptor(); - descs[i].setDisplayName("["+i+"]"); - descs[i].setExpert(false); - descs[i].setHidden(false); - descs[i].setName(""+i); - descs[i].setPreferred(true); - descs[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE); - descs[i].setValue(TYPE, Integer.class); - } - return Arrays.asList(descs).iterator(); - } - return null; - } + if (base != null && base.getClass().isArray()) { + FeatureDescriptor[] descs = new FeatureDescriptor[Array.getLength(base)]; + for (int i = 0; i < descs.length; i++) { + descs[i] = new FeatureDescriptor(); + descs[i].setDisplayName("["+i+"]"); + descs[i].setExpert(false); + descs[i].setHidden(false); + descs[i].setName(""+i); + descs[i].setPreferred(true); + descs[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE); + descs[i].setValue(TYPE, Integer.class); + } + return Arrays.asList(descs).iterator(); + } + return null; + } - @Override + @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { - if (base != null && base.getClass().isArray()) { - return Integer.class; - } - return null; - } - - private final static void checkBounds(Object base, int idx) { - if (idx < 0 || idx >= Array.getLength(base)) { - throw new PropertyNotFoundException( - new ArrayIndexOutOfBoundsException(idx).getMessage()); - } - } - - private final static int coerce(Object property) { - if (property instanceof Number) { - return ((Number) property).intValue(); - } - if (property instanceof Character) { - return ((Character) property).charValue(); - } - if (property instanceof Boolean) { - return (((Boolean) property).booleanValue() ? 1 : 0); - } + if (base != null && base.getClass().isArray()) { + return Integer.class; + } + return null; + } + + private final static void checkBounds(Object base, int idx) { + if (idx < 0 || idx >= Array.getLength(base)) { + throw new PropertyNotFoundException( + new ArrayIndexOutOfBoundsException(idx).getMessage()); + } + } + + private final static int coerce(Object property) { + if (property instanceof Number) { + return ((Number) property).intValue(); + } + if (property instanceof Character) { + return ((Character) property).charValue(); + } + if (property instanceof Boolean) { + return (((Boolean) property).booleanValue() ? 1 : 0); + } if (property instanceof String) { return Integer.parseInt((String) property); } - throw new IllegalArgumentException(property != null ? property - .toString() : "null"); - } + throw new IllegalArgumentException(property != null ? + property.toString() : "null"); + } } Modified: tomcat/trunk/java/javax/el/ListELResolver.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ListELResolver.java?rev=966883&r1=966882&r2=966883&view=diff ============================================================================== --- tomcat/trunk/java/javax/el/ListELResolver.java (original) +++ tomcat/trunk/java/javax/el/ListELResolver.java Thu Jul 22 22:35:32 2010 @@ -26,154 +26,154 @@ import java.util.List; public class ListELResolver extends ELResolver { - private final boolean readOnly; + private final boolean readOnly; - private final static Class<?> UNMODIFIABLE = - Collections.unmodifiableList(new ArrayList<Object>()).getClass(); + private final static Class<?> UNMODIFIABLE = + Collections.unmodifiableList(new ArrayList<Object>()).getClass(); - public ListELResolver() { - this.readOnly = false; - } + public ListELResolver() { + this.readOnly = false; + } - public ListELResolver(boolean readOnly) { - this.readOnly = readOnly; - } + public ListELResolver(boolean readOnly) { + this.readOnly = readOnly; + } - @Override + @Override public Object getValue(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof List<?>) { - context.setPropertyResolved(true); - List<?> list = (List<?>) base; - int idx = coerce(property); - if (idx < 0 || idx >= list.size()) { - return null; - } - return list.get(idx); - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof List<?>) { + context.setPropertyResolved(true); + List<?> list = (List<?>) base; + int idx = coerce(property); + if (idx < 0 || idx >= list.size()) { + return null; + } + return list.get(idx); + } - return null; - } + return null; + } - @Override + @Override public Class<?> getType(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof List<?>) { - context.setPropertyResolved(true); - List<?> list = (List<?>) base; - int idx = coerce(property); - if (idx < 0 || idx >= list.size()) { + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof List<?>) { + context.setPropertyResolved(true); + List<?> list = (List<?>) base; + int idx = coerce(property); + if (idx < 0 || idx >= list.size()) { throw new PropertyNotFoundException( new ArrayIndexOutOfBoundsException(idx).getMessage()); - } - Object obj = list.get(idx); - return (obj != null) ? obj.getClass() : null; - } + } + Object obj = list.get(idx); + return (obj != null) ? obj.getClass() : null; + } - return null; - } + return null; + } - @Override + @Override public void setValue(ELContext context, Object base, Object property, - Object value) throws NullPointerException, - PropertyNotFoundException, PropertyNotWritableException, - ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof List<?>) { - context.setPropertyResolved(true); - @SuppressWarnings("unchecked") // Must be OK to cast to Object - List<Object> list = (List<Object>) base; - - if (this.readOnly) { - throw new PropertyNotWritableException(message(context, - "resolverNotWriteable", new Object[] { base.getClass() - .getName() })); - } - - int idx = coerce(property); - try { - list.set(idx, value); - } catch (UnsupportedOperationException e) { - throw new PropertyNotWritableException(e); - } catch (IndexOutOfBoundsException e) { - throw new PropertyNotFoundException(e); - } - } - } + Object value) throws NullPointerException, + PropertyNotFoundException, PropertyNotWritableException, + ELException { + if (context == null) { + throw new NullPointerException(); + } - @Override + if (base instanceof List<?>) { + context.setPropertyResolved(true); + @SuppressWarnings("unchecked") // Must be OK to cast to Object + List<Object> list = (List<Object>) base; + + if (this.readOnly) { + throw new PropertyNotWritableException(message(context, + "resolverNotWriteable", new Object[] { base.getClass() + .getName() })); + } + + int idx = coerce(property); + try { + list.set(idx, value); + } catch (UnsupportedOperationException e) { + throw new PropertyNotWritableException(e); + } catch (IndexOutOfBoundsException e) { + throw new PropertyNotFoundException(e); + } + } + } + + @Override public boolean isReadOnly(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof List<?>) { - context.setPropertyResolved(true); - List<?> list = (List<?>) base; - int idx = coerce(property); - if (idx < 0 || idx >= list.size()) { - throw new PropertyNotFoundException( - new ArrayIndexOutOfBoundsException(idx).getMessage()); - } - return this.readOnly || UNMODIFIABLE.equals(list.getClass()); - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } - return this.readOnly; - } + if (base instanceof List<?>) { + context.setPropertyResolved(true); + List<?> list = (List<?>) base; + int idx = coerce(property); + if (idx < 0 || idx >= list.size()) { + throw new PropertyNotFoundException( + new ArrayIndexOutOfBoundsException(idx).getMessage()); + } + return this.readOnly || UNMODIFIABLE.equals(list.getClass()); + } - @Override + return this.readOnly; + } + + @Override public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) { - if (base instanceof List<?>) { - FeatureDescriptor[] descs = new FeatureDescriptor[((List<?>) base).size()]; - for (int i = 0; i < descs.length; i++) { - descs[i] = new FeatureDescriptor(); - descs[i].setDisplayName("["+i+"]"); - descs[i].setExpert(false); - descs[i].setHidden(false); - descs[i].setName(""+i); - descs[i].setPreferred(true); - descs[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE); - descs[i].setValue(TYPE, Integer.class); - } - return Arrays.asList(descs).iterator(); - } - return null; - } + if (base instanceof List<?>) { + FeatureDescriptor[] descs = new FeatureDescriptor[((List<?>) base).size()]; + for (int i = 0; i < descs.length; i++) { + descs[i] = new FeatureDescriptor(); + descs[i].setDisplayName("["+i+"]"); + descs[i].setExpert(false); + descs[i].setHidden(false); + descs[i].setName(""+i); + descs[i].setPreferred(true); + descs[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE); + descs[i].setValue(TYPE, Integer.class); + } + return Arrays.asList(descs).iterator(); + } + return null; + } - @Override + @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { - if (base instanceof List<?>) { // implies base != null - return Integer.class; - } - return null; - } - - private final static int coerce(Object property) { - if (property instanceof Number) { - return ((Number) property).intValue(); - } - if (property instanceof Character) { - return ((Character) property).charValue(); - } - if (property instanceof Boolean) { - return (((Boolean) property).booleanValue() ? 1 : 0); - } + if (base instanceof List<?>) { // implies base != null + return Integer.class; + } + return null; + } + + private final static int coerce(Object property) { + if (property instanceof Number) { + return ((Number) property).intValue(); + } + if (property instanceof Character) { + return ((Character) property).charValue(); + } + if (property instanceof Boolean) { + return (((Boolean) property).booleanValue() ? 1 : 0); + } if (property instanceof String) { return Integer.parseInt((String) property); } - throw new IllegalArgumentException(property != null ? property - .toString() : "null"); - } + throw new IllegalArgumentException(property != null ? + property.toString() : "null"); + } } Modified: tomcat/trunk/java/javax/el/MapELResolver.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MapELResolver.java?rev=966883&r1=966882&r2=966883&view=diff ============================================================================== --- tomcat/trunk/java/javax/el/MapELResolver.java (original) +++ tomcat/trunk/java/javax/el/MapELResolver.java Thu Jul 22 22:35:32 2010 @@ -27,123 +27,123 @@ import java.util.Map; public class MapELResolver extends ELResolver { - private final static Class<?> UNMODIFIABLE = Collections.unmodifiableMap( - new HashMap<Object, Object>()).getClass(); + private final static Class<?> UNMODIFIABLE = Collections.unmodifiableMap( + new HashMap<Object, Object>()).getClass(); - private final boolean readOnly; + private final boolean readOnly; - public MapELResolver() { - this.readOnly = false; - } + public MapELResolver() { + this.readOnly = false; + } - public MapELResolver(boolean readOnly) { - this.readOnly = readOnly; - } + public MapELResolver(boolean readOnly) { + this.readOnly = readOnly; + } - @Override + @Override public Object getValue(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof Map<?,?>) { - context.setPropertyResolved(true); - return ((Map<?,?>) base).get(property); - } - - return null; - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof Map<?,?>) { + context.setPropertyResolved(true); + return ((Map<?,?>) base).get(property); + } + + return null; + } - @Override + @Override public Class<?> getType(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof Map<?,?>) { - context.setPropertyResolved(true); - Object obj = ((Map<?,?>) base).get(property); - return (obj != null) ? obj.getClass() : null; - } - - return null; - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof Map<?,?>) { + context.setPropertyResolved(true); + Object obj = ((Map<?,?>) base).get(property); + return (obj != null) ? obj.getClass() : null; + } + + return null; + } - @Override + @Override public void setValue(ELContext context, Object base, Object property, - Object value) throws NullPointerException, - PropertyNotFoundException, PropertyNotWritableException, - ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof Map<?, ?>) { - context.setPropertyResolved(true); - - if (this.readOnly) { - throw new PropertyNotWritableException(message(context, - "resolverNotWriteable", new Object[] { base.getClass() - .getName() })); - } - - try { - @SuppressWarnings("unchecked") // Must be OK - Map<Object, Object> map = ((Map<Object, Object>) base); - map.put(property, value); - } catch (UnsupportedOperationException e) { - throw new PropertyNotWritableException(e); - } - } - } + Object value) throws NullPointerException, + PropertyNotFoundException, PropertyNotWritableException, + ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof Map<?, ?>) { + context.setPropertyResolved(true); + + if (this.readOnly) { + throw new PropertyNotWritableException(message(context, + "resolverNotWriteable", new Object[] { base.getClass() + .getName() })); + } + + try { + @SuppressWarnings("unchecked") // Must be OK + Map<Object, Object> map = ((Map<Object, Object>) base); + map.put(property, value); + } catch (UnsupportedOperationException e) { + throw new PropertyNotWritableException(e); + } + } + } - @Override + @Override public boolean isReadOnly(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof Map<?, ?>) { - context.setPropertyResolved(true); - return this.readOnly || UNMODIFIABLE.equals(base.getClass()); - } - - return this.readOnly; - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof Map<?, ?>) { + context.setPropertyResolved(true); + return this.readOnly || UNMODIFIABLE.equals(base.getClass()); + } + + return this.readOnly; + } - @Override + @Override public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) { - if (base instanceof Map<?, ?>) { - Iterator<?> itr = ((Map<?, ?>) base).keySet().iterator(); - List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(); - Object key; - FeatureDescriptor desc; - while (itr.hasNext()) { - key = itr.next(); - desc = new FeatureDescriptor(); - desc.setDisplayName(key.toString()); - desc.setExpert(false); - desc.setHidden(false); - desc.setName(key.toString()); - desc.setPreferred(true); - desc.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE); - desc.setValue(TYPE, key.getClass()); - feats.add(desc); - } - return feats.iterator(); - } - return null; - } + if (base instanceof Map<?, ?>) { + Iterator<?> itr = ((Map<?, ?>) base).keySet().iterator(); + List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(); + Object key; + FeatureDescriptor desc; + while (itr.hasNext()) { + key = itr.next(); + desc = new FeatureDescriptor(); + desc.setDisplayName(key.toString()); + desc.setExpert(false); + desc.setHidden(false); + desc.setName(key.toString()); + desc.setPreferred(true); + desc.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE); + desc.setValue(TYPE, key.getClass()); + feats.add(desc); + } + return feats.iterator(); + } + return null; + } - @Override + @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { - if (base instanceof Map<?, ?>) { - return Object.class; - } - return null; - } + if (base instanceof Map<?, ?>) { + return Object.class; + } + return null; + } } Modified: tomcat/trunk/java/javax/el/PropertyNotFoundException.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/PropertyNotFoundException.java?rev=966883&r1=966882&r2=966883&view=diff ============================================================================== --- tomcat/trunk/java/javax/el/PropertyNotFoundException.java (original) +++ tomcat/trunk/java/javax/el/PropertyNotFoundException.java Thu Jul 22 22:35:32 2010 @@ -21,7 +21,7 @@ package javax.el; * */ public class PropertyNotFoundException extends ELException { - + private static final long serialVersionUID = -3799200961303506745L; /** Modified: tomcat/trunk/java/javax/el/ResourceBundleELResolver.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ResourceBundleELResolver.java?rev=966883&r1=966882&r2=966883&view=diff ============================================================================== --- tomcat/trunk/java/javax/el/ResourceBundleELResolver.java (original) +++ tomcat/trunk/java/javax/el/ResourceBundleELResolver.java Thu Jul 22 22:35:32 2010 @@ -27,110 +27,110 @@ import java.util.ResourceBundle; public class ResourceBundleELResolver extends ELResolver { - public ResourceBundleELResolver() { - super(); - } + public ResourceBundleELResolver() { + super(); + } - @Override + @Override public Object getValue(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof ResourceBundle) { - if (property != null) { - try { - Object result = ((ResourceBundle) base).getObject(property - .toString()); - context.setPropertyResolved(true); - return result; - } catch (MissingResourceException mre) { - return "???" + property.toString() + "???"; - } - } - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof ResourceBundle) { + if (property != null) { + try { + Object result = ((ResourceBundle) base).getObject(property + .toString()); + context.setPropertyResolved(true); + return result; + } catch (MissingResourceException mre) { + return "???" + property.toString() + "???"; + } + } + } - return null; - } + return null; + } - @Override + @Override public Class<?> getType(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof ResourceBundle) { - context.setPropertyResolved(true); - } - - return null; - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof ResourceBundle) { + context.setPropertyResolved(true); + } + + return null; + } - @Override + @Override public void setValue(ELContext context, Object base, Object property, - Object value) throws NullPointerException, - PropertyNotFoundException, PropertyNotWritableException, - ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof ResourceBundle) { - context.setPropertyResolved(true); - throw new PropertyNotWritableException(message(context, - "resolverNotWriteable", new Object[] { base.getClass() - .getName() })); - } - } + Object value) throws NullPointerException, + PropertyNotFoundException, PropertyNotWritableException, + ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof ResourceBundle) { + context.setPropertyResolved(true); + throw new PropertyNotWritableException(message(context, + "resolverNotWriteable", new Object[] { base.getClass() + .getName() })); + } + } - @Override + @Override public boolean isReadOnly(ELContext context, Object base, Object property) - throws NullPointerException, PropertyNotFoundException, ELException { - if (context == null) { - throw new NullPointerException(); - } - - if (base instanceof ResourceBundle) { - context.setPropertyResolved(true); - } - - return true; - } + throws NullPointerException, PropertyNotFoundException, ELException { + if (context == null) { + throw new NullPointerException(); + } + + if (base instanceof ResourceBundle) { + context.setPropertyResolved(true); + } + + return true; + } - @Override + @Override // Can't use Iterator<FeatureDescriptor> because API needs to match specification public @SuppressWarnings("unchecked") Iterator getFeatureDescriptors( ELContext context, Object base) { - if (base instanceof ResourceBundle) { - List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(); - Enumeration<String> e = ((ResourceBundle) base).getKeys(); - FeatureDescriptor feat; - String key; - while (e.hasMoreElements()) { - key = e.nextElement(); - feat = new FeatureDescriptor(); - feat.setDisplayName(key); - feat.setExpert(false); - feat.setHidden(false); - feat.setName(key); - feat.setPreferred(true); - feat.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE); - feat.setValue(TYPE, String.class); - feats.add(feat); - } - return feats.iterator(); - } - return null; - } + if (base instanceof ResourceBundle) { + List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(); + Enumeration<String> e = ((ResourceBundle) base).getKeys(); + FeatureDescriptor feat; + String key; + while (e.hasMoreElements()) { + key = e.nextElement(); + feat = new FeatureDescriptor(); + feat.setDisplayName(key); + feat.setExpert(false); + feat.setHidden(false); + feat.setName(key); + feat.setPreferred(true); + feat.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE); + feat.setValue(TYPE, String.class); + feats.add(feat); + } + return feats.iterator(); + } + return null; + } - @Override + @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { - if (base instanceof ResourceBundle) { - return String.class; - } - return null; - } + if (base instanceof ResourceBundle) { + return String.class; + } + return null; + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org