本文整理汇总了Java中com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty类的典型用法代码示例。如果您正苦于以下问题:Java BIProperty类的具体用法?Java BIProperty怎么用?Java BIProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BIProperty类属于com.sun.tools.internal.xjc.reader.xmlschema.bindinfo包,在下文中一共展示了BIProperty类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: build
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty; //导入依赖的package包/类
public void build(XSComplexType ct) {
XSContentType contentType = ct.getContentType();
builder.recordBindingMode(ct, FALLBACK_CONTENT);
BIProperty prop = BIProperty.getCustomization(ct);
CPropertyInfo p;
if(contentType.asEmpty()!=null) {
p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null);
} else {
RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false);
p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false);
}
selector.getCurrentBean().addProperty(p);
// adds attributes and we are through.
green.attContainer(ct);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:MultiWildcardComplexTypeBuilder.java
示例2: attributeUse
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty; //导入依赖的package包/类
/**
* Attribute use always becomes a property.
*/
public void attributeUse(XSAttributeUse use) {
boolean hasFixedValue = use.getFixedValue()!=null;
BIProperty pc = BIProperty.getCustomization(use);
// map to a constant property ?
boolean toConstant = pc.isConstantProperty() && hasFixedValue;
TypeUse attType = bindAttDecl(use.getDecl());
CPropertyInfo prop = pc.createAttributeProperty( use, attType );
if(toConstant) {
prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue());
prop.realization = builder.fieldRendererFactory.getConst(prop.realization);
} else
if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) {
// don't support a collection default value. That's difficult to do.
// primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases
if(use.getDefaultValue()!=null) {
// this attribute use has a default value.
// the item type is guaranteed to be a leaf type... or TODO: is it really so?
// don't support default values if it's a list
prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue());
} else
if(use.getFixedValue()!=null) {
prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue());
}
} else if(prop.baseType != null && prop.baseType.isPrimitive()) {
ErrorReporter errorReporter = Ring.get(ErrorReporter.class);
errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name());
}
getCurrentBean().addProperty(prop);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:BindPurple.java
示例3: getRefererCustomization
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty; //导入依赖的package包/类
/**
* Returns a javaType customization specified to the referer, if present.
* @return can be null.
*/
private BIConversion getRefererCustomization() {
BindInfo info = builder.getBindInfo(getReferer());
BIProperty prop = info.get(BIProperty.class);
if(prop==null) return null;
return prop.getConv();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SimpleTypeBuilder.java
示例4: createSimpleTypeProperty
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty; //导入依赖的package包/类
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) {
BIProperty prop = BIProperty.getCustomization(type);
SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
// since we are building the simple type here, use buildDef
CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type));
getCurrentBean().addProperty(p);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ColorBinder.java
示例5: getLocalPropCustomization
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty; //导入依赖的package包/类
/**
* Gets the BIProperty object that applies to the given particle.
*/
protected final BIProperty getLocalPropCustomization( XSParticle p ) {
return getLocalCustomization(p,BIProperty.class);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:ParticleBinder.java
示例6: computeLabel
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty; //导入依赖的package包/类
/**
* Computes the label of a given particle.
* Usually, the getLabel method should be used instead.
*/
protected final String computeLabel( XSParticle p ) {
// if the particle carries a customization, use that value.
// since we are binding content models, it's always non-constant properties.
BIProperty cust = getLocalPropCustomization(p);
if(cust!=null && cust.getPropertyName(false)!=null)
return cust.getPropertyName(false);
// no explicit property name is given. Compute one.
XSTerm t = p.getTerm();
// // first, check if a term is going to be a class, if so, use that name.
// ClassItem ci = owner.selector.select(t);
// if(ci!=null) {
// return makeJavaName(ci.getTypeAsDefined().name());
// }
// if it fails, compute the default name according to the spec.
if(t.isElementDecl())
// for element, take the element name.
return makeJavaName(p,t.asElementDecl().getName());
if(t.isModelGroupDecl())
// for named model groups, take that name
return makeJavaName(p,t.asModelGroupDecl().getName());
if(t.isWildcard())
// the spec says it will map to "any" by default.
return makeJavaName(p,"Any");
if(t.isModelGroup()) {
try {
return getSpecDefaultName(t.asModelGroup(),p.isRepeated());
} catch( ParseException e ) {
// unable to generate a name.
getErrorReporter().error(t.getLocator(),
Messages.ERR_UNABLE_TO_GENERATE_NAME_FROM_MODELGROUP);
return "undefined"; // recover from error by assuming something
}
}
// there are only four types of XSTerm.
throw new AssertionError();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:ParticleBinder.java
注:本文中的com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论