| 1126 | } |
| 1127 | |
| 1128 | protected boolean testAttributeTrue(Object a) { |
| 1129 | if ( a==null ) return false; |
| 1130 | if ( a instanceof Boolean ) return (Boolean)a; |
| 1131 | if ( a instanceof Collection ) return ((Collection<?>)a).size()>0; |
| 1132 | if ( a instanceof Map ) return ((Map<?, ?>)a).size()>0; |
| 1133 | if ( a instanceof Iterable ) { |
| 1134 | return ((Iterable<?>)a).iterator().hasNext(); |
| 1135 | } |
| 1136 | if ( a instanceof Iterator ) return ((Iterator<?>)a).hasNext(); |
| 1137 | return true; // any other non-null object, return true--it's present |
| 1138 | } |
| 1139 | |
| 1140 | protected Object getObjectProperty(STWriter out, InstanceScope scope, Object o, Object property) { |
| 1141 | if ( o==null ) { |