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

Method registerModelAdaptor

output/java8/1.4.14/STGroup.java:700–705  ·  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

698 */
699
700 public void registerModelAdaptor(Class<?> attributeType, ModelAdaptor adaptor) {
701 if ( attributeType.isPrimitive() ) {
702 throw new IllegalArgumentException("can't register ModelAdaptor for primitive type "+attributeType.getSimpleName());
703 }
704 adaptors.put(attributeType, adaptor);
705 }
706
707 public ModelAdaptor getModelAdaptor(Class<?> attributeType) {
708 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