本文整理汇总了Java中com.apple.internal.jobjc.generator.model.types.JType.JStruct类的典型用法代码示例。如果您正苦于以下问题:Java JStruct类的具体用法?Java JStruct怎么用?Java JStruct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JStruct类属于com.apple.internal.jobjc.generator.model.types.JType包,在下文中一共展示了JStruct类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: writeStructField
import com.apple.internal.jobjc.generator.model.types.JType.JStruct; //导入依赖的package包/类
private void writeStructField(final Struct.Field field, final PrintStream out){
if(field.type.getJType() == null || !(field.type.getJType() instanceof JStruct)){
out.println("\t// Found bad JavaType (" + field.type.getJType() + ") for field (" + field.name + ") of type (" + field.type + ")");
return;
}
String privName = field.name + "__";
String offsetName = field.name.toUpperCase() + "_OFFSET";
JStruct jstype = (JStruct) field.type.getJType();
String retTypeName = jstype.getJavaReturnTypeName();
out.println();
out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName() + ".IS64"
+ " ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");
out.println("\tprivate " + retTypeName + " " + privName + " = null;");
out.println("\tpublic " + retTypeName + " " + getterName(field) + "(){");
out.println("\t\tif(null==" + privName + "){");
out.println("\t\t\tthis.raw.position(" + offsetName + ");");
out.println("\t\t\t" + privName + " = " + RootJObjCClass.runtimeFrameworkInstR(struct.parent.name) + ".make" + jstype.struct.name + "(this.raw.slice());");
out.println("\t\t}");
out.println("\t\treturn " + privName + ";");
out.println("\t}");
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:StructClassFile.java
示例2: accept
import com.apple.internal.jobjc.generator.model.types.JType.JStruct; //导入依赖的package包/类
protected JType accept(Type type, NStruct nt32, NStruct nt64){
Struct st = TypeCache.inst().getStructForName(type.name);
return st != null ? new JStruct(st) : new JUnknown(type);
// TODO We could probably generate a struct here based on the type. But we need access to its parent framework.
// Maybe we could use a fallback anonymous struct, but we need the SIZEOF.
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:TypeToJType.java
示例3: StructCoderDescriptor
import com.apple.internal.jobjc.generator.model.types.JType.JStruct; //导入依赖的package包/类
public StructCoderDescriptor(JStruct jst) { this.jstruct = jst; }
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:2,代码来源:CoderDescriptor.java
注:本文中的com.apple.internal.jobjc.generator.model.types.JType.JStruct类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论