Java源码示例:com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfo
示例1
/**
* 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;
}
示例2
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();
}
示例3
/**
* 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;
}
示例4
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();
}
示例5
/**
* 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;
}
示例6
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();
}
示例7
/**
* 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;
}
示例8
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();
}
示例9
/**
* 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;
}
示例10
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();
}
示例11
/**
* 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;
}
示例12
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();
}
示例13
/**
* 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;
}
示例14
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();
}
示例15
/**
* 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;
}
示例16
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();
}
示例17
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));
}
示例18
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));
}
示例19
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));
}
示例20
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));
}
示例21
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));
}
示例22
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));
}
示例23
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));
}
示例24
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));
}
示例25
public List<? extends RuntimeTypeInfo> ref() {
return (List<? extends RuntimeTypeInfo>)super.ref();
}
示例26
public List<? extends RuntimeTypeInfo> ref() {
return (List<? extends RuntimeTypeInfo>)super.ref();
}
示例27
public AnyTypeBeanInfo(JAXBContextImpl grammar,RuntimeTypeInfo anyTypeInfo) {
super(grammar, anyTypeInfo, Object.class, new QName(WellKnownNamespace.XML_SCHEMA,"anyType"), false, true, false);
}
示例28
/**
* 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);
}
示例29
/**
* For {@link JaxBeanInfo} that has one type name.
*/
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName typeName, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
this(grammar,rti,jaxbType,(Object)typeName,isElement,isImmutable,hasLifecycleEvents);
}
示例30
/**
* For {@link JaxBeanInfo} that has no type names.
*/
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, boolean isElement,boolean isImmutable, boolean hasLifecycleEvents) {
this(grammar,rti,jaxbType,(Object)null,isElement,isImmutable,hasLifecycleEvents);
}