org.apache.xmlbeans.XmlValidationError Java Examples

The following examples show how to use org.apache.xmlbeans.XmlValidationError. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public boolean shouldPass(final XmlValidationError xve) {
    return checkQNameIsExpected(xve.getFieldQName(), SwesConstants.QN_OFFERING)
            && checkExpectedQNamesContainsQNames(xve.getExpectedQNames(),
                    Lists.newArrayList(SwesConstants.QN_ABSTRACT_OFFERING))
            && checkMessageOrOffendingQName(xve, Sos2Constants.QN_OBSERVATION_OFFERING);
}
 
Example #2
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public boolean shouldPass(final XmlValidationError xve) {
    return checkQNameIsExpected(xve.getFieldQName(), SwesConstants.QN_METADATA)
            && checkExpectedQNamesContainsQNames(xve.getExpectedQNames(),
                    Lists.newArrayList(SwesConstants.QN_INSERTION_METADATA))
            && checkMessageOrOffendingQName(xve, Sos2Constants.QN_SOS_INSERTION_METADATA);
}
 
Example #3
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
@Override
public boolean shouldPass(final XmlValidationError xve) {
    if (xve.getObjectLocation() != null && xve.getObjectLocation().getDomNode() != null
            && xve.getObjectLocation().getDomNode().getFirstChild() != null) {
        String nodeName = xve.getObjectLocation().getDomNode().getFirstChild().getNodeName();
        return !Strings.isNullOrEmpty(nodeName) && nodeName.contains(GET_DATA_AVAILABILITY);
    }
    return false;
}
 
Example #4
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public boolean shouldPass(final XmlValidationError xve) {
    return checkExpectedQNamesContainsQNames(xve.getExpectedQNames(),
            Lists.newArrayList(GmlConstants.QN_ABSTRACT_TIME_32));
}
 
Example #5
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 4 votes vote down vote up
@Override
public boolean shouldPass(final XmlValidationError xve) {
    return checkQNameIsExpected(xve.getOffendingQName(), SwesConstants.QN_INSERTION_METADATA)
            && xve.getCursorLocation().getAttributeText(W3CConstants.QN_XSI_TYPE)
                    .contains(SOS_INSERTION_METADATA_TYPE);
}
 
Example #6
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 2 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public boolean shouldPass(final XmlValidationError xve) {
    return checkExpectedQNamesContainsQNames(xve.getExpectedQNames(), Lists
            .newArrayList(GmlConstants.QN_ABSTRACT_FEATURE_GML, GmlConstants.QN_ABSTRACT_FEATURE_GML_32));
}
 
Example #7
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 2 votes vote down vote up
/**
 * Check if message contains defined pattern or offending QName equals
 * expected
 *
 * @param xve
 *            Xml validation error
 * @param expectedOffendingQname
 *            Expected offending QName
 * @return <code>true</code>, if message contains defined pattern or
 *         offending QName equals expected
 */
private static boolean checkMessageOrOffendingQName(XmlValidationError xve, QName expectedOffendingQname) {
    return xve.getMessage().contains(BEFORE_END_CONTENT_ELEMENT)
            || checkQNameIsExpected(xve.getOffendingQName(), expectedOffendingQname);
}
 
Example #8
Source File: XmlHelper.java    From arctic-sea with Apache License 2.0 votes vote down vote up
public abstract boolean shouldPass(XmlValidationError xve);