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

Method writePOJO

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

Source from the content-addressed store, hash-verified

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