• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TypeInfoSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.bind.v2.model.core.TypeInfoSet的典型用法代码示例。如果您正苦于以下问题:Java TypeInfoSet类的具体用法?Java TypeInfoSet怎么用?Java TypeInfoSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeInfoSet类属于com.sun.xml.internal.bind.v2.model.core包,在下文中一共展示了TypeInfoSet类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: XmlSchemaGenerator

import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; //导入依赖的package包/类
public XmlSchemaGenerator( Navigator<T,C,F,M> navigator, TypeInfoSet<T,C,F,M> types ) {
    this.navigator = navigator;
    this.types = types;

    this.stringType = types.getTypeInfo(navigator.ref(String.class));
    this.anyType = types.getAnyTypeInfo();

    // populate the object
    for( ClassInfo<T,C> ci : types.beans().values() )
        add(ci);
    for( ElementInfo<T,C> ei1 : types.getElementMappings(null).values() )
        add(ei1);
    for( EnumLeafInfo<T,C> ei : types.enums().values() )
        add(ei);
    for( ArrayInfo<T,C> a : types.arrays().values())
        add(a);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XmlSchemaGenerator.java


示例2: link

import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; //导入依赖的package包/类
/**
 * Called after all the classes are added to the type set
 * to "link" them together.
 *
 * <p>
 * Don't expose implementation classes in the signature.
 *
 * @return
 *      fully built {@link TypeInfoSet} that represents the model,
 *      or null if there was an error.
 */
public TypeInfoSet<T,C,F,M> link() {

    assert !linked;
    linked = true;

    for( ElementInfoImpl ei : typeInfoSet.getAllElements() )
        ei.link();

    for( ClassInfoImpl ci : typeInfoSet.beans().values() )
        ci.link();

    for( EnumLeafInfoImpl li : typeInfoSet.enums().values() )
        li.link();

    if(hadError)
        return null;
    else
        return typeInfoSet;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:ModelBuilder.java


示例3: bind

import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; //导入依赖的package包/类
public J2SJAXBModel bind(
    Collection<Reference> rootClasses,
    Map<QName,Reference> additionalElementDecls,
    String defaultNamespaceRemap,
    ProcessingEnvironment env) {

    ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement> builder =
            new ModelBuilder<TypeMirror, TypeElement, VariableElement, ExecutableElement>(
            InlineAnnotationReaderImpl.theInstance,
            new ApNavigator(env),
            Collections.<TypeElement, TypeElement>emptyMap(),
            defaultNamespaceRemap );

    builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager()));

    for ( Reference ref : rootClasses ) {
        TypeMirror t = ref.type;

        XmlJavaTypeAdapter xjta = ref.annotations.getAnnotation(XmlJavaTypeAdapter.class);
        XmlList xl = ref.annotations.getAnnotation(XmlList.class);

        builder.getTypeInfo(new Ref<TypeMirror, TypeElement>(builder, t, xjta, xl));
    }

    TypeInfoSet<TypeMirror, TypeElement, VariableElement, ExecutableElement> r = builder.link();
    if(r==null)     return null;

    if(additionalElementDecls==null)
        additionalElementDecls = Collections.emptyMap();
    else {
        // fool proof check
        for (Map.Entry<QName, ? extends Reference> e : additionalElementDecls.entrySet()) {
            if(e.getKey()==null)
                throw new IllegalArgumentException("nulls in additionalElementDecls");
        }
    }
    return new JAXBModelImpl(r, builder.reader, rootClasses, new HashMap<QName, Reference>(additionalElementDecls));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:JavaCompilerImpl.java


示例4: bind

import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; //导入依赖的package包/类
public J2SJAXBModel bind(
    Collection<Reference> rootClasses,
    Map<QName,Reference> additionalElementDecls,
    String defaultNamespaceRemap,
    AnnotationProcessorEnvironment env) {

    ModelBuilder<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> builder =
        new ModelBuilder<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>(
            InlineAnnotationReaderImpl.theInstance,
            new APTNavigator(env),
            Collections.<TypeDeclaration,TypeDeclaration>emptyMap(),
            defaultNamespaceRemap );

    builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager()));

    for( Reference ref : rootClasses ) {
        TypeMirror t = ref.type;

        XmlJavaTypeAdapter xjta = ref.annotations.getAnnotation(XmlJavaTypeAdapter.class);
        XmlList xl = ref.annotations.getAnnotation(XmlList.class);

        builder.getTypeInfo(new Ref<TypeMirror,TypeDeclaration>(builder,t,xjta,xl));
    }

    TypeInfoSet r = builder.link();
    if(r==null)     return null;

    if(additionalElementDecls==null)
        additionalElementDecls = Collections.emptyMap();
    else {
        // fool proof check
        for (Map.Entry<QName, ? extends Reference> e : additionalElementDecls.entrySet()) {
            if(e.getKey()==null)
                throw new IllegalArgumentException("nulls in additionalElementDecls");
        }
    }
    return new JAXBModelImpl(r,builder.reader,rootClasses,new HashMap(additionalElementDecls));
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:39,代码来源:JavaCompilerImpl.java


示例5: JAXBModelImpl

import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; //导入依赖的package包/类
public JAXBModelImpl(TypeInfoSet<TypeMirror, TypeElement, VariableElement, ExecutableElement> types,
                     AnnotationReader<TypeMirror, TypeElement, VariableElement, ExecutableElement> reader,
                     Collection<Reference> rootClasses,
                     Map<QName, Reference> additionalElementDecls) {
    this.types = types;
    this.reader = reader;
    this.additionalElementDecls = additionalElementDecls;

    Navigator<TypeMirror, TypeElement, VariableElement, ExecutableElement> navigator = types.getNavigator();

    for (ClassInfo<TypeMirror, TypeElement> i : types.beans().values()) {
        classList.add(i.getName());
    }

    for (ArrayInfo<TypeMirror, TypeElement> a : types.arrays().values()) {
        String javaName = navigator.getTypeName(a.getType());
        classList.add(javaName);
    }

    for (EnumLeafInfo<TypeMirror, TypeElement> l : types.enums().values()) {
        QName tn = l.getTypeName();
        if(tn!=null) {
            String javaName = navigator.getTypeName(l.getType());
            classList.add(javaName);
        }
    }

    for (Reference ref : rootClasses)
        refMap.put(ref,getXmlType(ref));

    // check for collision between "additional" ones and the ones given to JAXB
    // and eliminate duplication
    Iterator<Map.Entry<QName, Reference>> itr = additionalElementDecls.entrySet().iterator();
    while(itr.hasNext()) {
        Map.Entry<QName, Reference> entry = itr.next();
        if(entry.getValue()==null)      continue;

        NonElement<TypeMirror, TypeElement> xt = getXmlType(entry.getValue());

        assert xt!=null;
        refMap.put(entry.getValue(),xt);
        if(xt instanceof ClassInfo) {
            ClassInfo<TypeMirror, TypeElement> xct = (ClassInfo<TypeMirror, TypeElement>) xt;
            Element<TypeMirror, TypeElement> elem = xct.asElement();
            if(elem!=null && elem.getElementName().equals(entry.getKey())) {
                itr.remove();
                continue;
            }
        }
        ElementInfo<TypeMirror, TypeElement> ei = types.getElementInfo(null, entry.getKey());
        if(ei!=null && ei.getContentType()==xt)
            itr.remove();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:JAXBModelImpl.java


示例6: JAXBModelImpl

import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; //导入依赖的package包/类
public JAXBModelImpl(TypeInfoSet<TypeMirror, TypeDeclaration, FieldDeclaration, MethodDeclaration> types,
                     AnnotationReader<TypeMirror, TypeDeclaration, FieldDeclaration, MethodDeclaration> reader,
                     Collection<Reference> rootClasses,
                     Map<QName, Reference> additionalElementDecls) {
    this.types = types;
    this.reader = reader;
    this.additionalElementDecls = additionalElementDecls;

    Navigator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> navigator = types.getNavigator();

    for( ClassInfo<TypeMirror,TypeDeclaration> i : types.beans().values() ) {
        classList.add(i.getName());
    }

    for(ArrayInfo<TypeMirror,TypeDeclaration> a : types.arrays().values()) {
        String javaName = navigator.getTypeName(a.getType());
        classList.add(javaName);
    }

    for( EnumLeafInfo<TypeMirror,TypeDeclaration> l : types.enums().values() ) {
        QName tn = l.getTypeName();
        if(tn!=null) {
            String javaName = navigator.getTypeName(l.getType());
            classList.add(javaName);
        }
    }

    for (Reference ref : rootClasses)
        refMap.put(ref,getXmlType(ref));

    // check for collision between "additional" ones and the ones given to JAXB
    // and eliminate duplication
    Iterator<Map.Entry<QName, Reference>> itr = additionalElementDecls.entrySet().iterator();
    while(itr.hasNext()) {
        Map.Entry<QName, Reference> entry = itr.next();
        if(entry.getValue()==null)      continue;

        NonElement<TypeMirror,TypeDeclaration> xt = getXmlType(entry.getValue());

        assert xt!=null;
        refMap.put(entry.getValue(),xt);
        if(xt instanceof ClassInfo) {
            ClassInfo<TypeMirror,TypeDeclaration> xct = (ClassInfo<TypeMirror,TypeDeclaration>) xt;
            Element<TypeMirror,TypeDeclaration> elem = xct.asElement();
            if(elem!=null && elem.getElementName().equals(entry.getKey())) {
                itr.remove();
                continue;
            }
        }
        ElementInfo<TypeMirror,TypeDeclaration> ei = types.getElementInfo(null,entry.getKey());
        if(ei!=null && ei.getContentType()==xt)
            itr.remove();
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:55,代码来源:JAXBModelImpl.java



注:本文中的com.sun.xml.internal.bind.v2.model.core.TypeInfoSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClickHandler类代码示例发布时间:2022-05-23
下一篇:
Java AutofillSuggestion类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap