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

Method writePOJO

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

Source from the content-addressed store, hash-verified

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