java类javax.xml.bind.annotation.XmlNs的实例源码

TypeInfoSetImpl.java 文件源码 项目:OpenJSharp 阅读 33 收藏 0 点赞 0 评论 0
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();
}
TypeInfoSetImpl.java 文件源码 项目:openjdk-jdk10 阅读 26 收藏 0 点赞 0 评论 0
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();
}
TypeInfoSetImpl.java 文件源码 项目:openjdk9 阅读 26 收藏 0 点赞 0 评论 0
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();
}
TypeInfoSetImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 25 收藏 0 点赞 0 评论 0
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();
}
TypeInfoSetImpl.java 文件源码 项目:infobip-open-jdk-8 阅读 27 收藏 0 点赞 0 评论 0
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();
}
TypeInfoSetImpl.java 文件源码 项目:cxf-plus 阅读 26 收藏 0 点赞 0 评论 0
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();
}
XmlTypeUtils.java 文件源码 项目:jaxb2-basics 阅读 27 收藏 0 点赞 0 评论 0
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;
}
TypeInfoSetImpl.java 文件源码 项目:OLD-OpenJDK8 阅读 31 收藏 0 点赞 0 评论 0
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();
}
TypeInfoSetImpl.java 文件源码 项目:openjdk-icedtea7 阅读 39 收藏 0 点赞 0 评论 0
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();
}
NamespacePrefixPlugin.java 文件源码 项目:jaxb2-namespace-prefix 阅读 24 收藏 0 点赞 0 评论 0
@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;
}
XmlSchemaQuick.java 文件源码 项目:OpenJSharp 阅读 31 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:openjdk-jdk10 阅读 26 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:openjdk9 阅读 26 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 24 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:infobip-open-jdk-8 阅读 28 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:cxf-plus 阅读 29 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:OLD-OpenJDK8 阅读 25 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
XmlSchemaQuick.java 文件源码 项目:openjdk-icedtea7 阅读 25 收藏 0 点赞 0 评论 0
public XmlNs[] xmlns() {
    return core.xmlns();
}
JAXBContextImpl.java 文件源码 项目:OpenJSharp 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:openjdk-jdk10 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:openjdk9 阅读 37 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:infobip-open-jdk-8 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:cxf-plus 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:OLD-OpenJDK8 阅读 30 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}
JAXBContextImpl.java 文件源码 项目:openjdk-icedtea7 阅读 28 收藏 0 点赞 0 评论 0
/**
 * Returns declared XmlNs annotations (from package-level annotation XmlSchema
 *
 * @return set of all present XmlNs annotations
 */
public Set<XmlNs> getXmlNsSet() {
    return xmlNsSet;
}


问题


面经


文章

微信
公众号

扫码关注公众号