Package org.eclipse.jetty.util
Class DecoratedObjectFactory
- java.lang.Object
-
- org.eclipse.jetty.util.DecoratedObjectFactory
-
- All Implemented Interfaces:
java.lang.Iterable<Decorator>
public class DecoratedObjectFactory extends java.lang.Object implements java.lang.Iterable<Decorator>
An ObjectFactory enhanced byDecorator
instances.Consistent single location for all Decorator behavior, with equal behavior in a ServletContext and also for a stand alone client.
Used by ServletContextHandler, WebAppContext, WebSocketServerFactory, and WebSocketClient.
Can be found in the ServletContext Attributes at the
DecoratedObjectFactory.ATTR
key.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR
ServletContext attribute for the active DecoratedObjectFactory
-
Constructor Summary
Constructors Constructor Description DecoratedObjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDecorator(Decorator decorator)
void
clear()
<T> T
createInstance(java.lang.Class<T> clazz)
<T> T
decorate(T obj)
void
destroy(java.lang.Object obj)
java.util.List<Decorator>
getDecorators()
java.util.Iterator<Decorator>
iterator()
boolean
removeDecorator(Decorator decorator)
void
setDecorators(java.util.List<? extends Decorator> decorators)
java.lang.String
toString()
-
-
-
Method Detail
-
addDecorator
public void addDecorator(Decorator decorator)
-
removeDecorator
public boolean removeDecorator(Decorator decorator)
-
clear
public void clear()
-
createInstance
public <T> T createInstance(java.lang.Class<T> clazz) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
- Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
-
decorate
public <T> T decorate(T obj)
-
destroy
public void destroy(java.lang.Object obj)
-
getDecorators
public java.util.List<Decorator> getDecorators()
-
iterator
public java.util.Iterator<Decorator> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<Decorator>
-
setDecorators
public void setDecorators(java.util.List<? extends Decorator> decorators)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-