
com.mindoo.domino.jna.internal.FieldPropAdaptable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-jna Show documentation
Show all versions of domino-jna Show documentation
Java project to access the HCL Domino C API using Java Native Access (JNA)
package com.mindoo.domino.jna.internal;
import com.mindoo.domino.jna.IAdaptable;
import com.mindoo.domino.jna.internal.structs.compoundtext.IFieldHtmlPropsProvider;
import com.mindoo.domino.jna.internal.structs.compoundtext.NotesCDFieldStruct;
import com.sun.jna.Memory;
public class FieldPropAdaptable implements IAdaptable, IFieldHtmlPropsProvider {
private Memory m_fieldRecordWithHeader;
private Memory m_idNameCDRecord;
public FieldPropAdaptable(Memory fieldRecordWithHeader, Memory idNameCDRecord) {
m_fieldRecordWithHeader = fieldRecordWithHeader;
m_idNameCDRecord = idNameCDRecord;
}
@Override
public T getAdapter(Class clazz) {
if (clazz == NotesCDFieldStruct.class && m_fieldRecordWithHeader!=null) {
NotesCDFieldStruct fieldStruct = NotesCDFieldStruct.newInstance(m_fieldRecordWithHeader);
fieldStruct.read();
return (T) fieldStruct;
}
else if (clazz == IFieldHtmlPropsProvider.class) {
return (T) this;
}
return null;
}
@Override
public Memory getCDRecordWithHeaderAndIDNameStruct() {
return m_idNameCDRecord;
}
@Override
public Memory getCDRecordWithHeaderAndFieldStruct() {
return m_fieldRecordWithHeader;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy