本文整理了Java中com.sun.codemodel.JClass.getPrimitiveType()
方法的一些代码示例,展示了JClass.getPrimitiveType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JClass.getPrimitiveType()
方法的具体详情如下:
包路径:com.sun.codemodel.JClass
类名称:JClass
方法名:getPrimitiveType
[英]If this class represents one of the wrapper classes defined in the java.lang package, return the corresponding primitive type. Otherwise null.
[中]如果该类表示java中定义的包装器类之一。lang包,返回相应的基元类型。否则为空。
代码示例来源:origin: sun-jaxb/jaxb-xjc
public JType unboxify() {
JPrimitiveType pt = getPrimitiveType();
return pt==null ? (JType)this : pt;
}
代码示例来源:origin: javaee/jaxb-v2
public JType unboxify() {
JPrimitiveType pt = getPrimitiveType();
return pt==null ? (JType)this : pt;
}
代码示例来源:origin: com.sun.codemodel/codemodel
public JType unboxify() {
JPrimitiveType pt = getPrimitiveType();
return pt==null ? (JType)this : pt;
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
public boolean isBoxedType() {
return clazz.getPrimitiveType()!=null;
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
public JType unboxify() {
JPrimitiveType pt = getPrimitiveType();
return pt==null ? (JType)this : pt;
}
代码示例来源:origin: com.unquietcode.tools.jcodemodel/codemodel
public JType unboxify() {
JPrimitiveType pt = getPrimitiveType();
return pt==null ? (JType)this : pt;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc
public boolean isBoxedType() {
return clazz.getPrimitiveType()!=null;
}
代码示例来源:origin: highsource/hyperjaxb3
protected String getGetterName() {
return (exposedType.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get")
+ prop.getName(true);
}
代码示例来源:origin: org.jvnet.hyperjaxb3/hyperjaxb3-ejb-plugin
protected String getGetterName() {
return (exposedType.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get")
+ prop.getName(true);
}
代码示例来源:origin: org.jvnet.jaxb2_commons/jaxb2-basics-tools
protected String getGetterMethodName() {
return (type.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get") + propertyInfo.getPublicName();
}
代码示例来源:origin: sun-jaxb/jaxb-xjc
protected JType getType(Aspect aspect) {
return super.getType(aspect).boxify().getPrimitiveType();
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
protected JType getType(Aspect aspect) {
return super.getType(aspect).boxify().getPrimitiveType();
}
代码示例来源:origin: org.jvnet.hyperjaxb3/hyperjaxb3-ejb-plugin
protected String getGetterName() {
return (getFieldType().boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get")
+ prop.getName(true);
}
代码示例来源:origin: org.jvnet.hyperjaxb3/hyperjaxb3-ejb-plugin
/**
* Gets the name of the getter method.
*
* <p>
* This encapsulation is necessary because sometimes we use
* {@code isXXXX} as the method name.
*/
protected String getGetterMethod() {
return (getFieldType().boxify().getPrimitiveType()==codeModel.BOOLEAN?"is":"get")+prop.getName(true);
}
代码示例来源:origin: highsource/hyperjaxb3
protected String getGetterName() {
return (getFieldType().boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get")
+ prop.getName(true);
}
代码示例来源:origin: org.jvnet.hyperjaxb3/hyperjaxb3-ejb-plugin
protected String getGetterName() {
return (getFieldType().boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get")
+ prop.getName(true);
}
代码示例来源:origin: highsource/hyperjaxb3
protected String getGetterName() {
return (getFieldType().boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is"
: "get")
+ prop.getName(true);
}
代码示例来源:origin: highsource/hyperjaxb3
/**
* Gets the name of the getter method.
*
* <p>
* This encapsulation is necessary because sometimes we use
* {@code isXXXX} as the method name.
*/
protected String getGetterMethod() {
return (getFieldType().boxify().getPrimitiveType()==codeModel.BOOLEAN?"is":"get")+prop.getName(true);
}
代码示例来源:origin: Evolveum/midpoint
public static String getGetterMethodName(ClassOutline classOutline, JFieldVar field) {
CPropertyInfo prop = classOutline.target.getProperty(field.name());
JType type = field.type();
Options options = classOutline.parent().getModel().options;
JCodeModel codeModel = classOutline.parent().getCodeModel();
if (options.enableIntrospection) {
return ((type.isPrimitive() && type.boxify().getPrimitiveType() == codeModel.BOOLEAN) ?
"is" : "get") + prop.getName(true);
} else {
return (type.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is" : "get") + prop.getName(true);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc
ConstField( ClassOutlineImpl outline, CPropertyInfo prop ) {
super(outline,prop);
// we only support value constraints for a single-value property.
assert !prop.isCollection();
JPrimitiveType ptype = implType.boxify().getPrimitiveType();
// generate the constant
JExpression defaultValue = null;
if(prop.defaultValue!=null)
defaultValue = prop.defaultValue.compute(outline.parent());
$ref = outline.ref.field(JMod.PUBLIC|JMod.STATIC|JMod.FINAL,
ptype!=null?ptype:implType, prop.getName(true), defaultValue );
$ref.javadoc().append(prop.javadoc);
annotate($ref);
}
内容来源于网络,如有侵权,请联系作者删除!