| 1165 | } |
| 1166 | |
| 1167 | protected boolean testAttributeTrue(Object a) { |
| 1168 | if ( a==null ) return false; |
| 1169 | if ( a instanceof Boolean) return (Boolean)a; |
| 1170 | if ( a instanceof Collection) return ((Collection<?>)a).size()>0; |
| 1171 | if ( a instanceof Map) return ((Map<?, ?>)a).size()>0; |
| 1172 | if ( a instanceof Iterable) { |
| 1173 | return ((Iterable<?>)a).iterator().hasNext(); |
| 1174 | } |
| 1175 | if ( a instanceof Iterator) return ((Iterator<?>)a).hasNext(); |
| 1176 | return true; // any other non-null object, return true--it's present |
| 1177 | } |
| 1178 | |
| 1179 | protected Object getObjectProperty(STWriter out, InstanceScope scope, Object o, Object property) { |
| 1180 | if ( o==null ) { |