|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.app.xmlui.wing.element.AbstractWingElement
public abstract class AbstractWingElement
This class represents a generic element inside the Wing framework. The primary purpose of this abstract class is to create a generic datatype for storage of any WingElement. Second, this class also provides a set of utilities for easy maintenance of each wing element. There are a set of methods for sending SAX events that handle namespaces and attributes so that each individual wing element does not. There are also a set of utility methods for checking method parameters.
| Field Summary | |
|---|---|
protected WingContext |
context
The current context this element is operating under. |
| Constructor Summary | |
|---|---|
protected |
AbstractWingElement()
Construct a new WingElement without access to the current wing Context. |
protected |
AbstractWingElement(WingContext context)
Construct a new WingElement. |
| Method Summary | |
|---|---|
void |
dispose()
Dispose |
protected void |
endElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
Namespace namespace,
String name)
Send the SAX events to end this element. |
protected void |
endElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
String name)
Send the SAX events to end this element. |
protected WingContext |
getWingContext()
Return the currently registered wing context. |
protected void |
greater(int parameter,
int greater,
String message)
Check to make sure that the parameter is GREATER THAN (note: not equal to) the given greater variable. |
protected void |
lesser(int parameter,
int lesser,
String message)
Check to make sure that the parameter is LESS THAN (note: not equal to) the given lesser variable. |
protected void |
require(Message parameter,
String message)
Check to make sure the parameter is not null or an empty string. |
protected void |
require(String parameter,
String message)
Check to make sure the parameter is not null or an empty string. |
protected void |
requireFalse(boolean test,
String message)
Check to make sure that the boolean test value is false. |
protected void |
requireTrue(boolean test,
String message)
Check to make sure that the boolean test value is true. |
protected void |
restrict(String parameter,
String[] options,
String message)
Check to make sure that the parameter is a member of one of the options. |
protected void |
sendCharacters(ContentHandler contentHandler,
String characters)
Send the SAX event for these plain characters, not wrapped in any elements. |
protected void |
setWingContext(WingContext context)
Set the WingContext, note there are potential side effects of changing the WingContext once it has been used. |
protected void |
startElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
Namespace namespace,
String name,
AttributeMap attributes)
Send the SAX events to start this element. |
protected void |
startElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
String name,
AttributeMap attributes)
Send the SAX event to start this element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.dspace.app.xmlui.wing.element.WingElement |
|---|
toSAX |
| Field Detail |
|---|
protected WingContext context
| Constructor Detail |
|---|
protected AbstractWingElement(WingContext context)
context - (Required) The context this element is contained in.protected AbstractWingElement()
| Method Detail |
|---|
protected WingContext getWingContext()
protected void setWingContext(WingContext context)
context - The new WingContext.
protected void require(String parameter,
String message)
throws WingInvalidArgument
parameter - A non null and none empty stringmessage - The exception message thrown if parameter is invalid.
WingInvalidArgument
protected void require(Message parameter,
String message)
throws WingInvalidArgument
parameter - A non null and none empty stringmessage - The exception message thrown if parameter is invalid.
WingInvalidArgument
protected void restrict(String parameter,
String[] options,
String message)
throws WingInvalidArgument
parameter - A null string, or a member of the options array.options - A list of possible values for the parameter.message - The exception message thrown if the parameter is invalid.
WingInvalidArgument
protected void greater(int parameter,
int greater,
String message)
throws WingInvalidArgument
parameter - An int who's value is greater than greater.greater - An int who's value is lesser that greater.message - The exception message thrown if the parameter is invalid.
WingInvalidArgument
protected void lesser(int parameter,
int lesser,
String message)
throws WingInvalidArgument
parameter - An int who's value is less than lesser.lesser - An int who's value is greater that lesser.message - The exception message thrown if the parameter is invalid.
WingInvalidArgument
protected void requireFalse(boolean test,
String message)
throws WingInvalidArgument
test - A false value.message - The exception message thrown if "test" is invalid.
WingInvalidArgument
protected void requireTrue(boolean test,
String message)
throws WingInvalidArgument
test - A true value.message - The exception message thrown if "test" is invalid.
WingInvalidArgument
protected void startElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
String name,
AttributeMap attributes)
throws SAXException
contentHandler - (Required) The registered contentHandler where SAX events
should be routed too.namespaces - (Required) SAX Helper class to keep track of namespaces able
to determine the correct prefix for a given namespace URI.name - (Required) The element's localNameattributes - (May be null) Attributes for this element.
SAXException
protected void startElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
Namespace namespace,
String name,
AttributeMap attributes)
throws SAXException
contentHandler - (Required) The registered contentHandler where SAX events
should be routed too.namespaces - (Required) SAX Helper class to keep track of namespaces able
to determine the correct prefix for a given namespace URI.namespace - (Required) The namespace of this element.name - (Required) The local name of this element.attributes - (May be null) Attributes for this element
SAXException
protected void sendCharacters(ContentHandler contentHandler,
String characters)
throws SAXException
contentHandler - (Required) The registered contentHandler where SAX events
should be routed too.characters - (May be null) Characters to send.
SAXException
protected void endElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
String name)
throws SAXException
contentHandler - (Required) The registered contentHandler where SAX events
should be routed too.namespaces - (Required) SAX Helper class to keep track of namespaces able
to determine the correct prefix for a given namespace URI.name - (Required) The localName of this element.
SAXException
protected void endElement(ContentHandler contentHandler,
NamespaceSupport namespaces,
Namespace namespace,
String name)
throws SAXException
contentHandler - (Required) The registered contentHandler where SAX events
should be routed too.namespaces - (Required) SAX Helper class to keep track of namespaces able
to determine the correct prefix for a given namespace URI.namespace - (Required) The namespace of this element.name - (Required) The local name of this element.
SAXExceptionpublic void dispose()
dispose in interface WingElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||