|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JsonSchema
Callback that is used during the conversion from XML to JSON to query information about the structure of the XML document. This information can lead to a simplified JSON representation. Note that these methods will only be called if the XML document itself does not already contain enough information (e.g. via xsi:type attributes).
Nested Class Summary | |
---|---|
static class |
JsonSchema.CARDINALITY
Enumeration to identifiy the cardinality of an element |
static class |
JsonSchema.TYPE
Enumeration that identifies the data type of a member |
Method Summary | |
---|---|
javax.xml.namespace.QName |
getAssociationKey(java.lang.String uri,
java.lang.String localName)
Returns the key for an association if the cardinality is an assication. |
java.lang.String |
getAttributeMemberName(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Returns the name of the JSON member for an XML attribute. |
JsonSchema.TYPE |
getAttributeType(java.lang.String elementUri,
java.lang.String elementLocalName,
java.lang.String attrUri,
java.lang.String attrLocalName)
Returns the type of an element. |
JsonSchema.CARDINALITY |
getCardinality(java.lang.String uri,
java.lang.String localName)
Returns the cardinality of an item. |
java.lang.String |
getElementMemberName(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Returns the name of the JSON member for an XML element. |
JsonSchema.TYPE |
getElementType(java.lang.String uri,
java.lang.String localName)
Returns the type of an element. |
java.lang.String |
getTextMemberName(java.lang.Integer idx)
Returns the name of the JSON member for textual content. |
JsonSchema.TYPE |
getType(java.lang.String uri,
java.lang.String localName)
Returns the type based on a type identifier. |
java.lang.String |
getValue(java.lang.String uri,
java.lang.String localName,
JsonSchema.TYPE type,
org.xml.sax.Attributes attr)
Returns the value of the element for a given type. |
Method Detail |
---|
javax.xml.namespace.QName getAssociationKey(java.lang.String uri, java.lang.String localName)
null
the json mapping assumes that the attribute xml:id
exists and identifies the key.
uri
- URI of the elementlocalName
- local name of the element
null
java.lang.String getAttributeMemberName(java.lang.String uri, java.lang.String localName, java.lang.String qName)
null
the member name will per default be mapped to
the qname prefixed by the '@' character.
uri
- the URIlocalName
- the local nameqName
- the qname
null
JsonSchema.TYPE getAttributeType(java.lang.String elementUri, java.lang.String elementLocalName, java.lang.String attrUri, java.lang.String attrLocalName)
elementUri
- the URI of the elementelementLocalName
- the local name of the elementattrUri
- the URI of the attributeattrLocalName
- the local name of the attribute
null
if not knownJsonSchema.CARDINALITY getCardinality(java.lang.String uri, java.lang.String localName)
null
the json mapping assume a sequence.
uri
- URI of the elementlocalName
- local name of the element
null
java.lang.String getElementMemberName(java.lang.String uri, java.lang.String localName, java.lang.String qName)
null
, the member name will per default be mapped to
the qname
uri
- the URIlocalName
- the local nameqName
- the qname
null
JsonSchema.TYPE getElementType(java.lang.String uri, java.lang.String localName)
uri
- the URI of the elementlocalName
- the local name of the element
null
if not knownjava.lang.String getTextMemberName(java.lang.Integer idx)
null
the name of the first occurrence will be '$t',
of the next '$u' and so on.
idx
- zero based index of the occurrence, not null
null
JsonSchema.TYPE getType(java.lang.String uri, java.lang.String localName)
null
the
json mapping assumes string.
uri
- the URI of the typelocalName
- the local name of the type
null
if not knownjava.lang.String getValue(java.lang.String uri, java.lang.String localName, JsonSchema.TYPE type, org.xml.sax.Attributes attr)
null
the json mapping assumes that the value is stored as
CDATA of the element.
uri
- URI of the elementlocalName
- local name of the elementtype
- type of the element as determined by
#getElementType(String, String, Attributes)
or
getType(String, String)
.attr
- the attributes
null
to fall back to CDATA
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |