com.sun.org.apache.xerces.internal.util.SecurityManager Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.util.SecurityManager. 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: XMLSecurityManager.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #2
Source File: XMLSecurityManager.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #3
Source File: XMLSecurityManager.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #4
Source File: XMLSecurityManager.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #5
Source File: XMLSecurityManager.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #6
Source File: XMLSecurityManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #7
Source File: XMLSecurityManager.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #8
Source File: XMLSecurityManager.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #9
Source File: XMLSecurityManager.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #10
Source File: XMLSecurityManager.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}
 
Example #11
Source File: XMLSecurityManager.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Convert a value set through setProperty to XMLSecurityManager.
 * If the value is an instance of XMLSecurityManager, use it to override the default;
 * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
 *
 * @param value user specified security manager
 * @param securityManager an instance of XMLSecurityManager
 * @return an instance of the new security manager XMLSecurityManager
 */
static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
    if (value == null) {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        return securityManager;
    }
    if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
        return (XMLSecurityManager)value;
    } else {
        if (securityManager == null) {
            securityManager = new XMLSecurityManager(true);
        }
        if (SecurityManager.class.isAssignableFrom(value.getClass())) {
            SecurityManager origSM = (SecurityManager)value;
            securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
            securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
            securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
        }
        return securityManager;
    }
}