当前位置: 首页>>代码示例>>Java>>正文


Java OverrideAnnotationOf类代码示例

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


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

示例1: checkUnusedProperties

import com.sun.xml.internal.bind.annotation.OverrideAnnotationOf; //导入依赖的package包/类
/**
 * Report errors for unused propOrder entries.
 */
public void checkUnusedProperties() {
    for( int i=0; i<used.length; i++ )
        if(used[i]==null) {
            String unusedName = propOrder[i];
            String nearest = EditDistance.findNearest(unusedName, new AbstractList<String>() {
                public String get(int index) {
                    return properties.get(index).getName();
                }

                public int size() {
                    return properties.size();
                }
            });
            boolean isOverriding = (i > (properties.size()-1)) ? false : properties.get(i).hasAnnotation(OverrideAnnotationOf.class);
            if (!isOverriding) {
                builder.reportError(new IllegalAnnotationException(
                Messages.PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY.format(unusedName,nearest),ClassInfoImpl.this));
            }
        }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:ClassInfoImpl.java

示例2: findFieldProperties

import com.sun.xml.internal.bind.annotation.OverrideAnnotationOf; //导入依赖的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

示例3: annotateDummy

import com.sun.xml.internal.bind.annotation.OverrideAnnotationOf; //导入依赖的package包/类
private void annotateDummy(JAnnotatable field) {
    field.annotate(OverrideAnnotationOf.class);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:DummyListField.java


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