FlyweightEntity is a Flyweight pattern implementation of a
singly linked, read-only XML entity.
This node could be shared across documents and elements though it does not support the parent relationship.
Often this node needs to be created and then the text content added later
(for example in SAX) so this implementation allows a call to setText
providing the entity has no text already.
| Modifier and Type | Field and Description |
|---|---|
| protected String | name
The name of the |
| protected String | text
The text of the |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| public | FlyweightEntity(String
is the name of the entity name, String is the text of the entity text)Creates the |
| Modifier and Type | Method and Description |
|---|---|
| protected Node | |
| public String | Returns: the name of the entityOverrides org. Implements org. |
| public String | Returns: the text of the entityOverrides org. Implements org. |
| public void | setText(String
DOCUMENT ME! text)Overrides org. Implements org. UnsupportedOperationException is thrown as this class is
read only.
|
| name | back to summary |
|---|---|
| protected String name The name of the | |
| text | back to summary |
|---|---|
| protected String text The text of the | |
| FlyweightEntity | back to summary |
|---|---|
| protected FlyweightEntity() A default constructor for implementors to use. | |
| FlyweightEntity | back to summary |
|---|---|
| public FlyweightEntity(String name) Creates the
| |
| FlyweightEntity | back to summary |
|---|---|
| public FlyweightEntity(String name, String text) Creates the | |
| createXPathResult | back to summary |
|---|---|
| protected Node createXPathResult(Element parent) | |
| getName | back to summary |
|---|---|
| public String getName() Overrides org. Implements org. DOCUMENT ME!
| |
| getText | back to summary |
|---|---|
| public String getText() Overrides org. Implements org. DOCUMENT ME!
| |
| setText | back to summary |
|---|---|
| public void setText(String text) Overrides org. Implements org. sets the value of the entity if it is not defined yet otherwise an
| |