com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint. 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: XMLSchemaValidator.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** endElement():  merges contents of fGlobalIDConstraintMap with the
 * top of fGlobalMapStack into fGlobalIDConstraintMap.
 */
public void endElement() {
    if (fGlobalMapStack.isEmpty()) {
        return; // must be an invalid doc!
    }
    Map<IdentityConstraint, ValueStoreBase> oldMap = fGlobalMapStack.pop();
    // return if there is no element
    if (oldMap == null) {
        return;
    }

    for (Map.Entry<IdentityConstraint, ValueStoreBase> entry : oldMap.entrySet()) {
        IdentityConstraint id = entry.getKey();
        ValueStoreBase oldVal = entry.getValue();
        if (oldVal != null) {
            ValueStoreBase currVal = fGlobalIDConstraintMap.get(id);
            if (currVal == null) {
                fGlobalIDConstraintMap.put(id, oldVal);
            }
            else if (currVal != oldVal) {
                currVal.append(oldVal);
            }
        }
    }
}
 
Example #2
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
void addIDConstraintDecl(IdentityConstraint decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getIdentityConstraintName() : namespace + "," + decl.getIdentityConstraintName();

    if (fGlobalIDConstraintDecls.get(declKey) == null) {
        fGlobalIDConstraintDecls.put(declKey, decl);
    }
}
 
Example #3
Source File: XMLSchemaValidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void activateSelectorFor(IdentityConstraint ic) {
    Selector selector = ic.getSelector();
    FieldActivator activator = this;
    if (selector == null)
        return;
    XPathMatcher matcher = selector.createMatcher(activator, fElementDepth);
    fMatcherStack.addMatcher(matcher);
    matcher.startDocumentFragment();
}
 
Example #4
Source File: XMLSchemaValidator.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Start the value scope for the specified identity constraint. This
 * method is called when the selector matches in order to initialize
 * the value store.
 *
 * @param identityConstraint The identity constraint.
 */
public void startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.startValueScope();

}
 
Example #5
Source File: XMLSchemaValidator.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void transplant(IdentityConstraint id, int initialDepth) {
    fLocalId.fDepth = initialDepth;
    fLocalId.fId = id;
    ValueStoreBase newVals = fIdentityConstraint2ValueStoreMap.get(fLocalId);
    if (id.getCategory() == IdentityConstraint.IC_KEYREF)
        return;
    ValueStoreBase currVals = fGlobalIDConstraintMap.get(id);
    if (currVals != null) {
        currVals.append(newVals);
        fGlobalIDConstraintMap.put(id, currVals);
    } else
        fGlobalIDConstraintMap.put(id, newVals);

}
 
Example #6
Source File: XSElementDecl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public IdentityConstraint[] getIDConstraints() {
    if (fIDCPos == 0) {
        return null;
    }
    if (fIDCPos < fIDConstraints.length) {
        fIDConstraints = resize(fIDConstraints, fIDCPos);
    }
    return fIDConstraints;
}
 
Example #7
Source File: XMLSchemaValidator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Ends the value scope for the specified identity constraint.
 *
 * @param identityConstraint The identity constraint.
 */
public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.endValueScope();

}
 
Example #8
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
void addIDConstraintDecl(IdentityConstraint decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getIdentityConstraintName() : namespace + "," + decl.getIdentityConstraintName();

    if (fGlobalIDConstraintDecls.get(declKey) == null) {
        fGlobalIDConstraintDecls.put(declKey, decl);
    }
}
 
Example #9
Source File: XMLSchemaValidator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Constructs a value store for the specified identity constraint. */
protected ValueStoreBase(IdentityConstraint identityConstraint) {
    fIdentityConstraint = identityConstraint;
    fFieldCount = fIdentityConstraint.getFieldCount();
    fFields = new Field[fFieldCount];
    fLocalValues = new Object[fFieldCount];
    fLocalValueTypes = new short[fFieldCount];
    fLocalItemValueTypes = new ShortList[fFieldCount];
    for (int i = 0; i < fFieldCount; i++) {
        fFields[i] = fIdentityConstraint.getFieldAt(i);
    }
}
 
Example #10
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
void addIDConstraintDecl(IdentityConstraint decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getIdentityConstraintName() : namespace + "," + decl.getIdentityConstraintName();

    if (fGlobalIDConstraintDecls.get(declKey) == null) {
        fGlobalIDConstraintDecls.put(declKey, decl);
    }
}
 
Example #11
Source File: XMLSchemaValidator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Constructs a value store for the specified identity constraint. */
protected ValueStoreBase(IdentityConstraint identityConstraint) {
    fIdentityConstraint = identityConstraint;
    fFieldCount = fIdentityConstraint.getFieldCount();
    fFields = new Field[fFieldCount];
    fLocalValues = new Object[fFieldCount];
    fLocalValueTypes = new short[fFieldCount];
    fLocalItemValueTypes = new ShortList[fFieldCount];
    for (int i = 0; i < fFieldCount; i++) {
        fFields[i] = fIdentityConstraint.getFieldAt(i);
    }
}
 
Example #12
Source File: XSElementDecl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public IdentityConstraint[] getIDConstraints() {
    if (fIDCPos == 0) {
        return null;
    }
    if (fIDCPos < fIDConstraints.length) {
        fIDConstraints = resize(fIDConstraints, fIDCPos);
    }
    return fIDConstraints;
}
 
Example #13
Source File: XMLSchemaValidator.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Ends the value scope for the specified identity constraint.
 *
 * @param identityConstraint The identity constraint.
 */
public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.endValueScope();

}
 
Example #14
Source File: XSElementDecl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public IdentityConstraint[] getIDConstraints() {
    if (fIDCPos == 0) {
        return null;
    }
    if (fIDCPos < fIDConstraints.length) {
        fIDConstraints = resize(fIDConstraints, fIDCPos);
    }
    return fIDConstraints;
}
 
Example #15
Source File: XMLSchemaValidator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Start the value scope for the specified identity constraint. This
 * method is called when the selector matches in order to initialize
 * the value store.
 *
 * @param identityConstraint The identity constraint.
 */
public void startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.startValueScope();

}
 
Example #16
Source File: XMLSchemaValidator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Ends the value scope for the specified identity constraint.
 *
 * @param identityConstraint The identity constraint.
 */
public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.endValueScope();

}
 
Example #17
Source File: XMLSchemaValidator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Start the value scope for the specified identity constraint. This
 * method is called when the selector matches in order to initialize
 * the value store.
 *
 * @param identityConstraint The identity constraint.
 */
public void startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.startValueScope();

}
 
Example #18
Source File: XMLSchemaValidator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void activateSelectorFor(IdentityConstraint ic) {
    Selector selector = ic.getSelector();
    FieldActivator activator = this;
    if (selector == null)
        return;
    XPathMatcher matcher = selector.createMatcher(activator, fElementDepth);
    fMatcherStack.addMatcher(matcher);
    matcher.startDocumentFragment();
}
 
Example #19
Source File: XMLSchemaValidator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Constructs a value store for the specified identity constraint. */
protected ValueStoreBase(IdentityConstraint identityConstraint) {
    fIdentityConstraint = identityConstraint;
    fFieldCount = fIdentityConstraint.getFieldCount();
    fFields = new Field[fFieldCount];
    fLocalValues = new Object[fFieldCount];
    fLocalValueTypes = new short[fFieldCount];
    fLocalItemValueTypes = new ShortList[fFieldCount];
    for (int i = 0; i < fFieldCount; i++) {
        fFields[i] = fIdentityConstraint.getFieldAt(i);
    }
}
 
Example #20
Source File: XMLSchemaValidator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void transplant(IdentityConstraint id, int initialDepth) {
    fLocalId.fDepth = initialDepth;
    fLocalId.fId = id;
    ValueStoreBase newVals =
        (ValueStoreBase) fIdentityConstraint2ValueStoreMap.get(fLocalId);
    if (id.getCategory() == IdentityConstraint.IC_KEYREF)
        return;
    ValueStoreBase currVals = (ValueStoreBase) fGlobalIDConstraintMap.get(id);
    if (currVals != null) {
        currVals.append(newVals);
        fGlobalIDConstraintMap.put(id, currVals);
    } else
        fGlobalIDConstraintMap.put(id, newVals);

}
 
Example #21
Source File: XMLSchemaValidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Constructs a value store for the specified identity constraint. */
protected ValueStoreBase(IdentityConstraint identityConstraint) {
    fIdentityConstraint = identityConstraint;
    fFieldCount = fIdentityConstraint.getFieldCount();
    fFields = new Field[fFieldCount];
    fLocalValues = new Object[fFieldCount];
    fLocalValueTypes = new short[fFieldCount];
    fLocalItemValueTypes = new ShortList[fFieldCount];
    for (int i = 0; i < fFieldCount; i++) {
        fFields[i] = fIdentityConstraint.getFieldAt(i);
    }
}
 
Example #22
Source File: XSElementDecl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public IdentityConstraint[] getIDConstraints() {
    if (fIDCPos == 0) {
        return null;
    }
    if (fIDCPos < fIDConstraints.length) {
        fIDConstraints = resize(fIDConstraints, fIDCPos);
    }
    return fIDConstraints;
}
 
Example #23
Source File: XMLSchemaValidator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** endElement():  merges contents of fGlobalIDConstraintMap with the
 * top of fGlobalMapStack into fGlobalIDConstraintMap.
 */
public void endElement() {
    if (fGlobalMapStack.isEmpty()) {
        return; // must be an invalid doc!
    }
    Hashtable oldMap = (Hashtable) fGlobalMapStack.pop();
    // return if there is no element
    if (oldMap == null) {
        return;
    }

    Iterator entries = oldMap.entrySet().iterator();
    while (entries.hasNext()) {
        Map.Entry entry = (Map.Entry) entries.next();
        IdentityConstraint id = (IdentityConstraint) entry.getKey();
        ValueStoreBase oldVal = (ValueStoreBase) entry.getValue();
        if (oldVal != null) {
            ValueStoreBase currVal = (ValueStoreBase) fGlobalIDConstraintMap.get(id);
            if (currVal == null) {
                fGlobalIDConstraintMap.put(id, oldVal);
            }
            else if (currVal != oldVal) {
                currVal.append(oldVal);
            }
        }
    }
}
 
Example #24
Source File: XSElementDecl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public IdentityConstraint[] getIDConstraints() {
    if (fIDCPos == 0) {
        return null;
    }
    if (fIDCPos < fIDConstraints.length) {
        fIDConstraints = resize(fIDConstraints, fIDCPos);
    }
    return fIDConstraints;
}
 
Example #25
Source File: XMLSchemaValidator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private void activateSelectorFor(IdentityConstraint ic) {
    Selector selector = ic.getSelector();
    FieldActivator activator = this;
    if (selector == null)
        return;
    XPathMatcher matcher = selector.createMatcher(activator, fElementDepth);
    fMatcherStack.addMatcher(matcher);
    matcher.startDocumentFragment();
}
 
Example #26
Source File: XMLSchemaValidator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Constructs a value store for the specified identity constraint. */
protected ValueStoreBase(IdentityConstraint identityConstraint) {
    fIdentityConstraint = identityConstraint;
    fFieldCount = fIdentityConstraint.getFieldCount();
    fFields = new Field[fFieldCount];
    fLocalValues = new Object[fFieldCount];
    fLocalValueTypes = new short[fFieldCount];
    fLocalItemValueTypes = new ShortList[fFieldCount];
    for (int i = 0; i < fFieldCount; i++) {
        fFields[i] = fIdentityConstraint.getFieldAt(i);
    }
}
 
Example #27
Source File: XMLSchemaValidator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void startElement() {
    // only clone the hashtable when there are elements
    if (fGlobalIDConstraintMap.size() > 0)
        fGlobalMapStack.push((Map<IdentityConstraint, ValueStoreBase>)
                ((HashMap)fGlobalIDConstraintMap).clone());
    else
        fGlobalMapStack.push(null);
    fGlobalIDConstraintMap.clear();
}
 
Example #28
Source File: XMLSchemaValidator.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Start the value scope for the specified identity constraint. This
 * method is called when the selector matches in order to initialize
 * the value store.
 *
 * @param identityConstraint The identity constraint.
 */
public void startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {

    ValueStoreBase valueStore =
        fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
    valueStore.startValueScope();

}
 
Example #29
Source File: XMLSchemaValidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void transplant(IdentityConstraint id, int initialDepth) {
    fLocalId.fDepth = initialDepth;
    fLocalId.fId = id;
    ValueStoreBase newVals = fIdentityConstraint2ValueStoreMap.get(fLocalId);
    if (id.getCategory() == IdentityConstraint.IC_KEYREF)
        return;
    ValueStoreBase currVals = fGlobalIDConstraintMap.get(id);
    if (currVals != null) {
        currVals.append(newVals);
        fGlobalIDConstraintMap.put(id, currVals);
    } else
        fGlobalIDConstraintMap.put(id, newVals);

}
 
Example #30
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
void addIDConstraintDecl(IdentityConstraint decl) {
    final String namespace = decl.getNamespace();
    final String declKey = (namespace == null || namespace.length() == 0)
        ? "," + decl.getIdentityConstraintName() : namespace + "," + decl.getIdentityConstraintName();

    if (fGlobalIDConstraintDecls.get(declKey) == null) {
        fGlobalIDConstraintDecls.put(declKey, decl);
    }
}