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

Java NonElement类代码示例

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

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



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

示例1: processForeignNamespaces

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


示例2: link

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
public void link() {
    super.link();

    if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) {
            parent.builder.reportError(new IllegalAnnotationException(
            Messages.SIMPLE_TYPE_IS_REQUIRED.format(),
            seed
        ));
    }

    if(!isCollection() && seed.hasAnnotation(XmlList.class)) {
        parent.builder.reportError(new IllegalAnnotationException(
            Messages.XMLLIST_ON_SINGLE_PROPERTY.format(), this
        ));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:SingleTypePropertyInfoImpl.java


示例3: getTypeInfo

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
/**
 * Have the builder recognize the type (if it hasn't done so yet),
 * and returns a {@link NonElement} that represents it.
 *
 * @return
 *      always non-null.
 */
public NonElement<T,C> getTypeInfo(T t,Locatable upstream) {
    NonElement<T,C> r = typeInfoSet.getTypeInfo(t);
    if(r!=null)     return r;

    if(nav.isArray(t)) { // no need for checking byte[], because above typeInfoset.getTypeInfo() would return non-null
        ArrayInfoImpl<T,C,F,M> ai =
            createArrayInfo(upstream, t);
        addTypeName(ai);
        typeInfoSet.add(ai);
        return ai;
    }

    C c = nav.asDecl(t);
    assert c!=null : t.toString()+" must be a leaf, but we failed to recognize it.";
    return getClassInfo(c,upstream);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:ModelBuilder.java


示例4: getBaseClass

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
public ClassInfoImpl<T,C,F,M> getBaseClass() {
    if (!baseClassComputed) {
        // compute the base class
        C s = nav().getSuperClass(clazz);
        if(s==null || s==nav().asDecl(Object.class)) {
            baseClass = null;
        } else {
            NonElement<T,C> b = builder.getClassInfo(s, true, this);
            if(b instanceof ClassInfoImpl) {
                baseClass = (ClassInfoImpl<T,C,F,M>) b;
                baseClass.hasSubClasses = true;
            } else {
                baseClass = null;
            }
        }
        baseClassComputed = true;
    }
    return baseClass;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ClassInfoImpl.java


示例5: getSchemaGenerator

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
private synchronized XmlSchemaGenerator<TypeMirror, TypeElement, VariableElement, ExecutableElement> getSchemaGenerator() {
    if(xsdgen==null) {
        xsdgen = new XmlSchemaGenerator<TypeMirror, TypeElement, VariableElement, ExecutableElement>(types.getNavigator(), types);

        for (Map.Entry<QName, Reference> e : additionalElementDecls.entrySet()) {
            Reference value = e.getValue();
            if(value!=null) {
                NonElement<TypeMirror, TypeElement> typeInfo = refMap.get(value);
                if(typeInfo==null)
                    throw new IllegalArgumentException(e.getValue()+" was not specified to JavaCompiler.bind");
                TypeMirror type = value.type;
                xsdgen.add(e.getKey(), !(type != null && type.getKind().isPrimitive()), typeInfo);
            } else {
                xsdgen.add(e.getKey(),false,null);
            }
        }
    }
    return xsdgen;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:JAXBModelImpl.java


示例6: processForeignNamespaces

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


示例7: getSchemaGenerator

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
private synchronized XmlSchemaGenerator<TypeMirror, TypeDeclaration, FieldDeclaration, MethodDeclaration> getSchemaGenerator() {
    if(xsdgen==null) {
        xsdgen = new XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>( types.getNavigator(), types );

        for (Map.Entry<QName, Reference> e : additionalElementDecls.entrySet()) {
            Reference value = e.getValue();
            if(value!=null) {
                NonElement<TypeMirror, TypeDeclaration> typeInfo = refMap.get(value);
                if(typeInfo==null)
                    throw new IllegalArgumentException(e.getValue()+" was not specified to JavaCompiler.bind");
                xsdgen.add(e.getKey(),!(value.type instanceof PrimitiveType),typeInfo);
            } else {
                xsdgen.add(e.getKey(),false,null);
            }
        }
    }
    return xsdgen;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:19,代码来源:JAXBModelImpl.java


示例8: add

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
/**
 * Adds an additional element declaration.
 *
 * @param tagName
 *      The name of the element declaration to be added.
 * @param type
 *      The type this element refers to.
 *      Can be null, in which case the element refers to an empty anonymous complex type.
 */
public void add( QName tagName, boolean isNillable, NonElement<T,C> type ) {

    if(type!=null && type.getType()==navigator.ref(CompositeStructure.class))
        return; // this is a special class we introduced for JAX-WS that we *don't* want in the schema


    Namespace n = getNamespace(tagName.getNamespaceURI());
    n.elementDecls.put(tagName.getLocalPart(), n.new ElementWithType(isNillable,type));

    // search for foreign namespace references
    if(type!=null)
        n.addDependencyTo(type.getTypeName());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:XmlSchemaGenerator.java


示例9: addAllSubtypes

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


示例10: getTypeInfo

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
/**
 * Returns a {@link TypeInfo} for the given type.
 *
 * @return
 *      null if the specified type cannot be bound by JAXB, or
 *      not known to this set.
 */
public NonElement<T,C> getTypeInfo( T type ) {
    type = nav.erasure(type);   // replace type variables by their bounds

    LeafInfo<T,C> l = builtins.get(type);
    if(l!=null)     return l;

    if( nav.isArray(type) ) {
        return arrays.get(type);
    }

    C d = nav.asDecl(type);
    if(d==null)     return null;
    return getClassInfo(d);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:TypeInfoSetImpl.java


示例11: getClassInfo

import com.sun.xml.internal.bind.v2.model.core.NonElement; //导入依赖的package包/类
/**
 * Returns a {@link ClassInfo} for the given bean.
 *
 * <p>
 * This method is almost like refinement of {@link #getTypeInfo(Object)} except
 * our C cannot derive from T.
 *
 * @return
 *      null if the specified type is not bound by JAXB or otherwise
 *      unknown to this set.
 */
public NonElement<T,C> getClassInfo( C type ) {
    LeafInfo<T,C> l = builtins.get(nav.use(type));
    if(l!=null)     return l;

    l = enums.get(type);
    if(l!=null)     return l;

    if(nav.asDecl(Object.class).equals(type))
        return anyType;

    return beans.get(type);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:TypeInfoSetImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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