public class AqdefObjectModelBuilder extends Object
AqdefObjectModel.
AqdefObjectModelBuilder builder = new AqdefObjectModelBuilder();
builder.createPartEntry("K1001", "part number");
builder.createPartEntry("K1002", "part title");
for (int i = 0; i <= 2; i++) {
builder.createCharacteristicEntry("K2001", "characteristic number " + i);
for (int j = 0; j <= 2; j++) {
builder.createValueEntry("K0001", new BigDecimal(j));
builder.createValueEntry("K0004", new Date());
builder.nextValue();
}
builder.nextCharacteristic();
}
AqdefObjectModel objectModel = builder.build();
Don't forget to call nextPart(), nextCharacteristic(), nextValue() before you start writing new
record.
| Constructor and Description |
|---|
AqdefObjectModelBuilder() |
| Modifier and Type | Method and Description |
|---|---|
AqdefObjectModel |
build() |
void |
createCharacteristicEntry(KKey key,
Object value) |
void |
createCharacteristicEntry(String key,
Object value) |
void |
createGroupEntry(KKey key,
Object value) |
void |
createGroupEntry(String key,
Object value) |
void |
createHierarchyNodeOfCharacteristic(int characteristicId,
Integer parentCharacteristicId) |
void |
createHierarchyNodeOfGroup(int characteristicId,
Integer parentCharacteristicId) |
void |
createHierarchyNodeOfPart() |
void |
createPartEntry(KKey key,
Object value) |
void |
createPartEntry(String key,
Object value) |
void |
createValueEntry(KKey key,
Object value) |
void |
createValueEntry(String key,
Object value) |
void |
nextCharacteristic()
You have to call this method after all data of current characteristic (and its values) are written.
|
void |
nextGroup()
You have to call this method after all data of current group are written.
|
void |
nextPart()
You have to call this method after all data of current part (and its characteristics and values) are written.
|
void |
nextValue()
You have to call this method after all data of current value are written.
|
void |
replaceCharacteristicEntry(String key,
int partIndex,
int characteristicIndex,
Object value)
Replaces value of a given K-key with a new value for:
single characteristic of a single part if both
partIndex and characteristicIndex are provided
single characteristic of all parts if partIndex = 0 and characteristicIndex > 0
all characteristics of single part if partIndex > 0 and characteristicIndex = 0
all characteristics of all parts if partIndex = 0 and characteristicIndex = 0
|
void |
replacePartEntry(String key,
int index,
Object value)
Replaces value of a given K-key with a new value for a single part
identified by the part
index or for all parts if index is 0. |
public AqdefObjectModel build()
public void replacePartEntry(String key, int index, Object value)
index or for all parts if index is 0.
If the K-key doesn't have value, it will be added.
key - index - of part whose value will be replaced or 0value - new valuepublic void replaceCharacteristicEntry(String key, int partIndex, int characteristicIndex, Object value)
partIndex and characteristicIndex are providedpartIndex = 0 and characteristicIndex > 0partIndex > 0 and characteristicIndex = 0partIndex = 0 and characteristicIndex = 0If the K-key doesn't have value, it will be added.
key - partIndex - characteristicIndex - value - public void createHierarchyNodeOfPart()
public void createHierarchyNodeOfCharacteristic(int characteristicId,
Integer parentCharacteristicId)
public void createHierarchyNodeOfGroup(int characteristicId,
Integer parentCharacteristicId)
public void nextPart()
public void nextCharacteristic()
public void nextValue()
public void nextGroup()
Copyright © 2019. All rights reserved.