本文整理汇总了Java中com.sun.tools.internal.xjc.model.CElementPropertyInfo类的典型用法代码示例。如果您正苦于以下问题:Java CElementPropertyInfo类的具体用法?Java CElementPropertyInfo怎么用?Java CElementPropertyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CElementPropertyInfo类属于com.sun.tools.internal.xjc.model包,在下文中一共展示了CElementPropertyInfo类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: annotate
import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入依赖的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
示例2: calcDrilldown
import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入依赖的package包/类
public final List<Property> calcDrilldown() {
CElementPropertyInfo p = clazz.getProperty();
if(p.getAdapter()!=null)
return null; // if adapted, avoid drill down
if(p.isCollection())
// things like <xs:element name="foo" type="xs:NMTOKENS" /> is not eligible.
return null;
CTypeInfo typeClass = p.ref().get(0);
if(!(typeClass instanceof CClassInfo))
// things like <xs:element name="foo" type="xs:string" /> is not eligible.
return null;
CClassInfo ci = (CClassInfo)typeClass;
// if the type is abstract we can't use it.
if(ci.isAbstract())
return null;
// the 'all' compositor doesn't qualify
if(!ci.isOrdered())
return null;
return buildDrilldown(ci);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:ElementMappingImpl.java
示例3: createElementProperty
import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入依赖的package包/类
/**
*
*
* @param defaultName
* If the name is not customized, this name will be used
* as the default. Note that the name conversion <b>MUST</b>
* be applied before this method is called if necessary.
* @param source
* Source schema component from which a field is built.
*/
public CElementPropertyInfo createElementProperty(String defaultName, boolean forConstant, XSParticle source,
RawTypeSet types) {
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;
CElementPropertyInfo prop = wrapUp(
new CElementPropertyInfo(
name, types.getCollectionMode(),
types.id(),
types.getExpectedMimeType(),
source, getCustomizations(source),
source.getLocator(), types.isRequired()),
source);
types.addTo(prop);
BIInlineBinaryData.handle(source.getTerm(), prop);
return prop;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:BIProperty.java
示例4: toTypeRef
import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入依赖的package包/类
protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
assert !target.isCollection();
CAdapter a = target.getProperty().getAdapter();
if(a!=null && ep!=null) ep.setAdapter(a);
return new CTypeRef(target.getContentType(),decl);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:RawTypeSetBuilder.java
示例5: canBeType
import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入依赖的package包/类
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
// if element substitution can occur, no way it can be mapped to a list of types
if(decl.getSubstitutables().size()>1)
return RawTypeSet.Mode.MUST_BE_REFERENCE;
// BIXSubstitutable also simulates this effect. Useful for separate compilation
BIXSubstitutable subst = builder.getBindInfo(decl).get(BIXSubstitutable.class);
if(subst!=null) {
subst.markAsAcknowledged();
return RawTypeSet.Mode.MUST_BE_REFERENCE;
}
// we have no place to put an adater if this thing maps to a type
CElementPropertyInfo p = target.getProperty();
// if we have an adapter or IDness, which requires special
// annotation, and there's more than one element,
// we have no place to put the special annotation, so we need JAXBElement.
if((parent.refs.size()>1 || !parent.mul.isAtMostOnce()) && p.id()!=ID.NONE)
return RawTypeSet.Mode.MUST_BE_REFERENCE;
if(parent.refs.size() > 1 && p.getAdapter() != null)
return RawTypeSet.Mode.MUST_BE_REFERENCE;
if(target.hasClass())
// if the CElementInfo was explicitly bound to a class (which happen if and only if
// the user requested so, then map that to reference property so that the user sees a class
return RawTypeSet.Mode.CAN_BE_TYPEREF;
else
return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:RawTypeSetBuilder.java
示例6: addTo
import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入依赖的package包/类
public void addTo(CElementPropertyInfo prop) {
assert canBeTypeRefs!= Mode.MUST_BE_REFERENCE;
if(mul.isZero())
return; // the property can't have any value
List<CTypeRef> dst = prop.getTypes();
for( Ref t : refs )
dst.add(t.toTypeRef(prop));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:RawTypeSet.java
注:本文中的com.sun.tools.internal.xjc.model.CElementPropertyInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论