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

Method registerModelAdaptor

output/java8/1.4.12/STGroup.java:680–685  ·  view source on GitHub ↗

Add an adaptor for a kind of object so ST knows how to pull properties from them. Add adaptors in increasing order of specificity. ST adds Object, Map, ST, and Aggregate model adaptors for you first. Adaptors you add have priority over default adaptors. If an adap

(Class<?> attributeType, ModelAdaptor adaptor)

Source from the content-addressed store, hash-verified

678 */
679
680 public void registerModelAdaptor(Class<?> attributeType, ModelAdaptor adaptor) {
681 if ( attributeType.isPrimitive() ) {
682 throw new IllegalArgumentException("can't register ModelAdaptor for primitive type "+attributeType.getSimpleName());
683 }
684 adaptors.put(attributeType, adaptor);
685 }
686
687 public ModelAdaptor getModelAdaptor(Class<?> attributeType) {
688 return adaptors.get(attributeType);

Callers

nothing calls this directly

Calls 3

putMethod · 0.65
isPrimitiveMethod · 0.45
getSimpleNameMethod · 0.45

Tested by

no test coverage detected