| 1180 | } |
| 1181 | |
| 1182 | protected boolean testAttributeTrue(Object a) { |
| 1183 | if ( a==null ) return false; |
| 1184 | if ( a instanceof Boolean) return (Boolean)a; |
| 1185 | if ( a instanceof Collection) return ((Collection<?>)a).size()>0; |
| 1186 | if ( a instanceof Map) return ((Map<?, ?>)a).size()>0; |
| 1187 | if ( a instanceof Iterable) { |
| 1188 | return ((Iterable<?>)a).iterator().hasNext(); |
| 1189 | } |
| 1190 | if ( a instanceof Iterator) return ((Iterator<?>)a).hasNext(); |
| 1191 | return true; // any other non-null object, return true--it's present |
| 1192 | } |
| 1193 | |
| 1194 | protected Object getObjectProperty(STWriter out, InstanceScope scope, Object o, Object property) { |
| 1195 | if ( o==null ) { |