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

The following examples show how to use com.sun.org.apache.xerces.internal.xs.StringList. 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-jdk8u 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-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 #3
Source File: XMLSchemaValidator.java    From jdk8u60 with 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 #4
Source File: XMLSchemaValidator.java    From JDKSourceCode1.8 with 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 #5
Source File: XMLSchemaValidator.java    From hottub with 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
Source File: XMLSchemaValidator.java    From openjdk-8 with 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 #7
Source File: IdentityConstraint.java    From openjdk-jdk9 with 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 File: AttributePSVImpl.java    From openjdk-jdk9 with 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 #9
Source File: XMLSchemaLoader.java    From hottub 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 #10
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 #11
Source File: XSDHandler.java    From jdk1.8-source-analysis with 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 #12
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;
    }
}
 
Example #13
Source File: IdentityConstraint.java    From openjdk-jdk8u with 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 #14
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 #15
Source File: IdentityConstraint.java    From hottub with 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 #16
Source File: XSDHandler.java    From openjdk-jdk9 with 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 #17
Source File: XSDHandler.java    From openjdk-jdk8u-backup with 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 File: IdentityConstraint.java    From TencentKona-8 with 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 #19
Source File: AttributePSVImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 #20
Source File: IdentityConstraint.java    From openjdk-8-source with 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 #21
Source File: XMLSchemaLoader.java    From jdk8u60 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 #22
Source File: XSDHandler.java    From jdk8u60 with 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 #23
Source File: XSLoaderImpl.java    From jdk8u60 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 #24
Source File: IdentityConstraint.java    From Bytecoder with 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 #25
Source File: XSDHandler.java    From JDKSourceCode1.8 with 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 #26
Source File: ElementPSVImpl.java    From openjdk-jdk9 with 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 #27
Source File: IdentityConstraint.java    From openjdk-8 with 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 #28
Source File: AttributePSVImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * 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 #29
Source File: XSLoaderImpl.java    From openjdk-jdk9 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, false));
        }
        return fGrammarPool.toXSModel();
    }
    catch (Exception e) {
        fSchemaLoader.reportDOMFatalError(e);
        return null;
    }
}
 
Example #30
Source File: IdentityConstraint.java    From openjdk-jdk8u-backup with 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);
}