本文整理汇总了Java中com.sun.xml.internal.bind.api.impl.NameConverter.toPropertyName方法的典型用法代码示例。如果您正苦于以下问题:Java NameConverter.toPropertyName方法的具体用法?Java NameConverter.toPropertyName怎么用?Java NameConverter.toPropertyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.bind.api.impl.NameConverter
的用法示例。
在下文中一共展示了NameConverter.toPropertyName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAttributeProperty
import com.sun.xml.internal.bind.api.impl.NameConverter; //导入方法依赖的package包/类
public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) {
boolean forConstant =
getCustomization(use).isConstantProperty() &&
use.getFixedValue()!=null;
String name = getPropertyName(forConstant);
if(name==null) {
NameConverter conv = getBuilder().getNameConverter();
if(forConstant)
name = conv.toConstantName(use.getDecl().getName());
else
name = conv.toPropertyName(use.getDecl().getName());
if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode())
name = JJavaName.getPluralForm(name);
}
markAsAcknowledged();
constantPropertyErrorCheck();
return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(),
BGMBuilder.getName(use.getDecl()), tu,
BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use);
}
示例2: getPropertyName
import com.sun.xml.internal.bind.api.impl.NameConverter; //导入方法依赖的package包/类
/**
* Returns the customized property name.
*
* This method honors the "enableJavaNamingConvention" customization
* and formats the property name accordingly if necessary.
*
* Thus the caller should <em>NOT</em> apply the XML-to-Java name
* conversion algorithm to the value returned from this method.
*
* @param forConstant
* If the property name is intended for a constant property name,
* set to true. This will change the result
*
* @return
* This method can return null if the customization doesn't
* specify the name.
*/
public String getPropertyName( boolean forConstant ) {
if(name!=null) {
BIGlobalBinding gb = getBuilder().getGlobalBinding();
NameConverter nc = getBuilder().model.getNameConverter();
if( gb.isJavaNamingConventionEnabled() && !forConstant )
// apply XML->Java conversion
return nc.toPropertyName(name);
else
return name; // ... or don't change the value
}
BIProperty next = getDefault();
if(next!=null) return next.getPropertyName(forConstant);
else return null;
}