Java Code Examples for com.sun.org.apache.xerces.internal.xs.StringList#getLength()

The following examples show how to use com.sun.org.apache.xerces.internal.xs.StringList#getLength() . 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: XSImplementationImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public XSLoader createXSLoader(StringList versions) throws XSException {
    XSLoader loader = new XSLoaderImpl();
    if (versions == null){
                    return loader;
    }
    for (int i=0; i<versions.getLength();i++){
            if (!versions.item(i).equals("1.0")){
                            String msg =
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
                                            "FEATURE_NOT_SUPPORTED",
                                            new Object[] { versions.item(i) });
                            throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
            }
    }
    return loader;
}
 
Example 2
Source File: XSImplementationImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public XSLoader createXSLoader(StringList versions) throws XSException {
    XSLoader loader = new XSLoaderImpl();
    if (versions == null){
                    return loader;
    }
    for (int i=0; i<versions.getLength();i++){
            if (!versions.item(i).equals("1.0")){
                            String msg =
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
                                            "FEATURE_NOT_SUPPORTED",
                                            new Object[] { versions.item(i) });
                            throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
            }
    }
    return loader;
}
 
Example 3
Source File: XSImplementationImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public XSLoader createXSLoader(StringList versions) throws XSException {
    XSLoader loader = new XSLoaderImpl();
    if (versions == null){
                    return loader;
    }
    for (int i=0; i<versions.getLength();i++){
            if (!versions.item(i).equals("1.0")){
                            String msg =
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
                                            "FEATURE_NOT_SUPPORTED",
                                            new Object[] { versions.item(i) });
                            throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
            }
    }
    return loader;
}
 
Example 4
Source File: XSImplementationImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public XSLoader createXSLoader(StringList versions) throws XSException {
    XSLoader loader = new XSLoaderImpl();
    if (versions == null){
                    return loader;
    }
    for (int i=0; i<versions.getLength();i++){
            if (!versions.item(i).equals("1.0")){
                            String msg =
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
                                            "FEATURE_NOT_SUPPORTED",
                                            new Object[] { versions.item(i) });
                            throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
            }
    }
    return loader;
}
 
Example 5
Source File: XSImplementationImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public XSLoader createXSLoader(StringList versions) throws XSException {
    XSLoader loader = new XSLoaderImpl();
    if (versions == null){
                    return loader;
    }
    for (int i=0; i<versions.getLength();i++){
            if (!versions.item(i).equals("1.0")){
                            String msg =
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
                                            "FEATURE_NOT_SUPPORTED",
                                            new Object[] { versions.item(i) });
                            throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
            }
    }
    return loader;
}
 
Example 6
Source File: XSImplementationImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public XSLoader createXSLoader(StringList versions) throws XSException {
    XSLoader loader = new XSLoaderImpl();
    if (versions == null){
                    return loader;
    }
    for (int i=0; i<versions.getLength();i++){
            if (!versions.item(i).equals("1.0")){
                            String msg =
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
                                            "FEATURE_NOT_SUPPORTED",
                                            new Object[] { versions.item(i) });
                            throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
            }
    }
    return loader;
}
 
Example 7
Source File: XSLoaderImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Parses the content of XML Schema documents specified as the list of URI
 * references. If the URI contains a fragment identifier, the behavior
 * is not defined by this specification.
 * @param uriList The list of URI locations.
 * @return An XSModel representing the schema documents.
 */
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    try {
        fGrammarPool.clear();
        for (int i = 0; i < length; ++i) {
            fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        }
        return fGrammarPool.toXSModel();
    }
    catch (Exception e) {
        fSchemaLoader.reportDOMFatalError(e);
        return null;
    }
}
 
Example 8
Source File: XMLSchemaLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    SchemaGrammar[] gs = new SchemaGrammar[length];
    for (int i = 0; i < length; i++) {
        try {
            gs[i] =
                (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null, false));
        } catch (Exception e) {
            reportDOMFatalError(e);
            return null;
        }
    }
    return new XSModelImpl(gs);
}
 
Example 9
Source File: XSLoaderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the content of XML Schema documents specified as the list of URI
 * references. If the URI contains a fragment identifier, the behavior
 * is not defined by this specification.
 * @param uriList The list of URI locations.
 * @return An XSModel representing the schema documents.
 */
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    try {
        fGrammarPool.clear();
        for (int i = 0; i < length; ++i) {
            fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        }
        return fGrammarPool.toXSModel();
    }
    catch (Exception e) {
        fSchemaLoader.reportDOMFatalError(e);
        return null;
    }
}
 
Example 10
Source File: AttributePSVImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public AttributePSVImpl(boolean isConstant, AttributePSVI attrPSVI) {
    fDeclaration = attrPSVI.getAttributeDeclaration();
    fTypeDecl = attrPSVI.getTypeDefinition();
    fSpecified = attrPSVI.getIsSchemaSpecified();
    fValue.copyFrom(attrPSVI.getSchemaValue());
    fValidationAttempted = attrPSVI.getValidationAttempted();
    fValidity = attrPSVI.getValidity();
    if (attrPSVI instanceof AttributePSVImpl) {
        final AttributePSVImpl attrPSVIImpl = (AttributePSVImpl) attrPSVI;
        fErrors = (attrPSVIImpl.fErrors != null) ?
                (String[]) attrPSVIImpl.fErrors.clone() : null;
    }
    else {
        final StringList errorCodes = attrPSVI.getErrorCodes();
        final int length = errorCodes.getLength();
        if (length > 0) {
            final StringList errorMessages = attrPSVI.getErrorMessages();
            final String[] errors = new String[length << 1];
            for (int i = 0, j = 0; i < length; ++i) {
                errors[j++] = errorCodes.item(i);
                errors[j++] = errorMessages.item(i);
            }
            fErrors = errors;
        }
    }
    fValidationContext = attrPSVI.getValidationContext();
    fIsConstant = isConstant;
}
 
Example 11
Source File: XMLSchemaLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    SchemaGrammar[] gs = new SchemaGrammar[length];
    for (int i = 0; i < length; i++) {
        try {
            gs[i] =
                (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        } catch (Exception e) {
            reportDOMFatalError(e);
            return null;
        }
    }
    return new XSModelImpl(gs);
}
 
Example 12
Source File: XMLSchemaLoader.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    SchemaGrammar[] gs = new SchemaGrammar[length];
    for (int i = 0; i < length; i++) {
        try {
            gs[i] =
                (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        } catch (Exception e) {
            reportDOMFatalError(e);
            return null;
        }
    }
    return new XSModelImpl(gs);
}
 
Example 13
Source File: ElementPSVImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ElementPSVImpl(boolean isConstant, ElementPSVI elementPSVI) {
    fDeclaration = elementPSVI.getElementDeclaration();
    fTypeDecl = elementPSVI.getTypeDefinition();
    fNil = elementPSVI.getNil();
    fSpecified = elementPSVI.getIsSchemaSpecified();
    fValue.copyFrom(elementPSVI.getSchemaValue());
    fNotation = elementPSVI.getNotation();
    fValidationAttempted = elementPSVI.getValidationAttempted();
    fValidity = elementPSVI.getValidity();
    fValidationContext = elementPSVI.getValidationContext();
    if (elementPSVI instanceof ElementPSVImpl) {
        final ElementPSVImpl elementPSVIImpl = (ElementPSVImpl) elementPSVI;
        fErrors = (elementPSVIImpl.fErrors != null) ?
                (String[]) elementPSVIImpl.fErrors.clone() : null;
        elementPSVIImpl.copySchemaInformationTo(this);
    }
    else {
        final StringList errorCodes = elementPSVI.getErrorCodes();
        final int length = errorCodes.getLength();
        if (length > 0) {
            final StringList errorMessages = elementPSVI.getErrorMessages();
            final String[] errors = new String[length << 1];
            for (int i = 0, j = 0; i < length; ++i) {
                errors[j++] = errorCodes.item(i);
                errors[j++] = errorMessages.item(i);
            }
            fErrors = errors;
        }
        fSchemaInformation = elementPSVI.getSchemaInformation();
    }
    fIsConstant = isConstant;
}
 
Example 14
Source File: ElementPSVImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public ElementPSVImpl(boolean isConstant, ElementPSVI elementPSVI) {
    fDeclaration = elementPSVI.getElementDeclaration();
    fTypeDecl = elementPSVI.getTypeDefinition();
    fNil = elementPSVI.getNil();
    fSpecified = elementPSVI.getIsSchemaSpecified();
    fValue.copyFrom(elementPSVI.getSchemaValue());
    fNotation = elementPSVI.getNotation();
    fValidationAttempted = elementPSVI.getValidationAttempted();
    fValidity = elementPSVI.getValidity();
    fValidationContext = elementPSVI.getValidationContext();
    if (elementPSVI instanceof ElementPSVImpl) {
        final ElementPSVImpl elementPSVIImpl = (ElementPSVImpl) elementPSVI;
        fErrors = (elementPSVIImpl.fErrors != null) ? elementPSVIImpl.fErrors.clone() : null;
        elementPSVIImpl.copySchemaInformationTo(this);
    }
    else {
        final StringList errorCodes = elementPSVI.getErrorCodes();
        final int length = errorCodes.getLength();
        if (length > 0) {
            final StringList errorMessages = elementPSVI.getErrorMessages();
            final String[] errors = new String[length << 1];
            for (int i = 0, j = 0; i < length; ++i) {
                errors[j++] = errorCodes.item(i);
                errors[j++] = errorMessages.item(i);
            }
            fErrors = errors;
        }
        fSchemaInformation = elementPSVI.getSchemaInformation();
    }
    fIsConstant = isConstant;
}
 
Example 15
Source File: XSLoaderImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the content of XML Schema documents specified as the list of URI
 * references. If the URI contains a fragment identifier, the behavior
 * is not defined by this specification.
 * @param uriList The list of URI locations.
 * @return An XSModel representing the schema documents.
 */
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    try {
        fGrammarPool.clear();
        for (int i = 0; i < length; ++i) {
            fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        }
        return fGrammarPool.toXSModel();
    }
    catch (Exception e) {
        fSchemaLoader.reportDOMFatalError(e);
        return null;
    }
}
 
Example 16
Source File: XMLSchemaLoader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    SchemaGrammar[] gs = new SchemaGrammar[length];
    for (int i = 0; i < length; i++) {
        try {
            gs[i] =
                (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        } catch (Exception e) {
            reportDOMFatalError(e);
            return null;
        }
    }
    return new XSModelImpl(gs);
}
 
Example 17
Source File: XSLoaderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Parses the content of XML Schema documents specified as the list of URI
 * references. If the URI contains a fragment identifier, the behavior
 * is not defined by this specification.
 * @param uriList The list of URI locations.
 * @return An XSModel representing the schema documents.
 */
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    try {
        fGrammarPool.clear();
        for (int i = 0; i < length; ++i) {
            fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        }
        return fGrammarPool.toXSModel();
    }
    catch (Exception e) {
        fSchemaLoader.reportDOMFatalError(e);
        return null;
    }
}
 
Example 18
Source File: XMLSchemaLoader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    SchemaGrammar[] gs = new SchemaGrammar[length];
    for (int i = 0; i < length; i++) {
        try {
            gs[i] =
                (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        } catch (Exception e) {
            reportDOMFatalError(e);
            return null;
        }
    }
    return new XSModelImpl(gs);
}
 
Example 19
Source File: XMLSchemaLoader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    SchemaGrammar[] gs = new SchemaGrammar[length];
    for (int i = 0; i < length; i++) {
        try {
            gs[i] =
                (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        } catch (Exception e) {
            reportDOMFatalError(e);
            return null;
        }
    }
    return new XSModelImpl(gs);
}
 
Example 20
Source File: XSLoaderImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Parses the content of XML Schema documents specified as the list of URI
 * references. If the URI contains a fragment identifier, the behavior
 * is not defined by this specification.
 * @param uriList The list of URI locations.
 * @return An XSModel representing the schema documents.
 */
public XSModel loadURIList(StringList uriList) {
    int length = uriList.getLength();
    try {
        fGrammarPool.clear();
        for (int i = 0; i < length; ++i) {
            fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null));
        }
        return fGrammarPool.toXSModel();
    }
    catch (Exception e) {
        fSchemaLoader.reportDOMFatalError(e);
        return null;
    }
}