Search in sources :

Example 1 with StartTagInfo

use of com.sun.msv.util.StartTagInfo in project OpenAM by OpenRock.

the class MSVValidator method startElement.

public void startElement(String uri, String local) throws SAXException {
    writePendingText();
    context.getNamespaceContext().startElement();
    stack.push(acceptor);
    StartTagInfo sti = new StartTagInfo(uri, local, local, emptyAttributes, this);
    // we pass in an empty attributes, as there is just no way for us to
    // properly re-construct attributes. Fortunately, I know MSV is not using
    // attribute values, so this would work, but nevertheless this code is
    // ugly. This is one of the problems of the "middle" approach.
    Acceptor child = acceptor.createChildAcceptor(sti, null);
    if (child == null) {
        // this element is invalid. probably, so this object is invalid
        // report an error
        StringRef ref = new StringRef();
        child = acceptor.createChildAcceptor(sti, ref);
        context.reportEvent(target, ref.str);
    }
    this.currentElementUri = uri;
    this.currentElementLocalName = local;
    acceptor = child;
}
Also used : Acceptor(com.sun.msv.verifier.Acceptor) StartTagInfo(com.sun.msv.util.StartTagInfo) StringRef(com.sun.msv.util.StringRef)

Example 2 with StartTagInfo

use of com.sun.msv.util.StartTagInfo in project OpenAM by OpenRock.

the class MSVValidator method startElement.

public void startElement(String uri, String local) throws SAXException {
    writePendingText();
    context.getNamespaceContext().startElement();
    stack.push(acceptor);
    StartTagInfo sti = new StartTagInfo(uri, local, local, emptyAttributes, this);
    // we pass in an empty attributes, as there is just no way for us to
    // properly re-construct attributes. Fortunately, I know MSV is not using
    // attribute values, so this would work, but nevertheless this code is
    // ugly. This is one of the problems of the "middle" approach.
    Acceptor child = acceptor.createChildAcceptor(sti, null);
    if (child == null) {
        // this element is invalid. probably, so this object is invalid
        // report an error
        StringRef ref = new StringRef();
        child = acceptor.createChildAcceptor(sti, ref);
        context.reportEvent(target, ref.str);
    }
    this.currentElementUri = uri;
    this.currentElementLocalName = local;
    acceptor = child;
}
Also used : Acceptor(com.sun.msv.verifier.Acceptor) StartTagInfo(com.sun.msv.util.StartTagInfo) StringRef(com.sun.msv.util.StringRef)

Example 3 with StartTagInfo

use of com.sun.msv.util.StartTagInfo in project OpenAM by OpenRock.

the class MSVValidator method startElement.

public void startElement(String uri, String local) throws SAXException {
    writePendingText();
    context.getNamespaceContext().startElement();
    stack.push(acceptor);
    StartTagInfo sti = new StartTagInfo(uri, local, local, emptyAttributes, this);
    // we pass in an empty attributes, as there is just no way for us to
    // properly re-construct attributes. Fortunately, I know MSV is not using
    // attribute values, so this would work, but nevertheless this code is
    // ugly. This is one of the problems of the "middle" approach.
    Acceptor child = acceptor.createChildAcceptor(sti, null);
    if (child == null) {
        // this element is invalid. probably, so this object is invalid
        // report an error
        StringRef ref = new StringRef();
        child = acceptor.createChildAcceptor(sti, ref);
        context.reportEvent(target, ref.str);
    }
    this.currentElementUri = uri;
    this.currentElementLocalName = local;
    acceptor = child;
}
Also used : Acceptor(com.sun.msv.verifier.Acceptor) StartTagInfo(com.sun.msv.util.StartTagInfo) StringRef(com.sun.msv.util.StringRef)

Example 4 with StartTagInfo

use of com.sun.msv.util.StartTagInfo in project OpenAM by OpenRock.

the class MSVValidator method endAttributes.

public void endAttributes() throws SAXException {
    if (!acceptor.onEndAttributes(null, null)) {
        // some required attributes are missing.
        // report a validation error
        // Note that we don't know which property of this object
        // causes this error.
        StringRef ref = new StringRef();
        StartTagInfo sti = new StartTagInfo(currentElementUri, currentElementLocalName, currentElementLocalName, emptyAttributes, this);
        acceptor.onEndAttributes(sti, ref);
        context.reportEvent(target, ref.str);
    }
}
Also used : StartTagInfo(com.sun.msv.util.StartTagInfo) StringRef(com.sun.msv.util.StringRef)

Example 5 with StartTagInfo

use of com.sun.msv.util.StartTagInfo in project OpenAM by OpenRock.

the class MSVValidator method startElement.

public void startElement(String uri, String local) throws SAXException {
    writePendingText();
    context.getNamespaceContext().startElement();
    stack.push(acceptor);
    StartTagInfo sti = new StartTagInfo(uri, local, local, emptyAttributes, this);
    // we pass in an empty attributes, as there is just no way for us to
    // properly re-construct attributes. Fortunately, I know MSV is not using
    // attribute values, so this would work, but nevertheless this code is
    // ugly. This is one of the problems of the "middle" approach.
    Acceptor child = acceptor.createChildAcceptor(sti, null);
    if (child == null) {
        // this element is invalid. probably, so this object is invalid
        // report an error
        StringRef ref = new StringRef();
        child = acceptor.createChildAcceptor(sti, ref);
        context.reportEvent(target, ref.str);
    }
    this.currentElementUri = uri;
    this.currentElementLocalName = local;
    acceptor = child;
}
Also used : Acceptor(com.sun.msv.verifier.Acceptor) StartTagInfo(com.sun.msv.util.StartTagInfo) StringRef(com.sun.msv.util.StringRef)

Aggregations

StartTagInfo (com.sun.msv.util.StartTagInfo)12 StringRef (com.sun.msv.util.StringRef)12 Acceptor (com.sun.msv.verifier.Acceptor)8 JAXBAssertionError (com.sun.xml.bind.JAXBAssertionError)4 RIElement (com.sun.xml.bind.RIElement)4