本文整理汇总了Java中com.sun.tools.internal.xjc.model.CClassInfo类的典型用法代码示例。如果您正苦于以下问题:Java CClassInfo类的具体用法?Java CClassInfo怎么用?Java CClassInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CClassInfo类属于com.sun.tools.internal.xjc.model包,在下文中一共展示了CClassInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUsedPackages
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
* Returns all <i>used</i> JPackages.
*
* A JPackage is considered as "used" if a ClassItem or
* a InterfaceItem resides in that package.
*
* This value is dynamically calculated every time because
* one can freely remove ClassItem/InterfaceItem.
*
* @return
* Given the same input, the order of packages in the array
* is always the same regardless of the environment.
*/
public final JPackage[] getUsedPackages(Aspect aspect) {
Set<JPackage> s = new TreeSet<JPackage>();
for (CClassInfo bean : model.beans().values()) {
JClassContainer cont = getContainer(bean.parent(), aspect);
if (cont.isPackage()) {
s.add((JPackage) cont);
}
}
for (CElementInfo e : model.getElementMappings(null).values()) {
// at the first glance you might think we should be iterating all elements,
// not just global ones, but if you think about it, local ones live inside
// another class, so those packages are already enumerated when we were
// walking over CClassInfos.
s.add(e._package());
}
return s.toArray(new JPackage[s.size()]);
}
示例2: generateClassDef
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
* Generates the minimum {@link JDefinedClass} skeleton
* without filling in its body.
*/
private ClassOutlineImpl generateClassDef(CClassInfo bean) {
ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean);
JClass implRef;
if (bean.getUserSpecifiedImplClass() != null) {
// create a place holder for a user-specified class.
JDefinedClass usr;
try {
usr = codeModel._class(bean.getUserSpecifiedImplClass());
// but hide that file so that it won't be generated.
usr.hide();
} catch (JClassAlreadyExistsException e) {
// it's OK for this to collide.
usr = e.getExistingClass();
}
usr._extends(r.implementation);
implRef = usr;
} else {
implRef = r.implementation;
}
return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef);
}
示例3: containingChoice
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
private boolean containingChoice(CClassInfo typeBean) {
XSComponent component = typeBean.getSchemaComponent();
if (component instanceof XSComplexType) {
XSContentType contentType = ((XSComplexType) component).getContentType();
XSParticle particle = contentType.asParticle();
if (particle != null) {
XSTerm term = particle.getTerm();
XSModelGroup modelGroup = term.asModelGroup();
if (modelGroup != null) {
return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE);
}
}
}
return false;
}
示例4: toElementRef
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
* The whole type set can be later bound to a reference property,
* in which case we need to generate additional code to wrap this
* type reference into an element class.
*
* This method generates such an element class and returns it.
*/
protected void toElementRef(CReferencePropertyInfo prop) {
CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean();
Model model = Ring.get(Model.class);
CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList();
if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) {
CClassInfo bean = new CClassInfo(model,scope,
model.getNameConverter().toClassName(decl.getName()),
decl.getLocator(), null, BGMBuilder.getName(decl), decl,
custs);
bean.setBaseClass((CClassInfo)target);
prop.getElements().add(bean);
} else {
CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target,
decl.getDefaultValue(), decl, custs, decl.getLocator());
prop.getElements().add(e);
}
}
示例5: never
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
* Makes sure that the component doesn't carry a {@link BIClass}
* customization.
*
* @return
* return value is unused. Since most of the caller needs to
* return null, to make the code a little bit shorter, this
* method always return null (so that the caller can always
* say <code>return never(sc);</code>.
*/
private CClassInfo never() {
// all we need to do here is just not to acknowledge
// any class customization. Then this class customization
// will be reported as an error later when we check all
// unacknowledged customizations.
// BIDeclaration cust=owner.getBindInfo(component).get(BIClass.NAME);
// if(cust!=null) {
// // error
// owner.errorReporter.error(
// cust.getLocation(),
// "test {0}", NameGetter.get(component) );
// }
return null;
}
示例6: calcClass
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
private CClassInfo calcClass() {
BIElement e = owner.bindInfo.element(name);
if(e==null) {
if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
|| !attributes.isEmpty()
|| mustBeClass)
return createDefaultClass();
if(contentModel!=Term.EMPTY) {
throw new UnsupportedOperationException("mixed content model not supported");
} else {
// just #PCDATA
if(isReferenced)
return null;
else
// if no one else is referencing, assumed to be the root.
return createDefaultClass();
}
} else {
return e.clazz;
}
}
示例7: mapToClass
import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
private void mapToClass(DElementPattern p) {
NameClass nc = p.getName();
if(nc.isOpen())
return; // infinite name. can't map to a class.
Set<QName> names = nc.listNames();
CClassInfo[] types = new CClassInfo[names.size()];
int i=0;
for( QName n : names ) {
// TODO: read class names from customization
String name = model.getNameConverter().toClassName(n.getLocalPart());
bindQueue.put(
types[i++] = new CClassInfo(model,pkg,name,p.getLocation(),null,n,null,null/*TODO*/),
p.getChild() );
}
classes.put(p,types);
}