MCPcopy Create free account
hub / github.com/antlr/codebuff / writePOJO

Method writePOJO

output/java/1.4.14/Interpreter.java:764–780  ·  view source on GitHub ↗
(STWriter out, InstanceScope scope, Object o, String[] options)

Source from the content-addressed store, hash-verified

762 }
763
764 protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException {
765 String formatString = null;
766 if ( options !=null ) formatString = options[Option.FORMAT.ordinal()];
767 // ask the native group defining the surrounding template for the renderer
768 AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass());
769 String v;
770 if ( r !=null ) v = r.toString(o, formatString, locale);
771 else v = o.toString();
772 int n;
773 if ( options !=null && options[Option.WRAP.ordinal()]!=null ) {
774 n = out.write(v, options[Option.WRAP.ordinal()]);
775 }
776 else {
777 n = out.write(v);
778 }
779 return n;
780 }
781
782 protected int getExprStartChar(InstanceScope scope) {
783 Interval templateLocation = scope.st.impl.sourceMap[scope.ip];

Callers 1

writeObjectMethod · 0.95

Calls 5

toStringMethod · 0.95
ordinalMethod · 0.65
toStringMethod · 0.65
writeMethod · 0.65
getAttributeRendererMethod · 0.45

Tested by

no test coverage detected