String language) {
/* startswith oder endswith */
List<? extends Metadata> alleMetadaten = myStruct.getAllMetadataByType(mdt);
if (alleMetadaten != null && alleMetadaten.size() > 0) {
for (Iterator<? extends Metadata> iter = alleMetadaten.iterator(); iter.hasNext();) {
Metadata md = iter.next();
/* prüfen, ob es mit korrekten Werten beginnt */
if (prop_startswith != null) {
boolean isOk = false;
StringTokenizer tokenizer = new StringTokenizer(prop_startswith, "|");
while (tokenizer.hasMoreTokens()) {
String tok = tokenizer.nextToken();
if (md.getValue() != null && md.getValue().startsWith(tok)) {
isOk = true;
}
}
if (!isOk && !this.autoSave) {
inFehlerList.add(md.getType().getNameByLanguage(language) + " " + Helper.getTranslation("MetadataWithValue") + " "
+ md.getValue() + " " + Helper.getTranslation("MetadataDoesNotStartWith") + " " + prop_startswith);
}
if (!isOk && this.autoSave) {
md.setValue(new StringTokenizer(prop_startswith, "|").nextToken() + md.getValue());
}
}
/* prüfen, ob es mit korrekten Werten endet */
if (prop_endswith != null) {
boolean isOk = false;
StringTokenizer tokenizer = new StringTokenizer(prop_endswith, "|");
while (tokenizer.hasMoreTokens()) {
String tok = tokenizer.nextToken();
if (md.getValue() != null && md.getValue().endsWith(tok)) {
isOk = true;
}
}
if (!isOk && !this.autoSave) {
inFehlerList.add(md.getType().getNameByLanguage(language) + " " + Helper.getTranslation("MetadataWithValue") + " "
+ md.getValue() + " " + Helper.getTranslation("MetadataDoesNotEndWith") + " " + prop_endswith);
}
if (!isOk && this.autoSave) {
md.setValue(md.getValue() + new StringTokenizer(prop_endswith, "|").nextToken());
}
}
}
}
}