Class Wrapper
java.lang.Object
org.codehaus.groovy.runtime.wrappers.Wrapper
- All Implemented Interfaces:
GroovyObject
- Direct Known Subclasses:
GroovyObjectWrapper,PojoWrapper
Base class for runtime wrappers that expose a value through
GroovyObject while reporting a constrained type.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassThe constrained type the wrapped value should present to the runtime. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract MetaClassReturns the meta class that should handle GroovyObject operations for the wrapped value.Returns theMetaClassused to service GroovyObject operations for the wrapped value.getType()Returns the constrained type associated with this wrapper.protected abstract ObjectReturns the object used as the delegation target for meta-class-based operations.abstract Objectunwrap()Returns the wrapped value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.lang.GroovyObject
getProperty, invokeMethod, setMetaClass, setProperty
-
Field Details
-
constrainedType
The constrained type the wrapped value should present to the runtime.
-
-
Constructor Details
-
Wrapper
Creates a wrapper for values that should appear as the supplied type.- Parameters:
constrainedType- the type the wrapped value should report
-
-
Method Details
-
getMetaClass
Returns theMetaClassused to service GroovyObject operations for the wrapped value.- Specified by:
getMetaClassin interfaceGroovyObject- Returns:
- the delegated meta class
-
getType
Returns the constrained type associated with this wrapper.- Returns:
- the type the wrapped value should be treated as
-
unwrap
Returns the wrapped value.- Returns:
- the underlying value represented by this wrapper
-
getWrapped
Returns the object used as the delegation target for meta-class-based operations.- Returns:
- the underlying wrapped object
-
getDelegatedMetaClass
Returns the meta class that should handle GroovyObject operations for the wrapped value.- Returns:
- the delegated meta class
-