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