Java 类javax.xml.bind.annotation.XmlNs 实例源码

项目:OpenJSharp    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:openjdk-jdk10    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:openjdk9    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:lookaside_java-1.8.0-openjdk    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:infobip-open-jdk-8    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:cxf-plus    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:jaxb2-basics    文件:XmlTypeUtils.java   
private static String getPrefix(final Package targetPackage,
        String namespaceURI) {
    String prefix;
    final Map<String, String> namespacePrefixes = new HashMap<String, String>();
    if (targetPackage != null) {
        final XmlSchema xmlSchemaAnnotation = targetPackage
                .getAnnotation(XmlSchema.class);
        if (xmlSchemaAnnotation != null) {
            for (XmlNs xmlns : xmlSchemaAnnotation.xmlns()) {
                namespacePrefixes.put(xmlns.namespaceURI(), xmlns.prefix());
            }
        }
    }

    prefix = namespacePrefixes.get(namespaceURI);
    return prefix;
}
项目:OLD-OpenJDK8    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:openjdk-icedtea7    文件:TypeInfoSetImpl.java   
public Map<String,String> getXmlNs(String namespaceUri) {
    if(xmlNsCache==null) {
        xmlNsCache = new HashMap<String,Map<String,String>>();

        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
            if(xs==null)
                continue;

            String uri = xs.namespace();
            Map<String,String> m = xmlNsCache.get(uri);
            if(m==null)
                xmlNsCache.put(uri,m=new HashMap<String, String>());

            for( XmlNs xns : xs.xmlns() ) {
                m.put(xns.prefix(),xns.namespaceURI());
            }
        }
    }

    Map<String,String> r = xmlNsCache.get(namespaceUri);
    if(r!=null)     return r;
    else            return Collections.emptyMap();
}
项目:jaxb2-namespace-prefix    文件:NamespacePrefixPlugin.java   
@Override
public boolean run(final Outline outline, final Options options, final ErrorHandler errorHandler) {
    final JClass xmlNsClass = outline.getCodeModel().ref(XmlNs.class);
    final JClass xmlSchemaClass = outline.getCodeModel().ref(XmlSchema.class);

    for (PackageOutline packageOutline : outline.getAllPackageContexts()) {
        final JPackage p = packageOutline._package();

        // get the target namespaces of all schemas that bind to the current package
        final Set<String> packageNamespaces = getPackageNamespace(packageOutline);

        // is there any prefix binding defined for the current package ?
        final Model packageModel = getPackageModel((PackageOutlineImpl) packageOutline);
        final List<Pair> list = getPrefixBinding(packageModel, packageNamespaces);
        acknowledgePrefixAnnotations(packageModel);

        if (list == null || list.isEmpty()) {
            // no prefix binding, nothing to do
            continue;
        }

        // add XML namespace prefix annotations
        final JAnnotationUse xmlSchemaAnnotation = getOrAddXmlSchemaAnnotation(p, xmlSchemaClass);
        if (xmlSchemaAnnotation == null) {
            throw new RuntimeException("Unable to get/add 'XmlSchema' annotation to package [" + p.name() + "]");
        }

        final JAnnotationArrayMember members = xmlSchemaAnnotation.paramArray("xmlns");
        for (Pair pair : list) {
            addNamespacePrefix(xmlNsClass, members, pair.getNamespace(), pair.getPrefix());
        }
    }

    return true;
}
项目:OpenJSharp    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:openjdk-jdk10    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:openjdk9    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:lookaside_java-1.8.0-openjdk    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:infobip-open-jdk-8    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:cxf-plus    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:OLD-OpenJDK8    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:openjdk-icedtea7    文件:XmlSchemaQuick.java   
public XmlNs[] xmlns() {
    return core.xmlns();
}
项目:OpenJSharp    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:openjdk-jdk10    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:openjdk9    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:lookaside_java-1.8.0-openjdk    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:infobip-open-jdk-8    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:cxf-plus    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:OLD-OpenJDK8    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
项目:openjdk-icedtea7    文件:JAXBContextImpl.java   
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}