common_helper/src/main/java/com/xiongyingqi/util/xml/StaxEventContentHandler.java
private List<Namespace> createNamespaces(SimpleNamespaceContext namespaceContext) {
        if (namespaceContext == null) {
            return null;
        }

        List<Namespace> namespaces = new ArrayList<Namespace>();
        String defaultNamespaceUri = namespaceContext.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
        if (StringUtils.hasLength(defaultNamespaceUri)) {
            namespaces.add(this.eventFactory.createNamespace(defaultNamespaceUri));
        }
        for (Iterator<String> iterator = namespaceContext.getBoundPrefixes(); iterator.hasNext(); ) {
            String prefix = iterator.next();
            String namespaceUri = namespaceContext.getNamespaceURI(prefix);
            namespaces.add(this.eventFactory.createNamespace(prefix, namespaceUri));
        }
        return namespaces;
    }
private List<Namespace> createNamespaces(SimpleNamespaceContext namespaceContext) {
        if (namespaceContext == null) {
            return null;
        }

        List<Namespace> namespaces = new ArrayList<Namespace>();
        String defaultNamespaceUri = namespaceContext.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
        if (StringUtils.hasLength(defaultNamespaceUri)) {
            namespaces.add(this.eventFactory.createNamespace(defaultNamespaceUri));
        }
        for (Iterator<String> iterator = namespaceContext.getBoundPrefixes(); iterator.hasNext(); ) {
            String prefix = iterator.next();
            String namespaceUri = namespaceContext.getNamespaceURI(prefix);
            namespaces.add(this.eventFactory.createNamespace(prefix, namespaceUri));
        }
        return namespaces;
    }
private List < Namespace > createNamespaces ( SimpleNamespaceContext namespaceContext ) { if ( namespaceContext == null ) { return null ; } List < Namespace > namespaces = new ArrayList < Namespace > ( ) ; String defaultNamespaceUri = namespaceContext . getNamespaceURI ( XMLConstants . DEFAULT_NS_PREFIX ) ; if ( StringUtils . hasLength ( defaultNamespaceUri ) ) { namespaces . add ( this . eventFactory . createNamespace ( defaultNamespaceUri ) ) ; } for ( Iterator < String > iterator = namespaceContext . getBoundPrefixes ( ) ; iterator . hasNext ( ) ; ) { String prefix = iterator . next ( ) ; String namespaceUri = namespaceContext . getNamespaceURI ( prefix ) ; namespaces . add ( this . eventFactory . createNamespace ( prefix , namespaceUri ) ) ; } return namespaces ; }
Create and return a list of {@code NameSpace} objects from the {@code NamespaceContext}.
Create and return a list of {