Java Code Examples for com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler#getMatchingElemDecl()

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler#getMatchingElemDecl() . 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: XSDFACM.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example 2
Source File: XSDFACM.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
Example 3
Source File: XSAllCM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 4
Source File: XSAllCM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example 5
Source File: XSAllCM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 6
Source File: XSAllCM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example 7
Source File: XSAllCM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 8
Source File: XSAllCM.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 9
Source File: XSAllCM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example 10
Source File: XSAllCM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 11
Source File: XSAllCM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example 12
Source File: XSAllCM.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The method corresponds to one transition in the content model.
 *
 * @param elementName
 * @param currentState  Current state
 * @return an element decl object
 */
public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {

    // error state
    if (currentState[0] < 0) {
        currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
        return findMatchingDecl(elementName, subGroupHandler);
    }

    // seen child
    currentState[0] = STATE_CHILD;

    Object matchingDecl = null;

    for (int i = 0; i < fNumElements; i++) {
        // we only try to look for a matching decl if we have not seen
        // this element yet.
        if (currentState[i+1] != STATE_START)
            continue;
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null) {
            // found the decl, mark this element as "seen".
            currentState[i+1] = STATE_VALID;
            return matchingDecl;
        }
    }

    // couldn't find the decl, change to error state.
    currentState[0] = XSCMValidator.FIRST_ERROR;
    return findMatchingDecl(elementName, subGroupHandler);
}
 
Example 13
Source File: XSAllCM.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 14
Source File: XSAllCM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 15
Source File: XSAllCM.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;
    for (int i = 0; i < fNumElements; i++) {
        matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
        if (matchingDecl != null)
            break;
    }
    return matchingDecl;
}
 
Example 16
Source File: XSDFACM.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
Object findMatchingDecl(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler, int elemIndex) {

        int curState = state[0];
        int nextState = 0;
        Object matchingDecl = null;

        while (++elemIndex < fElemMapSize) {
            nextState = fTransTable[curState][elemIndex];
            if (nextState == -1)
                continue;
            int type = fElemMapType[elemIndex] ;
            if (type == XSParticleDecl.PARTICLE_ELEMENT) {
                matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
                if (matchingDecl != null) {
                    break;
                }
            }
            else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
                if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
                    matchingDecl = fElemMap[elemIndex];
                    break;
                }
            }
        }

        // if we still can't find a match, set the state to FIRST_ERROR and return null
        if (elemIndex == fElemMapSize) {
            state[1] = state[0];
            state[0] = XSCMValidator.FIRST_ERROR;
            return findMatchingDecl(curElem, subGroupHandler);
        }

        // if we found a match, set the next state and reset the
        // counter if the next state is a counting state.
        state[0] = nextState;
        final Occurence o = fCountingStates[nextState];
        if (o != null) {
            state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
        }
        return matchingDecl;
    }
 
Example 17
Source File: XSDFACM.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
Object findMatchingDecl(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler, int elemIndex) {

        int curState = state[0];
        int nextState = 0;
        Object matchingDecl = null;

        while (++elemIndex < fElemMapSize) {
            nextState = fTransTable[curState][elemIndex];
            if (nextState == -1)
                continue;
            int type = fElemMapType[elemIndex] ;
            if (type == XSParticleDecl.PARTICLE_ELEMENT) {
                matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
                if (matchingDecl != null) {
                    break;
                }
            }
            else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
                if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
                    matchingDecl = fElemMap[elemIndex];
                    break;
                }
            }
        }

        // if we still can't find a match, set the state to FIRST_ERROR and return null
        if (elemIndex == fElemMapSize) {
            state[1] = state[0];
            state[0] = XSCMValidator.FIRST_ERROR;
            return findMatchingDecl(curElem, subGroupHandler);
        }

        // if we found a match, set the next state and reset the
        // counter if the next state is a counting state.
        state[0] = nextState;
        final Occurence o = fCountingStates[nextState];
        if (o != null) {
            state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
        }
        return matchingDecl;
    }
 
Example 18
Source File: XSDFACM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
Object findMatchingDecl(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler, int elemIndex) {

        int curState = state[0];
        int nextState = 0;
        Object matchingDecl = null;

        while (++elemIndex < fElemMapSize) {
            nextState = fTransTable[curState][elemIndex];
            if (nextState == -1)
                continue;
            int type = fElemMapType[elemIndex] ;
            if (type == XSParticleDecl.PARTICLE_ELEMENT) {
                matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
                if (matchingDecl != null) {
                    break;
                }
            }
            else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
                if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
                    matchingDecl = fElemMap[elemIndex];
                    break;
                }
            }
        }

        // if we still can't find a match, set the state to FIRST_ERROR and return null
        if (elemIndex == fElemMapSize) {
            state[1] = state[0];
            state[0] = XSCMValidator.FIRST_ERROR;
            return findMatchingDecl(curElem, subGroupHandler);
        }

        // if we found a match, set the next state and reset the
        // counter if the next state is a counting state.
        state[0] = nextState;
        final Occurence o = fCountingStates[nextState];
        if (o != null) {
            state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
        }
        return matchingDecl;
    }
 
Example 19
Source File: XSDFACM.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
Object findMatchingDecl(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler, int elemIndex) {

        int curState = state[0];
        int nextState = 0;
        Object matchingDecl = null;

        while (++elemIndex < fElemMapSize) {
            nextState = fTransTable[curState][elemIndex];
            if (nextState == -1)
                continue;
            int type = fElemMapType[elemIndex] ;
            if (type == XSParticleDecl.PARTICLE_ELEMENT) {
                matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
                if (matchingDecl != null) {
                    break;
                }
            }
            else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
                if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
                    matchingDecl = fElemMap[elemIndex];
                    break;
                }
            }
        }

        // if we still can't find a match, set the state to FIRST_ERROR and return null
        if (elemIndex == fElemMapSize) {
            state[1] = state[0];
            state[0] = XSCMValidator.FIRST_ERROR;
            return findMatchingDecl(curElem, subGroupHandler);
        }

        // if we found a match, set the next state and reset the
        // counter if the next state is a counting state.
        state[0] = nextState;
        final Occurence o = fCountingStates[nextState];
        if (o != null) {
            state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
        }
        return matchingDecl;
    }
 
Example 20
Source File: XSDFACM.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
Object findMatchingDecl(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler, int elemIndex) {

        int curState = state[0];
        int nextState = 0;
        Object matchingDecl = null;

        while (++elemIndex < fElemMapSize) {
            nextState = fTransTable[curState][elemIndex];
            if (nextState == -1)
                continue;
            int type = fElemMapType[elemIndex] ;
            if (type == XSParticleDecl.PARTICLE_ELEMENT) {
                matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
                if (matchingDecl != null) {
                    break;
                }
            }
            else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
                if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
                    matchingDecl = fElemMap[elemIndex];
                    break;
                }
            }
        }

        // if we still can't find a match, set the state to FIRST_ERROR and return null
        if (elemIndex == fElemMapSize) {
            state[1] = state[0];
            state[0] = XSCMValidator.FIRST_ERROR;
            return findMatchingDecl(curElem, subGroupHandler);
        }

        // if we found a match, set the next state and reset the
        // counter if the next state is a counting state.
        state[0] = nextState;
        final Occurence o = fCountingStates[nextState];
        if (o != null) {
            state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
        }
        return matchingDecl;
    }