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

Java Navigator类代码示例

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

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



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

示例1: XmlSchemaGenerator

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

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
public TypeInfoSetImpl(Navigator<T,C,F,M> nav,
                       AnnotationReader<T,C,F,M> reader,
                       Map<T,? extends BuiltinLeafInfoImpl<T,C>> leaves) {
    this.nav = nav;
    this.reader = reader;
    this.builtins.putAll(leaves);

    this.anyType = createAnyType();

    // register primitive types.
    for (Map.Entry<Class, Class> e : RuntimeUtil.primitiveToBox.entrySet()) {
        this.builtins.put( nav.getPrimitive(e.getKey()), leaves.get(nav.ref(e.getValue())) );
    }

    // make sure at lease we got a map for global ones.
    elementMappings.put(null,new LinkedHashMap<QName,ElementInfoImpl<T,C,F,M>>());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:TypeInfoSetImpl.java


示例3: ModelBuilder

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
public ModelBuilder(
        AnnotationReader<T, C, F, M> reader,
        Navigator<T, C, F, M> navigator,
        Map<C, C> subclassReplacements,
        String defaultNamespaceRemap
) {

    this.reader = reader;
    this.nav = navigator;
    this.subclassReplacements = subclassReplacements;
    if(defaultNamespaceRemap==null)
        defaultNamespaceRemap = "";
    this.defaultNsUri = defaultNamespaceRemap;
    reader.setErrorHandler(proxyErrorHandler);
    typeInfoSet = createTypeInfoSet();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ModelBuilder.java


示例4: Adapter

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
public Adapter(ClassDeclT adapterType,Navigator<TypeT,ClassDeclT,?,?> nav) {
    this.adapterType = adapterType;
    TypeT baseClass = nav.getBaseClass(nav.use(adapterType), nav.asDecl(XmlAdapter.class));

    // because the parameterization of XmlJavaTypeAdapter requires that the class derives from XmlAdapter.
    assert baseClass!=null;

    if(nav.isParameterizedType(baseClass))
        defaultType = nav.getTypeArgument(baseClass,0);
    else
        defaultType = nav.ref(Object.class);

    if(nav.isParameterizedType(baseClass))
        customType = nav.getTypeArgument(baseClass,1);
    else
        customType = nav.ref(Object.class);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Adapter.java


示例5: getAsyncReturnType

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
private Class getAsyncReturnType(Method method, Class returnType) {
    if(Response.class.isAssignableFrom(returnType)){
        Type ret = method.getGenericReturnType();
        return Navigator.REFLECTION.erasure(((ParameterizedType)ret).getActualTypeArguments()[0]);
    }else{
        Type[] types = method.getGenericParameterTypes();
        Class[] params = method.getParameterTypes();
        int i = 0;
        for(Class cls : params){
            if(AsyncHandler.class.isAssignableFrom(cls)){
                return Navigator.REFLECTION.erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]);
            }
            i++;
        }
    }
    return returnType;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:18,代码来源:RuntimeModeler.java


示例6: get

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
/**
 * Gets the {@link TransducedAccessor} appropriately configured for
 * the given property.
 *
 * <p>
 * This allows the implementation to use an optimized code.
 */
public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
    Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
    RuntimePropertyInfo prop = ref.getSource();

    if(prop.isCollection()) {
        return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                Lister.create(Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),
                prop.getAdapter()));
    }

    if(prop.id()==ID.IDREF)
        return new IDREFTransducedAccessorImpl(prop.getAccessor());

    if(xducer.isDefault() && context != null && !context.fastBoot) {
        TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
        if(xa!=null)    return xa;
    }

    if(xducer.useNamespace())
        return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    else
        return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:31,代码来源:TransducedAccessor.java


示例7: ElementBeanInfoImpl

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
ElementBeanInfoImpl(JAXBContextImpl grammar, RuntimeElementInfo rei) {
    super(grammar,rei,(Class<JAXBElement>)rei.getType(),true,false,true);

    this.property = PropertyFactory.create(grammar,rei.getProperty());

    tagName = rei.getElementName();
    expectedType = Navigator.REFLECTION.erasure(rei.getContentInMemoryType());
    scope = rei.getScope()==null ? JAXBElement.GlobalScope.class : rei.getScope().getClazz();

    Class type = Navigator.REFLECTION.erasure(rei.getType());
    if(type==JAXBElement.class)
        constructor = null;
    else {
        try {
            constructor = type.getConstructor(expectedType);
        } catch (NoSuchMethodException e) {
            NoSuchMethodError x = new NoSuchMethodError("Failed to find the constructor for " + type + " with " + expectedType);
            x.initCause(e);
            throw x;
        }
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:23,代码来源:ElementBeanInfoImpl.java


示例8: addAllSubtypes

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


示例9: createLeaves

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
/**
 * Creates all the {@link BuiltinLeafInfoImpl}s as specified in the spec.
 *
 * {@link LeafInfo}s are all defined by the spec.
 */
public static <TypeT,ClassDeclT>
Map<TypeT,BuiltinLeafInfoImpl<TypeT,ClassDeclT>> createLeaves( Navigator<TypeT,ClassDeclT,?,?> nav ) {
    Map<TypeT,BuiltinLeafInfoImpl<TypeT,ClassDeclT>> leaves = new HashMap<TypeT,BuiltinLeafInfoImpl<TypeT,ClassDeclT>>();

    for( RuntimeBuiltinLeafInfoImpl<?> leaf : RuntimeBuiltinLeafInfoImpl.builtinBeanInfos ) {
        TypeT t = nav.ref(leaf.getClazz());
        leaves.put( t, new BuiltinLeafInfoImpl<TypeT,ClassDeclT>(t,leaf.getTypeNames()) );
    }

    return leaves;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:BuiltinLeafInfoImpl.java


示例10: Ref

import com.sun.xml.internal.bind.v2.model.nav.Navigator; //导入依赖的package包/类
public Ref(AnnotationReader<T,C,?,?> reader,
           Navigator<T,C,?,?> nav,
           T type, XmlJavaTypeAdapter xjta, XmlList xl ) {
    Adapter<T,C> adapter=null;
    if(xjta!=null) {
        adapter = new Adapter<T,C>(xjta,reader,nav);
        type = adapter.defaultType;
    }

    this.type = type;
    this.adapter = adapter;
    this.valueList = xl!=null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Ref.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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