| 1152 | } |
| 1153 | |
| 1154 | protected boolean testAttributeTrue(Object a) { |
| 1155 | if ( a==null ) return false; |
| 1156 | if ( a instanceof Boolean ) return (Boolean)a; |
| 1157 | if ( a instanceof Collection ) return ((Collection<?>)a).size()>0; |
| 1158 | if ( a instanceof Map ) return ((Map<?, ?>)a).size()>0; |
| 1159 | if ( a instanceof Iterable ) { |
| 1160 | return ((Iterable<?>)a).iterator().hasNext(); |
| 1161 | } |
| 1162 | if ( a instanceof Iterator ) return ((Iterator<?>)a).hasNext(); |
| 1163 | return true; // any other non-null object, return true--it's present |
| 1164 | } |
| 1165 | |
| 1166 | protected Object getObjectProperty(STWriter out, InstanceScope scope, Object o, Object property) { |
| 1167 | if ( o==null ) { |