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

Method registerModelAdaptor

output/java8/1.4.17/STGroup.java:702–707  ·  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

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