Implementation Guide for Oracle Billing Insight > Customizing the Payment Consolidator Integration Module > Creating Customized Payment Consolidation Templates >

Accessing an Object's Public Fields and Methods


You can access an object's public fields and methods. The valid reference is:

%name.field%, %name.method(param1, param2, ...)%

Each parameter of the method can be one of the following:

name, name.field, or name.method(param1, param2, ,,,)

The number of parameters is unlimited and an arbitrary level of method nesting is allowed. Nesting means that a method's return value is used as a parameter when calling another method. For example, if there are two objects in contexts, buf (a StringBuffer), and str (a String), then the following references are valid:

%buf%, %buf.append(str)%, %buf.append(str.toString())%.

You can access a static field or method directly without instantiating an object, for example:

%java.lang.Integer.MIN_VALUE%

Or

%java.lang.Integer.parseInt("12.34")%

You must preset all variables by calling putToContext on the template class. The Payment Consolidator Integration module also provides some preconfigured variables that you can use directly. For a list, see Template Variables.

In addition to preconfigured variables, you can put the Java object into context by writing:

%template.putToContext(String, Object)%,

For example:

%template.putToContext("buf", new java.lang.StringBuffer())%

This puts a new StringBuffer object called buf into the template context. You can then refer to this object by its name: %buf.append("abc").

Implementation Guide for Oracle Billing Insight Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.