Java Code Examples for com.sun.org.apache.xerces.internal.impl.XMLScanner.NameType#REFERENCE

The following examples show how to use com.sun.org.apache.xerces.internal.impl.XMLScanner.NameType#REFERENCE . 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: XMLEntityScanner.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}
 
Example 2
Source File: XMLEntityScanner.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}
 
Example 3
Source File: XMLEntityScanner.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}
 
Example 4
Source File: XMLEntityScanner.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}
 
Example 5
Source File: XMLEntityScanner.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}
 
Example 6
Source File: XMLEntityScanner.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}
 
Example 7
Source File: XMLEntityScanner.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the current entity is an Entity reference, check the accumulated size
 * against the limit.
 *
 * @param nt type of name (element, attribute or entity)
 * @param entity The current entity
 * @param offset The index of the first byte
 * @param length The length of the entity scanned
 */
protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
    if (entity == null || !entity.isGE) {
        return;
    }

    if (nt != NameType.REFERENCE) {
        checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
    }
    if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
        checkNodeCount(entity);
    }
}