|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.portal.streaming.json.xml.helper.DefaultJsonSchema
public class DefaultJsonSchema
Default implementation for JsonSchema
that can be used as a
convenient superclass for custom implementations
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.ibm.portal.streaming.json.xml.JsonSchema |
---|
JsonSchema.CARDINALITY, JsonSchema.TYPE |
Constructor Summary | |
---|---|
DefaultJsonSchema()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultJsonSchema()
Method Detail |
---|
public javax.xml.namespace.QName getAssociationKey(java.lang.String uri, java.lang.String localName)
JsonSchema
null
the json mapping assumes that the attribute xml:id
exists and identifies the key.
getAssociationKey
in interface JsonSchema
uri
- URI of the elementlocalName
- local name of the element
null
public java.lang.String getAttributeMemberName(java.lang.String uri, java.lang.String localName, java.lang.String qName)
JsonSchema
null
the member name will per default be mapped to
the qname prefixed by the '@' character.
getAttributeMemberName
in interface JsonSchema
uri
- the URIlocalName
- the local nameqName
- the qname
null
public JsonSchema.TYPE getAttributeType(java.lang.String elementUri, java.lang.String elementLocalName, java.lang.String attrUri, java.lang.String attrLocalName)
JsonSchema
getAttributeType
in interface JsonSchema
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 knownpublic JsonSchema.CARDINALITY getCardinality(java.lang.String uri, java.lang.String localName)
JsonSchema
null
the json mapping assume a sequence.
getCardinality
in interface JsonSchema
uri
- URI of the elementlocalName
- local name of the element
null
public java.lang.String getElementMemberName(java.lang.String uri, java.lang.String localName, java.lang.String qName)
JsonSchema
null
, the member name will per default be mapped to
the qname
getElementMemberName
in interface JsonSchema
uri
- the URIlocalName
- the local nameqName
- the qname
null
public JsonSchema.TYPE getElementType(java.lang.String uri, java.lang.String localName)
JsonSchema
getElementType
in interface JsonSchema
uri
- the URI of the elementlocalName
- the local name of the element
null
if not knownpublic java.lang.String getTextMemberName(java.lang.Integer idx)
JsonSchema
null
the name of the first occurrence will be '$t',
of the next '$u' and so on.
getTextMemberName
in interface JsonSchema
idx
- zero based index of the occurrence, not null
null
public JsonSchema.TYPE getType(java.lang.String uri, java.lang.String localName)
JsonSchema
null
the
json mapping assumes string.
getType
in interface JsonSchema
uri
- the URI of the typelocalName
- the local name of the type
null
if not knownpublic java.lang.String getValue(java.lang.String uri, java.lang.String localName, JsonSchema.TYPE type, org.xml.sax.Attributes attr)
JsonSchema
null
the json mapping assumes that the value is stored as
CDATA of the element.
getValue
in interface JsonSchema
uri
- URI of the elementlocalName
- local name of the elementtype
- type of the element as determined by
#getElementType(String, String, Attributes)
or
JsonSchema.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 |