Java Code Examples for com.sun.org.apache.xerces.internal.xs.StringList

The following examples show how to use com.sun.org.apache.xerces.internal.xs.StringList. These examples are extracted from open source projects. 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
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 Project: jdk8u60   Source File: XMLSchemaValidator.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void setLocationHints(XSDDescription desc, String[] locations, StringList docLocations) {
    int length = locations.length;
    String[] hints = new String[length];
    int counter = 0;

    for (int i=0; i<length; i++) {
        try {
            String id = XMLEntityManager.expandSystemId(locations[i], desc.getBaseSystemId(), false);
            if (!docLocations.contains(id)) {
                hints[counter++] = locations[i];
            }
        }
        catch (MalformedURIException e) {
        }
    }

    if (counter > 0) {
        if (counter == length) {
            fXSDDescription.fLocationHints = hints;
        }
        else {
            fXSDDescription.fLocationHints = new String[counter];
            System.arraycopy(hints, 0, fXSDDescription.fLocationHints, 0, counter);
        }
    }
}
 
Example 3
Source Project: JDKSourceCode1.8   Source File: XMLSchemaValidator.java    License: MIT License 6 votes vote down vote up
private void setLocationHints(XSDDescription desc, String[] locations, StringList docLocations) {
    int length = locations.length;
    String[] hints = new String[length];
    int counter = 0;

    for (int i=0; i<length; i++) {
        try {
            String id = XMLEntityManager.expandSystemId(locations[i], desc.getBaseSystemId(), false);
            if (!docLocations.contains(id)) {
                hints[counter++] = locations[i];
            }
        }
        catch (MalformedURIException e) {
        }
    }

    if (counter > 0) {
        if (counter == length) {
            fXSDDescription.fLocationHints = hints;
        }
        else {
            fXSDDescription.fLocationHints = new String[counter];
            System.arraycopy(hints, 0, fXSDDescription.fLocationHints, 0, counter);
        }
    }
}
 
Example 4
Source Project: hottub   Source File: XMLSchemaValidator.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void setLocationHints(XSDDescription desc, String[] locations, StringList docLocations) {
    int length = locations.length;
    String[] hints = new String[length];
    int counter = 0;

    for (int i=0; i<length; i++) {
        try {
            String id = XMLEntityManager.expandSystemId(locations[i], desc.getBaseSystemId(), false);
            if (!docLocations.contains(id)) {
                hints[counter++] = locations[i];
            }
        }
        catch (MalformedURIException e) {
        }
    }

    if (counter > 0) {
        if (counter == length) {
            fXSDDescription.fLocationHints = hints;
        }
        else {
            fXSDDescription.fLocationHints = new String[counter];
            System.arraycopy(hints, 0, fXSDDescription.fLocationHints, 0, counter);
        }
    }
}
 
Example 5
Source Project: openjdk-8   Source File: XMLSchemaValidator.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void setLocationHints(XSDDescription desc, String[] locations, StringList docLocations) {
    int length = locations.length;
    String[] hints = new String[length];
    int counter = 0;

    for (int i=0; i<length; i++) {
        try {
            String id = XMLEntityManager.expandSystemId(locations[i], desc.getBaseSystemId(), false);
            if (!docLocations.contains(id)) {
                hints[counter++] = locations[i];
            }
        }
        catch (MalformedURIException e) {
        }
    }

    if (counter > 0) {
        if (counter == length) {
            fXSDDescription.fLocationHints = hints;
        }
        else {
            fXSDDescription.fLocationHints = new String[counter];
            System.arraycopy(hints, 0, fXSDDescription.fLocationHints, 0, counter);
        }
    }
}
 
Example 6
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 Project: hottub   Source File: IdentityConstraint.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}
 
Example 8
Source Project: jdk1.8-source-analysis   Source File: XSDHandler.java    License: Apache License 2.0 5 votes vote down vote up
private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final StringList locations = srcGrammar.getDocumentLocations();
    final int locSize = locations.size();
    final StringList locations2 = dstGrammar.getDocumentLocations();

    for (int i=0; i<locSize; i++) {
        String loc = locations.item(i);
        if (!locations2.contains(loc)) {
            dstGrammar.addDocument(null, loc);
        }
    }
}
 
Example 9
Source Project: jdk1.8-source-analysis   Source File: XSLoaderImpl.java    License: 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;
    }
}
 
Example 10
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}
 
Example 11
Source Project: hottub   Source File: XMLSchemaLoader.java    License: 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
/**
 * 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 13
/**
 * A list of error messages generated from the validation attempt or
 * an empty <code>StringList</code> if no errors occurred during the
 * validation attempt. The indices of error messages in this list are
 * aligned with those in the <code>[schema error code]</code> list.
 */
public StringList getErrorMessages() {
    if (fErrors == null || fErrors.length == 0) {
        return StringListImpl.EMPTY_LIST;
    }
    return new PSVIErrorList(fErrors, false);
}
 
Example 14
Source Project: jdk1.8-source-analysis   Source File: IdentityConstraint.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}
 
Example 15
Source Project: Bytecoder   Source File: AttributePSVImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * A list of error messages generated from the validation attempt or
 * an empty <code>StringList</code> if no errors occurred during the
 * validation attempt. The indices of error messages in this list are
 * aligned with those in the <code>[schema error code]</code> list.
 */
public StringList getErrorMessages() {
    if (fErrors == null || fErrors.length == 0) {
        return StringListImpl.EMPTY_LIST;
    }
    return new PSVIErrorList(fErrors, false);
}
 
Example 16
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 Project: TencentKona-8   Source File: XSDHandler.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final StringList locations = srcGrammar.getDocumentLocations();
    final int locSize = locations.size();
    final StringList locations2 = dstGrammar.getDocumentLocations();

    for (int i=0; i<locSize; i++) {
        String loc = locations.item(i);
        if (!locations2.contains(loc)) {
            dstGrammar.addDocument(null, loc);
        }
    }
}
 
Example 18
Source Project: openjdk-jdk9   Source File: XMLSchemaLoader.java    License: 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 19
Source Project: openjdk-jdk9   Source File: XSDHandler.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final StringList locations = srcGrammar.getDocumentLocations();
    final int locSize = locations.size();
    final StringList locations2 = dstGrammar.getDocumentLocations();

    for (int i=0; i<locSize; i++) {
        String loc = locations.item(i);
        if (!locations2.contains(loc)) {
            dstGrammar.addDocument(null, loc);
        }
    }
}
 
Example 20
private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final StringList locations = srcGrammar.getDocumentLocations();
    final int locSize = locations.size();
    final StringList locations2 = dstGrammar.getDocumentLocations();

    for (int i=0; i<locSize; i++) {
        String loc = locations.item(i);
        if (!locations2.contains(loc)) {
            dstGrammar.addDocument(null, loc);
        }
    }
}
 
Example 21
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}
 
Example 22
/**
 * A list of error codes generated from validation attempts.
 * Need to find all the possible subclause reports that need reporting
 *
 * @return list of error codes
 */
public StringList getErrorCodes() {
    if (fErrors == null || fErrors.length == 0) {
        return StringListImpl.EMPTY_LIST;
    }
    return new PSVIErrorList(fErrors, true);
}
 
Example 23
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}
 
Example 24
Source Project: jdk8u60   Source File: XMLSchemaLoader.java    License: 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 25
Source Project: jdk8u60   Source File: XSDHandler.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final StringList locations = srcGrammar.getDocumentLocations();
    final int locSize = locations.size();
    final StringList locations2 = dstGrammar.getDocumentLocations();

    for (int i=0; i<locSize; i++) {
        String loc = locations.item(i);
        if (!locations2.contains(loc)) {
            dstGrammar.addDocument(null, loc);
        }
    }
}
 
Example 26
Source Project: jdk8u60   Source File: XSLoaderImpl.java    License: 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 27
Source Project: Bytecoder   Source File: IdentityConstraint.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}
 
Example 28
Source Project: JDKSourceCode1.8   Source File: XSDHandler.java    License: MIT License 5 votes vote down vote up
private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final StringList locations = srcGrammar.getDocumentLocations();
    final int locSize = locations.size();
    final StringList locations2 = dstGrammar.getDocumentLocations();

    for (int i=0; i<locSize; i++) {
        String loc = locations.item(i);
        if (!locations2.contains(loc)) {
            dstGrammar.addDocument(null, loc);
        }
    }
}
 
Example 29
Source Project: openjdk-jdk9   Source File: ElementPSVImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * A list of error messages generated from the validation attempt or
 * an empty <code>StringList</code> if no errors occurred during the
 * validation attempt. The indices of error messages in this list are
 * aligned with those in the <code>[schema error code]</code> list.
 */
public StringList getErrorMessages() {
    if (fErrors == null || fErrors.length == 0) {
        return StringListImpl.EMPTY_LIST;
    }
    return new PSVIErrorList(fErrors, false);
}
 
Example 30
Source Project: openjdk-8   Source File: IdentityConstraint.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
 */
public StringList getFieldStrs() {
    String[] strs = new String[fFieldCount];
    for (int i = 0; i < fFieldCount; i++)
        strs[i] = fFields[i].toString();
    return new StringListImpl(strs, fFieldCount);
}