com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfo Java Examples

The following examples show how to use com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JAXBContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #2
Source File: PropertyFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #3
Source File: JAXBContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #4
Source File: JAXBContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #5
Source File: PropertyFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #6
Source File: JAXBContextImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #7
Source File: PropertyFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #8
Source File: PropertyFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #9
Source File: PropertyFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #10
Source File: JAXBContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #11
Source File: JAXBContextImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #12
Source File: JAXBContextImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #13
Source File: PropertyFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #14
Source File: JAXBContextImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e) {
    if(e instanceof RuntimeElementInfo)
        return getOrCreate((RuntimeElementInfo)e);
    if(e instanceof RuntimeClassInfo)
        return getOrCreate((RuntimeClassInfo)e);
    if(e instanceof RuntimeLeafInfo) {
        JaxBeanInfo bi = beanInfos.get(e); // must have been created
        assert bi!=null;
        return bi;
    }
    if(e instanceof RuntimeArrayInfo)
        return getOrCreate((RuntimeArrayInfo)e);
    if(e.getType()==Object.class) {
        // anyType
        JaxBeanInfo bi = beanInfoMap.get(Object.class);
        if(bi==null) {
            bi = new AnyTypeBeanInfo(this,e);
            beanInfoMap.put(Object.class,bi);
        }
        return bi;
    }

    throw new IllegalArgumentException();
}
 
Example #15
Source File: PropertyFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #16
Source File: PropertyFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #17
Source File: JaxBeanInfo.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #18
Source File: JaxBeanInfo.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #19
Source File: JaxBeanInfo.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #20
Source File: JaxBeanInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #21
Source File: JaxBeanInfo.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #22
Source File: JaxBeanInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #23
Source File: JaxBeanInfo.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #24
Source File: JaxBeanInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, Object typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    grammar.beanInfos.put(rti,this);

    this.jaxbType = jaxbType;
    this.typeName = typeName;
    this.flag = (short)((isElement?FLAG_IS_ELEMENT:0)
            |(isImmutable?FLAG_IS_IMMUTABLE:0)
            |(hasLifecycleEvents?FLAG_HAS_LIFECYCLE_EVENTS:0));
}
 
Example #25
Source File: AnyTypeBeanInfo.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public AnyTypeBeanInfo(JAXBContextImpl grammar,RuntimeTypeInfo anyTypeInfo) {
    super(grammar, anyTypeInfo, Object.class, new QName(WellKnownNamespace.XML_SCHEMA,"anyType"), false, true, false);
}
 
Example #26
Source File: JaxBeanInfo.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * For {@link JaxBeanInfo} that has multiple type names.
 */
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName[] typeNames, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    this(grammar,rti,jaxbType,(Object)typeNames,isElement,isImmutable,hasLifecycleEvents);
}
 
Example #27
Source File: JaxBeanInfo.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * For {@link JaxBeanInfo} that has multiple type names.
 */
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName[] typeNames, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
    this(grammar,rti,jaxbType,(Object)typeNames,isElement,isImmutable,hasLifecycleEvents);
}
 
Example #28
Source File: AnyTypeBeanInfo.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public AnyTypeBeanInfo(JAXBContextImpl grammar,RuntimeTypeInfo anyTypeInfo) {
    super(grammar, anyTypeInfo, Object.class, new QName(WellKnownNamespace.XML_SCHEMA,"anyType"), false, true, false);
}
 
Example #29
Source File: RuntimeElementPropertyInfoImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public List<? extends RuntimeTypeInfo> ref() {
    return (List<? extends RuntimeTypeInfo>)super.ref();
}
 
Example #30
Source File: RuntimeMapPropertyInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public List<? extends RuntimeTypeInfo> ref() {
    return (List<? extends RuntimeTypeInfo>)super.ref();
}