Module com.semanticcms.core.servlet
Package com.semanticcms.core.servlet
Class Element<E extends Element>
java.lang.Object
com.semanticcms.core.servlet.Element<E>
- All Implemented Interfaces:
ElementWriter
The base for capturing elements.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Element.Body<E extends Element>
static interface
Element.PageContextBody<E extends Element>
static interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected final E
protected final HttpServletRequest
protected final HttpServletResponse
protected final ServletContext
-
Constructor Summary
ModifierConstructorDescriptionprotected
Element
(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, E element) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doBody
(CaptureLevel captureLevel, Element.Body<? super E> body) Only called at capture level of META and higher.void
invoke()
void
invoke
(Element.Body<? super E> body) Adds this element to the current page, if part of a page.void
invoke
(Element.PageContextBody<? super E> body) void
Adds a property to the element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.semanticcms.core.model.ElementWriter
writeTo
-
Field Details
-
servletContext
-
request
-
response
-
element
-
-
Constructor Details
-
Element
protected Element(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, E element)
-
-
Method Details
-
id
-
property
Adds a property to the element.- Throws:
IllegalStateException
- if the property with the given name has already been set
-
invoke
public void invoke(Element.Body<? super E> body) throws ServletException, IOException, SkipPageException Adds this element to the current page, if part of a page. Sets this element as the current element. Then, if not capturing or capturing META or higher, callsdoBody(com.semanticcms.core.servlet.CaptureLevel, com.semanticcms.core.servlet.Element.Body<? super E>)
Also establishes a new
PageContext
.- Throws:
ServletException
IOException
SkipPageException
- See Also:
-
invoke
- Throws:
ServletException
IOException
SkipPageException
- See Also:
-
invoke
public void invoke(Element.PageContextBody<? super E> body) throws ServletException, IOException, SkipPageException - Throws:
ServletException
IOException
SkipPageException
- See Also:
-
invoke
public void invoke(Element.PageContextNoElementBody body) throws ServletException, IOException, SkipPageException - Throws:
ServletException
IOException
SkipPageException
- See Also:
-
doBody
protected void doBody(CaptureLevel captureLevel, Element.Body<? super E> body) throws ServletException, IOException, SkipPageException Only called at capture level of META and higher.
-