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

Java ClassInfo类代码示例

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

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



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

示例1: XmlSchemaGenerator

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的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: processForeignNamespaces

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
/**
 * Process the given PropertyInfo looking for references to namespaces that
 * are foreign to the given namespace.  Any foreign namespace references
 * found are added to the given namespaces dependency list and an &lt;import>
 * is generated for it.
 *
 * @param p the PropertyInfo
 */
private void processForeignNamespaces(PropertyInfo<T, C> p, int processingDepth) {
    for (TypeInfo<T, C> t : p.ref()) {
        if ((t instanceof ClassInfo) && (processingDepth > 0)) {
            java.util.List<PropertyInfo> l = ((ClassInfo) t).getProperties();
            for (PropertyInfo subp : l) {
                processForeignNamespaces(subp, --processingDepth);
            }
        }
        if (t instanceof Element) {
            addDependencyTo(((Element) t).getElementName());
        }
        if (t instanceof NonElement) {
            addDependencyTo(((NonElement) t).getTypeName());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:XmlSchemaGenerator.java


示例3: processForeignNamespaces

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
/**
 * Process the given PropertyInfo looking for references to namespaces that
 * are foreign to the given namespace.  Any foreign namespace references
 * found are added to the given namespaces dependency list and an {@code <import>}
 * is generated for it.
 *
 * @param p the PropertyInfo
 */
private void processForeignNamespaces(PropertyInfo<T, C> p, int processingDepth) {
    for (TypeInfo<T, C> t : p.ref()) {
        if ((t instanceof ClassInfo) && (processingDepth > 0)) {
            java.util.List<PropertyInfo> l = ((ClassInfo) t).getProperties();
            for (PropertyInfo subp : l) {
                processForeignNamespaces(subp, --processingDepth);
            }
        }
        if (t instanceof Element) {
            addDependencyTo(((Element) t).getElementName());
        }
        if (t instanceof NonElement) {
            addDependencyTo(((NonElement) t).getTypeName());
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:XmlSchemaGenerator.java


示例4: addAllSubtypes

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
private boolean addAllSubtypes(T type) {
    Navigator<T,C,F,M> nav = nav();

    // this allows the explicitly referenced type to be sucked in to the model
    NonElement<T,C> t = parent.builder.getClassInfo(nav.asDecl(type),this);
    if(!(t instanceof ClassInfo))
        // this is leaf.
        return false;

    boolean result = false;

    ClassInfo<T,C> c = (ClassInfo<T,C>) t;
    if(c.isElement()) {
        types.add(c.asElement());
        result = true;
    }

    // look for other possible types
    for( ClassInfo<T,C> ci : parent.owner.beans().values() ) {
        if(ci.isElement() && nav.isSubClassOf(ci.getType(),type)) {
            types.add(ci.asElement());
            result = true;
        }
    }

    // don't allow local elements to substitute.
    for( ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) {
        if(nav.isSubClassOf(ei.getType(),type)) {
            types.add(ei);
            result = true;
        }
    }

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:ReferencePropertyInfoImpl.java


示例5: add

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
/**
 * Adds a new class to the list of classes to be written.
 *
 * <p>
 * A {@link ClassInfo} may have two namespaces --- one for the element name
 * and the other for the type name. If they are different, we put the same
 * {@link ClassInfo} to two {@link Namespace}s.
 */
public void add( ClassInfo<T,C> clazz ) {
    assert clazz!=null;

    String nsUri = null;

    if(clazz.getClazz()==navigator.asDecl(CompositeStructure.class))
        return; // this is a special class we introduced for JAX-WS that we *don't* want in the schema

    if(clazz.isElement()) {
        // put element -> type reference
        nsUri = clazz.getElementName().getNamespaceURI();
        Namespace ns = getNamespace(nsUri);
        ns.classes.add(clazz);
        ns.addDependencyTo(clazz.getTypeName());

        // schedule writing this global element
        add(clazz.getElementName(),false,clazz);
    }

    QName tn = clazz.getTypeName();
    if(tn!=null) {
        nsUri = tn.getNamespaceURI();
    } else {
        // anonymous type
        if(nsUri==null)
            return;
    }

    Namespace n = getNamespace(nsUri);
    n.classes.add(clazz);

    // search properties for foreign namespace references
    for( PropertyInfo<T,C> p : clazz.getProperties()) {
        n.processForeignNamespaces(p, 1);
        if (p instanceof AttributePropertyInfo) {
            AttributePropertyInfo<T,C> ap = (AttributePropertyInfo<T,C>) p;
            String aUri = ap.getXmlName().getNamespaceURI();
            if(aUri.length()>0) {
                // global attribute
                getNamespace(aUri).addGlobalAttribute(ap);
                n.addDependencyTo(ap.getXmlName());
            }
        }
        if (p instanceof ElementPropertyInfo) {
            ElementPropertyInfo<T,C> ep = (ElementPropertyInfo<T,C>) p;
            for (TypeRef<T,C> tref : ep.getTypes()) {
                String eUri = tref.getTagName().getNamespaceURI();
                if(eUri.length()>0 && !eUri.equals(n.uri)) {
                    getNamespace(eUri).addGlobalElement(tref);
                    n.addDependencyTo(tref.getTagName());
                }
            }
        }

        if(generateSwaRefAdapter(p))
            n.useSwaRef = true;

        MimeType mimeType = p.getExpectedMimeType();
        if( mimeType != null ) {
            n.useMimeNs = true;
        }

    }

    // recurse on baseTypes to make sure that we can refer to them in the schema
    ClassInfo<T,C> bc = clazz.getBaseClass();
    if (bc != null) {
        add(bc);
        n.addDependencyTo(bc.getTypeName());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:80,代码来源:XmlSchemaGenerator.java


示例6: containsValueProp

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
private boolean containsValueProp(ClassInfo<T, C> c) {
    for (PropertyInfo p : c.getProperties()) {
        if (p instanceof ValuePropertyInfo) return true;
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:XmlSchemaGenerator.java


示例7: getScope

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
public ClassInfo<T, C> getScope() {
    return scope;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:ElementInfoImpl.java


示例8: findFieldProperties

import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
private void findFieldProperties(C c, XmlAccessType at) {

        // always find properties from the super class first
        C sc = nav().getSuperClass(c);
        if (shouldRecurseSuperClass(sc)) {
            findFieldProperties(sc,at);
        }

        for( F f : nav().getDeclaredFields(c) ) {
            Annotation[] annotations = reader().getAllFieldAnnotations(f,this);
            boolean isDummy = reader().hasFieldAnnotation(OverrideAnnotationOf.class, f);

            if( nav().isTransient(f) ) {
                // it's an error for transient field to have any binding annotation
                if(hasJAXBAnnotation(annotations))
                    builder.reportError(new IllegalAnnotationException(
                        Messages.TRANSIENT_FIELD_NOT_BINDABLE.format(nav().getFieldName(f)),
                            getSomeJAXBAnnotation(annotations)));
            } else
            if( nav().isStaticField(f) ) {
                // static fields are bound only when there's explicit annotation.
                if(hasJAXBAnnotation(annotations))
                    addProperty(createFieldSeed(f),annotations, false);
            } else {
                if(at==XmlAccessType.FIELD
                ||(at==XmlAccessType.PUBLIC_MEMBER && nav().isPublicField(f))
                || hasJAXBAnnotation(annotations)) {
                    if (isDummy) {
                        ClassInfo<T, C> top = getBaseClass();
                        while ((top != null) && (top.getProperty("content") == null)) {
                            top = top.getBaseClass();
                        }
                        DummyPropertyInfo prop = (DummyPropertyInfo) top.getProperty("content");
                        PropertySeed seed = createFieldSeed(f);
                        ((DummyPropertyInfo)prop).addType(createReferenceProperty(seed));
                    } else {
                        addProperty(createFieldSeed(f), annotations, false);
                    }
                }
                checkFieldXmlLocation(f);
            }
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:ClassInfoImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ColumnFamilyUpdater类代码示例发布时间:2022-05-23
下一篇:
Java TransactionSupport类代码示例发布时间: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