|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.JMAnyElement
An implementation for an abstract element. This is used, for example, to implement the "any" type.
Field Summary | |
protected static org.xml.sax.Attributes |
emptyAttributes
|
protected java.lang.String |
localName
|
protected java.lang.String |
namespaceURI
|
Constructor Summary | |
JMAnyElement()
Creates a new JMAnyElement that needs to be intialized with setNamespaceURI() and setLocalName() . |
|
JMAnyElement(java.lang.String pNamespaceURI,
java.lang.String pLocalName)
Creates a new JMAnyElement with the given namespace URI and local name. |
Method Summary | |
void |
addChild(java.lang.Object pChild)
Adds a single child to the list of childs. |
protected void |
childsToSAX(org.xml.sax.ContentHandler pContentHandler,
NamespaceSupport pNamespaceSupport)
Converts the elements childs into a stream of SAX events. |
protected void |
childToSAX(java.lang.String pNamespaceURI,
java.lang.String pLocalName,
java.lang.String pValue,
org.xml.sax.ContentHandler pContentHandler,
NamespaceSupport pNamespaceSupport)
Converts a single, atomic element into a stream of SAX events. |
java.lang.Object |
clone()
Returns a clone of this JMAnyElement. |
static java.lang.String |
formatDate(java.util.Date pDate)
Deprecated. Will be removed in JaxMe 2. Use a Marshaller and its property jaxme.format.datetime to achieve the same functionality. |
java.lang.String |
getAttribute(java.lang.String pNamespaceURI,
java.lang.String pLocalName)
Deprecated. Use getAttribute(String pNamespaceURI, String pLocalName, MarshallerImpl pMarshaller) |
java.lang.String |
getAttribute(java.lang.String pNamespaceURI,
java.lang.String pLocalName,
MarshallerImpl pMarshaller)
Returns the value of a single attribute. |
org.xml.sax.helpers.AttributesImpl |
getAttributes(org.xml.sax.ContentHandler pContentHandler,
NamespaceSupport pNamespaceSupport)
Returns the elements attribute list suitable for a SAX ContentHandler. |
java.util.List |
getChilds()
Returns the current list of childs. |
protected java.lang.String |
getContext(java.lang.String pContext,
java.lang.String pElem)
|
static java.text.DateFormat |
getDefaultDateFormat()
Deprecated. Will be removed in JaxMe 2. Use a Marshaller and its property jaxme.format.datetime to achieve the same functionality. |
java.lang.Object |
getElement(java.lang.String pNamespaceURI,
java.lang.String pLocalName)
Returns the value of a single Element. |
java.lang.String |
getLocalName()
Returns the elements tag name, without any prefix. |
java.lang.String |
getNamespaceURI()
Returns the elements namespace URI. |
java.lang.String[] |
getPrefixList()
Returns an array of suggested prefix/namespace URI pairs to use for unmarshalling. |
static java.util.Date |
parseDate(java.lang.String pDate)
Deprecated. Will be removed in JaxMe 2. Use an Unmarshaller and its property jaxme.format.datetime to achieve the same functionality. |
void |
removeAttribute(java.lang.String pNamespaceURI,
java.lang.String pLocalName)
Removes a single attribute. by calling setAttribute(pNamespaceURI, pLocalName, null); |
void |
setAttribute(java.lang.String pNamespaceURI,
java.lang.String pLocalName,
java.lang.String pValue)
Deprecated. Use setAttribute(pNamespaceURI, pLocalName, pValue, pUnmarshaller) |
void |
setAttribute(java.lang.String pNamespaceURI,
java.lang.String pLocalName,
java.lang.String pValue,
UnmarshallerImpl pUnmarshaller)
Sets a single attribute. |
static void |
setDefaultDateFormat(java.text.DateFormat pFormat)
Deprecated. Will be removed in JaxMe 2. Use a Marshaller and its property jaxme.format.datetime to achieve the same functionality. |
void |
setLocalName(java.lang.String pLocalName)
Sets the elements tag name, without any prefix. |
void |
setNamespaceURI(java.lang.String pNamespaceURI)
Sets the elements namespace URI. |
void |
toSAX(org.xml.sax.ContentHandler contentHandler)
Converts the element into a stream of SAX events. |
void |
toSAX(org.xml.sax.ContentHandler pContentHandler,
NamespaceSupport pNamespaceSupport)
Converts the element into a stream of SAX events. |
void |
toSAX(org.xml.sax.ContentHandler pContentHandler,
NamespaceSupport pNamespaceSupport,
boolean pNamespaceInitialized)
Converts the element into a stream of SAX events. |
void |
toWriter(java.io.Writer pWriter)
Serializes the element into the given writer. |
void |
toWriter(java.io.Writer pWriter,
NamespaceSupport pNamespaceSupport)
Serializes the element into the given writer. |
java.lang.String |
toXML()
Serializes the element into a String. |
java.lang.String |
toXML(NamespaceSupport pNamespaceSupport)
Serializes the element into the given writer. |
void |
validate(java.lang.String pContext)
Validates this elements contents. |
protected void |
validateMe(java.lang.String pContext,
org.xml.sax.Locator pLocator)
Validates this elements contents. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final org.xml.sax.Attributes emptyAttributes
protected java.lang.String localName
protected java.lang.String namespaceURI
Constructor Detail |
public JMAnyElement(java.lang.String pNamespaceURI, java.lang.String pLocalName)
public JMAnyElement()
setNamespaceURI()
and setLocalName()
.
Method Detail |
public java.lang.String getLocalName()
Returns the elements tag name, without any prefix.
public java.lang.String getNamespaceURI()
Returns the elements namespace URI.
public void setLocalName(java.lang.String pLocalName)
Sets the elements tag name, without any prefix.
public void setNamespaceURI(java.lang.String pNamespaceURI)
Sets the elements namespace URI.
public void setAttribute(java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pValue) throws org.xml.sax.SAXException
Sets a single attribute.
pNamespaceURI
- The attributes namespace URIpLocalName
- The attributes local namepValue
- The attributes value; null removes the attribute
org.xml.sax.SAXException
public void setAttribute(java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pValue, UnmarshallerImpl pUnmarshaller) throws org.xml.sax.SAXException
Sets a single attribute.
pNamespaceURI
- The attributes namespace URIpLocalName
- The attributes local namepValue
- The attributes value; null removes the attributepUnmarshaller
- A helper for the conversion of Strings in the
actual values
org.xml.sax.SAXException
public void removeAttribute(java.lang.String pNamespaceURI, java.lang.String pLocalName) throws org.xml.sax.SAXException
Removes a single attribute. by calling
setAttribute(pNamespaceURI, pLocalName, null);
org.xml.sax.SAXException
public java.lang.String getAttribute(java.lang.String pNamespaceURI, java.lang.String pLocalName)
Returns the value of a single attribute.
public java.lang.String getAttribute(java.lang.String pNamespaceURI, java.lang.String pLocalName, MarshallerImpl pMarshaller)
Returns the value of a single attribute.
public java.lang.Object getElement(java.lang.String pNamespaceURI, java.lang.String pLocalName)
Returns the value of a single Element.
public void addChild(java.lang.Object pChild)
Adds a single child to the list of childs. The child may be either of
getChilds()
method.
public java.util.List getChilds()
Returns the current list of childs. This list is "live": Any modification to the list are modifying the element and vice versa.
addChild()
to
initialize the list.public void toSAX(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
Converts the element into a stream of SAX events. The events are fired into the given ContentHandler. Default prefixes are used to handle the namespace URI's. If you wish to define your own prefixes, use the two arguments form of this method.
org.xml.sax.SAXException
public void toSAX(org.xml.sax.ContentHandler pContentHandler, NamespaceSupport pNamespaceSupport) throws org.xml.sax.SAXException
Converts the element into a stream of SAX events.
The events are fired into the given ContentHandler.
Namespace URI's are resolved by looking into the
given NamespaceSupport element. If the NamespaceSupport's
method getPrefix()
returns null for a given
URL, then a default mapping is established.
toSAX
in interface JMNode
pContentHandler
- The SAX ContentHandler receiving
SAX events.pNamespaceSupport
- A set of preconfigured mappings
for prefixes; may be null, in which case default mappings
are established.
org.xml.sax.SAXException
public void toSAX(org.xml.sax.ContentHandler pContentHandler, NamespaceSupport pNamespaceSupport, boolean pNamespaceInitialized) throws org.xml.sax.SAXException
Converts the element into a stream of SAX events.
The events are fired into the given ContentHandler.
Namespace URI's are resolved by looking into the
given NamespaceSupport element. If the NamespaceSupport's
method getPrefix()
returns null for a given
URL, then a default mapping is established.
pContentHandler
- The SAX ContentHandler receiving
SAX events.pNamespaceSupport
- A set of preconfigured mappings
for prefixes; may be null, in which case default mappings
are established.pNamespaceInitialized
- True, if initNamespaceSupport()
has been called.
org.xml.sax.SAXException
public org.xml.sax.helpers.AttributesImpl getAttributes(org.xml.sax.ContentHandler pContentHandler, NamespaceSupport pNamespaceSupport) throws org.xml.sax.SAXException
Returns the elements attribute list suitable for a SAX ContentHandler.
org.xml.sax.SAXException
protected void childToSAX(java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pValue, org.xml.sax.ContentHandler pContentHandler, NamespaceSupport pNamespaceSupport) throws org.xml.sax.SAXException
Converts a single, atomic element into a stream of SAX events.
org.xml.sax.SAXException
protected void childsToSAX(org.xml.sax.ContentHandler pContentHandler, NamespaceSupport pNamespaceSupport) throws org.xml.sax.SAXException
Converts the elements childs into a stream of SAX events.
The events are fired into the given ContentHandler.
Namespace URI's are resolved by looking into the
given NamespaceSupport element. If the NamespaceSupport's
method getPrefix()
returns null for a given
URL, then a default mapping is established.
org.xml.sax.SAXException
public java.lang.Object clone()
Returns a clone of this JMAnyElement. A clone A of B is defined as follows:
clone
in interface JMNode
public void toWriter(java.io.Writer pWriter) throws org.xml.sax.SAXException, java.io.IOException
Serializes the element into the given writer. Default mappings are established for namespace prefixes, as in
toSAX(org.xml.sax.ContentHandler);If you want to use your own mappings, create a NamespaceSupport and use the two arguments version of this method.
org.xml.sax.SAXException
java.io.IOException
public void toWriter(java.io.Writer pWriter, NamespaceSupport pNamespaceSupport) throws org.xml.sax.SAXException, java.io.IOException
Serializes the element into the given writer. The given NamespaceSupport is used to create prefix mappings.
org.xml.sax.SAXException
java.io.IOException
public java.lang.String toXML()
Serializes the element into a String. Default mappings are established for namespace prefixes, as in
toSAX(org.xml.sax.ContentHandler);If you want to use your own mappings, create a NamespaceSupport and use the version of this method that takes an argument.
public java.lang.String toXML(NamespaceSupport pNamespaceSupport)
Serializes the element into the given writer. The given NamespaceSupport is used to create prefix mappings.
protected void validateMe(java.lang.String pContext, org.xml.sax.Locator pLocator) throws ValidationException
Validates this elements contents. Doesn't work recursively.
pContext
- A possible context to use in error messages or nullpLocator
- A SAX locator to be used in error messages or null
ValidationException
- The element is invalid; details are
specified in the error messagepublic void validate(java.lang.String pContext) throws ValidationException
Validates this elements contents. Works recursively.
pContext
- A possible context to use in error messages
ValidationException
- The element is invalid; details are
specified in the error messageprotected java.lang.String getContext(java.lang.String pContext, java.lang.String pElem)
public static java.util.Date parseDate(java.lang.String pDate)
public static java.lang.String formatDate(java.util.Date pDate)
public static void setDefaultDateFormat(java.text.DateFormat pFormat)
Returns the DateFormat used to convert dateTime instances.
The builtin default is
new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm: ss. SSS z")
.
In multithreaded environments you have to synchronize on the
returned DateFormat before actually using it. (Which is what
formatDate(java.util.Date)
and
parseDate(String)
are doing.
public static java.text.DateFormat getDefaultDateFormat()
Returns the DateFormat used to convert dateTime instances.
The builtin default is
new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm: ss. SSS z")
.
In multithreaded environments you have to synchronize on the
returned DateFormat before actually using it. (Which is what
formatDate(java.util.Date)
and
parseDate(String)
are doing.
public java.lang.String[] getPrefixList()
Returns an array of suggested prefix/namespace URI pairs to use for unmarshalling. Usually these are the same as used in the defining schema.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |