public String toString(Object object, String formatString, Locale locale) { if (!(object instanceof String)) { throw new RuntimeException("Only works on Strings"); } try { Integer integer = Integer.valueOf((String) object); return this.numberRenderer.toString(integer, formatString, locale); } catch (NumberFormatException ignored) { return this.stringRenderer.toString(object, formatString, locale); } } }
@Override public String toString(Object object, String formatString, Locale locale) { if (!(object instanceof String)) { throw new RuntimeException("Only works on Strings"); } try { Integer integer = Integer.valueOf((String) object); return this.numberRenderer.toString(integer, formatString, locale); } catch (NumberFormatException ignored) { return this.stringRenderer.toString(object, formatString, locale); } } }
@Override public String toString(Object o, String formatString, Locale locale) { return renderer.toString(o, formatString, locale); }
protected int writePOJO(STWriter out, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; AttributeRenderer r = group.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; // ask the native group defining the surrounding template for the renderer AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }