public class MSVValidator extends Object implements XMLSerializer, com.sun.msv.grammar.IDContextProvider2
Modifier and Type | Field and Description |
---|---|
static String |
DUMMY_ELEMENT_NS
namespace URI of dummy elements.
|
Modifier and Type | Method and Description |
---|---|
void |
childAsAttributes(com.sun.xml.bind.JAXBObject o,
String fieldName)
This method is called when an JAXBObject object is found
while the marshaller is in the "attribute" mode (i.e. marshalling
attributes of an element)
|
void |
childAsBody(com.sun.xml.bind.JAXBObject o,
String fieldName)
This method is called when an JAXBObject object is found
while the marshaller is in the "element" mode (i.e. marshalling
a content model of an element)
|
void |
childAsURIs(com.sun.xml.bind.JAXBObject o,
String fieldName)
This method is called when an JAXBObject object is found
while the marshaller is in the "URI" mode.
|
void |
endAttribute() |
void |
endAttributes()
Switches to the mode to marshal child texts/elements.
|
void |
endElement()
Ends marshalling of an element.
|
void |
endNamespaceDecls()
Switches to the mode to marshal attribute values.
|
String |
getBaseUri() |
NamespaceContext2 |
getNamespaceContext()
Obtains a namespace context object, which is used to
declare/obtain namespace bindings.
|
boolean |
isNotation(String notation) |
boolean |
isUnparsedEntity(String entityName) |
void |
onID(org.relaxng.datatype.Datatype dt,
com.sun.msv.verifier.regexp.StringToken s) |
String |
onID(com.sun.xml.bind.marshaller.IdentifiableObject owner,
String value)
Notifies the serializer that an ID value has just marshalled.
|
String |
onIDREF(com.sun.xml.bind.marshaller.IdentifiableObject value)
Notifies the serializer that an IDREF value has just marshalled.
|
void |
reportError(ValidationEvent e)
Errors detected by the XMLSerializable should be either thrown
as
SAXException or reported through this method. |
void |
reportMissingObjectError(String fieldName) |
String |
resolveNamespacePrefix(String prefix) |
void |
startAttribute(String uri,
String local)
Starts marshalling of an attribute.
|
void |
startElement(String uri,
String local)
Starts marshalling of an element.
|
void |
text(String text,
String fieldName)
Marshalls text.
|
static void |
validate(DefaultJAXBContextImpl jaxbCtx,
com.sun.identity.saml2.jaxb.assertion.impl.runtime.ValidationContext context,
ValidatableObject vo)
Validates the specified object and reports any error to the context.
|
public static final String DUMMY_ELEMENT_NS
public NamespaceContext2 getNamespaceContext()
XMLSerializer
getNamespaceContext
in interface XMLSerializer
public static void validate(DefaultJAXBContextImpl jaxbCtx, com.sun.identity.saml2.jaxb.assertion.impl.runtime.ValidationContext context, ValidatableObject vo) throws SAXException
SAXException
public void endNamespaceDecls() throws SAXException
XMLSerializer
endNamespaceDecls
in interface XMLSerializer
SAXException
public void endAttributes() throws SAXException
XMLSerializer
endAttributes
in interface XMLSerializer
SAXException
public final void text(String text, String fieldName) throws SAXException
XMLSerializer
This method can be called (i) after the startAttribute method and (ii) before the endAttribute method, to marshal attribute values. If the method is called more than once, those texts are considered as separated by whitespaces. For example,
c.startAttribute(); c.text("abc"); c.text("def"); c.endAttribute("","foo");will generate foo="abc def".
Similarly, this method can be called after the endAttributes method to marshal texts inside elements. The same rule about multiple invokations apply to this case, too. For example,
c.startElement("","foo"); c.endNamespaceDecls(); c.endAttributes(); c.text("abc"); c.text("def"); c.startElement("","bar"); c.endAttributes(); c.endElement(); c.text("ghi"); c.endElement();will generate
<foo>abc def<bar/>ghi</foo>
.text
in interface XMLSerializer
SAXException
public void reportMissingObjectError(String fieldName) throws SAXException
SAXException
public void startAttribute(String uri, String local)
XMLSerializer
startAttribute
in interface XMLSerializer
public void endAttribute() throws SAXException
endAttribute
in interface XMLSerializer
SAXException
public void startElement(String uri, String local) throws SAXException
XMLSerializer
startElement
in interface XMLSerializer
SAXException
public void endElement() throws SAXException
XMLSerializer
endElement
in interface XMLSerializer
SAXException
public void childAsAttributes(com.sun.xml.bind.JAXBObject o, String fieldName) throws SAXException
XMLSerializer
childAsAttributes
in interface XMLSerializer
fieldName
- property name of the parent objeect from which 'o' comes.
Used as a part of the error message in case anything goes wrong
with 'o'.SAXException
public void childAsURIs(com.sun.xml.bind.JAXBObject o, String fieldName) throws SAXException
XMLSerializer
childAsURIs
in interface XMLSerializer
fieldName
- property name of the parent objeect from which 'o' comes.
Used as a part of the error message in case anything goes wrong
with 'o'.SAXException
public void childAsBody(com.sun.xml.bind.JAXBObject o, String fieldName) throws SAXException
XMLSerializer
childAsBody
in interface XMLSerializer
fieldName
- property name of the parent objeect from which 'o' comes.
Used as a part of the error message in case anything goes wrong
with 'o'.SAXException
public void reportError(ValidationEvent e) throws com.sun.xml.bind.serializer.AbortSerializationException
XMLSerializer
SAXException
or reported through this method.
The callee should report an error to the client application
andreportError
in interface XMLSerializer
com.sun.xml.bind.serializer.AbortSerializationException
public String onID(com.sun.xml.bind.marshaller.IdentifiableObject owner, String value) throws SAXException
XMLSerializer
onID
in interface XMLSerializer
owner
- JAXB content object that posesses the ID.value
- The value of the ID.SAXException
public String onIDREF(com.sun.xml.bind.marshaller.IdentifiableObject value) throws SAXException
XMLSerializer
onIDREF
in interface XMLSerializer
SAXException
public String getBaseUri()
getBaseUri
in interface org.relaxng.datatype.ValidationContext
public boolean isUnparsedEntity(String entityName)
isUnparsedEntity
in interface org.relaxng.datatype.ValidationContext
public boolean isNotation(String notation)
isNotation
in interface org.relaxng.datatype.ValidationContext
public void onID(org.relaxng.datatype.Datatype dt, com.sun.msv.verifier.regexp.StringToken s)
onID
in interface com.sun.msv.grammar.IDContextProvider2
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.