< prev index next >
src/java.base/share/classes/java/nicl/types/LayoutType.java
Print this page
@@ -33,11 +33,11 @@
import java.nicl.layout.Group;
import java.nicl.layout.Layout;
import java.nicl.layout.Sequence;
import java.lang.invoke.MethodHandle;
-import java.nicl.metadata.NativeType;
+import java.nicl.metadata.NativeStruct;
/**
* This class describes the relationship between a memory layout (usually described in bits) and a Java carrier
* (e.g. {@code int}, {@code long}, or any Java reference type. A {@code LayoutType} defines operation for getting/setting
* the layout contents using a given Java carrier (see {@link LayoutType#getter()} and {@link LayoutType#setter()}).
@@ -217,16 +217,16 @@
/**
* Create a {@code LayoutType} from a {@link Struct} interface carrier.
* @param <T> the struct type.
* @param carrier the struct carrier.
* @return the {@code LayoutType}.
- * @throws IllegalArgumentException if the given carrier is not annotated with the {@link java.nicl.metadata.NativeType} annotation.
+ * @throws IllegalArgumentException if the given carrier is not annotated with the {@link java.nicl.metadata.NativeStruct} annotation.
*/
public static <T extends Struct<T>> LayoutType<T> ofStruct(Class<T> carrier) throws IllegalArgumentException {
- NativeType nativeStruct = carrier.getAnnotation(NativeType.class);
+ NativeStruct nativeStruct = carrier.getAnnotation(NativeStruct.class);
if (nativeStruct == null) {
throw new IllegalArgumentException("Not a struct type!");
}
- Group type = (Group) new DescriptorParser(nativeStruct.layout()).parseLayout().findFirst().get();
+ Group type = (Group) new DescriptorParser(nativeStruct.value()).parseLayout().findFirst().get();
return new LayoutType<>(type, References.ofStruct(carrier));
}
}
< prev index next >