本文整理汇总了Java中com.sun.xml.internal.bind.v2.model.core.ClassInfo类的典型用法代码示例。如果您正苦于以下问题:Java ClassInfo类的具体用法?Java ClassInfo怎么用?Java ClassInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassInfo类属于com.sun.xml.internal.bind.v2.model.core包,在下文中一共展示了ClassInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XmlSchemaGenerator
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的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);
}
示例2: processForeignNamespaces
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的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());
}
}
}
示例3: processForeignNamespaces
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的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());
}
}
}
示例4: addAllSubtypes
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的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;
}
示例5: add
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
/**
* Adds a new class to the list of classes to be written.
*
* <p>
* A {@link ClassInfo} may have two namespaces --- one for the element name
* and the other for the type name. If they are different, we put the same
* {@link ClassInfo} to two {@link Namespace}s.
*/
public void add( ClassInfo<T,C> clazz ) {
assert clazz!=null;
String nsUri = null;
if(clazz.getClazz()==navigator.asDecl(CompositeStructure.class))
return; // this is a special class we introduced for JAX-WS that we *don't* want in the schema
if(clazz.isElement()) {
// put element -> type reference
nsUri = clazz.getElementName().getNamespaceURI();
Namespace ns = getNamespace(nsUri);
ns.classes.add(clazz);
ns.addDependencyTo(clazz.getTypeName());
// schedule writing this global element
add(clazz.getElementName(),false,clazz);
}
QName tn = clazz.getTypeName();
if(tn!=null) {
nsUri = tn.getNamespaceURI();
} else {
// anonymous type
if(nsUri==null)
return;
}
Namespace n = getNamespace(nsUri);
n.classes.add(clazz);
// search properties for foreign namespace references
for( PropertyInfo<T,C> p : clazz.getProperties()) {
n.processForeignNamespaces(p, 1);
if (p instanceof AttributePropertyInfo) {
AttributePropertyInfo<T,C> ap = (AttributePropertyInfo<T,C>) p;
String aUri = ap.getXmlName().getNamespaceURI();
if(aUri.length()>0) {
// global attribute
getNamespace(aUri).addGlobalAttribute(ap);
n.addDependencyTo(ap.getXmlName());
}
}
if (p instanceof ElementPropertyInfo) {
ElementPropertyInfo<T,C> ep = (ElementPropertyInfo<T,C>) p;
for (TypeRef<T,C> tref : ep.getTypes()) {
String eUri = tref.getTagName().getNamespaceURI();
if(eUri.length()>0 && !eUri.equals(n.uri)) {
getNamespace(eUri).addGlobalElement(tref);
n.addDependencyTo(tref.getTagName());
}
}
}
if(generateSwaRefAdapter(p))
n.useSwaRef = true;
MimeType mimeType = p.getExpectedMimeType();
if( mimeType != null ) {
n.useMimeNs = true;
}
}
// recurse on baseTypes to make sure that we can refer to them in the schema
ClassInfo<T,C> bc = clazz.getBaseClass();
if (bc != null) {
add(bc);
n.addDependencyTo(bc.getTypeName());
}
}
示例6: containsValueProp
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
private boolean containsValueProp(ClassInfo<T, C> c) {
for (PropertyInfo p : c.getProperties()) {
if (p instanceof ValuePropertyInfo) return true;
}
return false;
}
示例7: getScope
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的package包/类
public ClassInfo<T, C> getScope() {
return scope;
}
示例8: findFieldProperties
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; //导入依赖的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);
}
}
}