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

Method writePOJO

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

Source from the content-addressed store, hash-verified

770 }
771
772 protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException {
773 String formatString = null;
774 if ( options !=null ) formatString = options[Option.FORMAT.ordinal()];
775 // ask the native group defining the surrounding template for the renderer
776 AttributeRenderer r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass());
777 String v;
778 if ( r !=null ) v = r.toString(o, formatString, locale);
779 else v = o.toString();
780 int n;
781 if ( options !=null && options[Option.WRAP.ordinal()]!=null ) {
782 n = out.write(v, options[Option.WRAP.ordinal()]);
783 }
784 else {
785 n = out.write(v);
786 }
787 return n;
788 }
789
790 protected int getExprStartChar(InstanceScope scope) {
791 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