本文整理汇总了Java中com.sun.tools.internal.xjc.model.CReferencePropertyInfo类的典型用法代码示例。如果您正苦于以下问题:Java CReferencePropertyInfo类的具体用法?Java CReferencePropertyInfo怎么用?Java CReferencePropertyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CReferencePropertyInfo类属于com.sun.tools.internal.xjc.model包,在下文中一共展示了CReferencePropertyInfo类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: build
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
@Override
public void build( XSParticle p, Collection<XSParticle> forcedProps ) {
Checker checker = checkCollision(p,forcedProps);
if(checker.hasNameCollision()) {
CReferencePropertyInfo prop = new CReferencePropertyInfo(
getCurrentBean().getBaseClass()==null?"Content":"Rest",
true, false, false, p,
builder.getBindInfo(p).toCustomizationList(),
p.getLocator(), false, false, false);
RawTypeSetBuilder.build(p,false).addTo(prop);
prop.javadoc = Messages.format( Messages.MSG_FALLBACK_JAVADOC,
checker.getCollisionInfo().toString() );
getCurrentBean().addProperty(prop);
} else {
new Builder(checker.markedParticles).particle(p);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DefaultParticleBinder.java
示例2: toElementRef
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的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);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:RawTypeSetBuilder.java
示例3: annotate
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
/**
* Annotate the field according to the recipes given as {@link CPropertyInfo}.
*/
protected void annotate( JAnnotatable field ) {
assert(field!=null);
/*
TODO: consider moving this logic to somewhere else
so that it can be better shared, for how a field gets
annotated doesn't really depend on how we generate accessors.
so perhaps we should separate those two.
*/
// TODO: consider a visitor
if (prop instanceof CAttributePropertyInfo) {
annotateAttribute(field);
} else if (prop instanceof CElementPropertyInfo) {
annotateElement(field);
} else if (prop instanceof CValuePropertyInfo) {
field.annotate(XmlValue.class);
} else if (prop instanceof CReferencePropertyInfo) {
annotateReference(field);
}
outline.parent().generateAdapterIfNecessary(prop,field);
QName st = prop.getSchemaType();
if(st!=null)
field.annotate2(XmlSchemaTypeWriter.class)
.name(st.getLocalPart())
.namespace(st.getNamespaceURI());
if(prop.inlineBinaryData())
field.annotate(XmlInlineBinaryData.class);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:AbstractField.java
示例4: getType
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
@Override
protected JType getType(final Aspect aspect) {
if (Aspect.IMPLEMENTATION.equals(aspect)) {
return super.getType(aspect);
}
if (prop instanceof CReferencePropertyInfo) {
Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
if ((elements != null) && (elements.size() > 0)) {
return codeModel.ref(Serializable.class);
}
}
return codeModel.ref(String.class);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:NoExtendedContentField.java
示例5: annotate
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
/**
* Annotate the field according to the recipes given as {@link CPropertyInfo}.
*/
@Override
protected void annotate( JAnnotatable field ) {
super.annotate(field);
if (prop instanceof CReferencePropertyInfo) {
CReferencePropertyInfo pref = (CReferencePropertyInfo)prop;
if (pref.isDummy()) {
annotateDummy(field);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:DummyListField.java
示例6: decideRenderer
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
private FieldRenderer decideRenderer(ClassOutlineImpl outline, CPropertyInfo prop) {
if (prop instanceof CReferencePropertyInfo) {
CReferencePropertyInfo p = (CReferencePropertyInfo)prop;
if (p.isDummy()) {
return frf.getDummyList(outline.parent().getCodeModel().ref(ArrayList.class));
}
if (p.isContent() && (p.isMixedExtendedCust())) {
return frf.getContentList(outline.parent().getCodeModel().ref(ArrayList.class).narrow(Serializable.class));
}
}
if(!prop.isCollection()) {
// non-collection field
// TODO: check for bidning info for optionalPrimitiveType=boxed or
// noHasMethod=false and noDeletedMethod=false
if(prop.isUnboxable())
// this one uses a primitive type as much as possible
return frf.getRequiredUnboxed();
else
// otherwise use the default non-collection field
return frf.getSingle();
}
if( defaultCollectionFieldRenderer==null ) {
return frf.getList(outline.parent().getCodeModel().ref(ArrayList.class));
}
// this field is a collection field.
// use untyped list as the default. This is consistent
// to the JAXB spec.
return defaultCollectionFieldRenderer;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:DefaultFieldRenderer.java
示例7: createDummyExtendedMixedReferenceProperty
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
public CReferencePropertyInfo createDummyExtendedMixedReferenceProperty(
String defaultName, XSComponent source, RawTypeSet types) {
return createReferenceProperty(
defaultName,
false,
source,
types,
true,
true,
false,
true);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java
示例8: createContentExtendedMixedReferenceProperty
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
public CReferencePropertyInfo createContentExtendedMixedReferenceProperty(
String defaultName, XSComponent source, RawTypeSet types) {
return createReferenceProperty(
defaultName,
false,
source,
types,
true,
false,
true,
true);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java
示例9: createReferenceProperty
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
public CReferencePropertyInfo createReferenceProperty(
String defaultName, boolean forConstant, XSComponent source,
RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended) {
if (types == null) { // this is a special case where we need to generate content because potential subtypes would need to be able to override what's store inside
content = true;
} else {
if(!types.refs.isEmpty())
// if this property is empty, don't acknowleedge the customization
// this allows pointless property customization to be reported as an error
markAsAcknowledged();
}
constantPropertyErrorCheck();
String name = getPropertyName(forConstant);
if(name==null)
name = defaultName;
CReferencePropertyInfo prop = wrapUp(
new CReferencePropertyInfo(
name,
(types == null) ? true : types.getCollectionMode().isRepeated()||isMixed,
(types == null) ? false : types.isRequired(),
isMixed,
source,
getCustomizations(source), source.getLocator(), dummy, content, isMixedExtended),
source);
if (types != null) {
types.addTo(prop);
}
BIInlineBinaryData.handle(source, prop);
return prop;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:BIProperty.java
注:本文中的com.sun.tools.internal.xjc.model.CReferencePropertyInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论