public class SimpleObjectWrapper extends DefaultObjectWrapper
TemplateModel
sub-interfaces (String
, Map
and such). If it had to wrap other kind of objects,
it will throw exception. It will also block ?api
calls on the values it wraps.BeansWrapper.MethodAppearanceDecision, BeansWrapper.MethodAppearanceDecisionInput
EXPOSE_ALL, EXPOSE_NOTHING, EXPOSE_PROPERTIES_ONLY, EXPOSE_SAFE
CANT_UNWRAP_TO_TARGET_CLASS
BEANS_WRAPPER, DEFAULT_WRAPPER, SIMPLE_WRAPPER
Constructor and Description |
---|
SimpleObjectWrapper()
Deprecated.
Use
SimpleObjectWrapper(Version) instead. |
SimpleObjectWrapper(Version incompatibleImprovements) |
Modifier and Type | Method and Description |
---|---|
protected TemplateModel |
handleUnknownType(java.lang.Object obj)
Called if a type other than the simple ones we know about is passed in.
|
TemplateHashModel |
wrapAsAPI(java.lang.Object obj)
Wraps an object to a
TemplateModel that exposes the object's "native" (usually, Java) API. |
convertArray, getDOMNodeSupport, getForceLegacyNonListCollections, getIterableSupport, getJythonSupport, getUseAdaptersForContainers, normalizeIncompatibleImprovementsVersion, setDOMNodeSupport, setForceLegacyNonListCollections, setIterableSupport, setJythonSupport, setUseAdaptersForContainers, toPropertiesString, wrap, wrapDomNode
checkModifiable, clearClassIntrospecitonCache, clearClassIntrospectionCache, coerceBigDecimal, coerceBigDecimals, coerceBigDecimals, finalizeConstruction, finetuneMethodAppearance, getDefaultDateType, getDefaultInstance, getEnumModels, getExposureLevel, getIncompatibleImprovements, getInstance, getMemberAccessPolicy, getMethodAppearanceFineTuner, getModelFactory, getOuterIdentity, getPreferIndexedReadMethod, getStaticModels, getTreatDefaultMethodsAsBeanMembers, getUseCache, invokeMethod, isClassIntrospectionCacheRestricted, isExposeFields, isSimpleMapWrapper, isStrict, isWriteProtected, newInstance, readField, removeFromClassIntrospectionCache, setDefaultDateType, setExposeFields, setExposureLevel, setMemberAccessPolicy, setMethodAppearanceFineTuner, setMethodsShadowItems, setNullModel, setOuterIdentity, setPreferIndexedReadMethod, setSimpleMapWrapper, setStrict, setTreatDefaultMethodsAsBeanMembers, setUseCache, toString, tryUnwrapTo, unwrap, unwrap, wrap, writeProtect
@Deprecated public SimpleObjectWrapper()
SimpleObjectWrapper(Version)
instead.public SimpleObjectWrapper(Version incompatibleImprovements)
incompatibleImprovements
- see in BeansWrapper.BeansWrapper(Version)
.protected TemplateModel handleUnknownType(java.lang.Object obj) throws TemplateModelException
handleUnknownType
in class DefaultObjectWrapper
TemplateModelException
public TemplateHashModel wrapAsAPI(java.lang.Object obj) throws TemplateModelException
ObjectWrapperWithAPISupport
TemplateModel
that exposes the object's "native" (usually, Java) API.wrapAsAPI
in interface ObjectWrapperWithAPISupport
wrapAsAPI
in class BeansWrapper
obj
- The object for which the API model has to be returned. Shouldn't be null
.TemplateModel
through which the API of the object can be accessed. Can't be null
.TemplateModelException