use of org.eclipse.kapua.commons.configuration.metatype.ToptionImpl in project kapua by eclipse.
the class TranslatorAppConfigurationKapuaKura method translate.
private KapuaTocd translate(KapuaTocd kapuaDefinition) {
TocdImpl definition = new TocdImpl();
definition.setId(kapuaDefinition.getId());
definition.setName(kapuaDefinition.getName());
definition.setDescription(kapuaDefinition.getDescription());
for (KapuaTad kapuaAd : kapuaDefinition.getAD()) {
TadImpl ad = new TadImpl();
ad.setCardinality(kapuaAd.getCardinality());
ad.setDefault(ad.getDefault());
ad.setDescription(kapuaAd.getDescription());
ad.setId(kapuaAd.getId());
ad.setMax(kapuaAd.getMax());
ad.setMin(kapuaAd.getMin());
ad.setName(kapuaAd.getName());
ad.setType(kapuaAd.getType());
ad.setRequired(kapuaAd.isRequired());
for (KapuaToption kuraToption : kapuaAd.getOption()) {
ToptionImpl kapuaToption = new ToptionImpl();
kapuaToption.setLabel(kuraToption.getLabel());
kapuaToption.setValue(kuraToption.getValue());
ad.addOption(kapuaToption);
}
for (Entry<QName, String> entry : kapuaAd.getOtherAttributes().entrySet()) {
ad.putOtherAttribute(entry.getKey(), entry.getValue());
}
definition.addAD(ad);
}
for (KapuaTicon kapuaIcon : kapuaDefinition.getIcon()) {
KapuaTicon icon = new TiconImpl();
icon.setResource(kapuaIcon.getResource());
icon.setSize(kapuaIcon.getSize());
definition.addIcon(icon);
}
for (Object kapuaAny : kapuaDefinition.getAny()) {
definition.addAny(kapuaAny);
}
for (Entry<QName, String> entry : kapuaDefinition.getOtherAttributes().entrySet()) {
definition.putOtherAttribute(entry.getKey(), entry.getValue());
}
return definition;
}
use of org.eclipse.kapua.commons.configuration.metatype.ToptionImpl in project kapua by eclipse.
the class TranslatorAppConfigurationKuraKapua method translate.
private KapuaTocd translate(KapuaTocd kuraDefinition) {
TocdImpl definition = new TocdImpl();
definition.setId(kuraDefinition.getId());
definition.setName(kuraDefinition.getName());
definition.setDescription(kuraDefinition.getDescription());
for (KapuaTad kuraAd : kuraDefinition.getAD()) {
TadImpl ad = new TadImpl();
ad.setCardinality(kuraAd.getCardinality());
ad.setDefault(ad.getDefault());
ad.setDescription(kuraAd.getDescription());
ad.setId(kuraAd.getId());
ad.setMax(kuraAd.getMax());
ad.setMin(kuraAd.getMin());
ad.setName(kuraAd.getName());
ad.setType(kuraAd.getType());
ad.setRequired(kuraAd.isRequired());
for (KapuaToption kuraToption : kuraAd.getOption()) {
ToptionImpl kapuaToption = new ToptionImpl();
kapuaToption.setLabel(kuraToption.getLabel());
kapuaToption.setValue(kuraToption.getValue());
ad.addOption(kapuaToption);
}
for (Entry<QName, String> entry : kuraAd.getOtherAttributes().entrySet()) {
ad.putOtherAttribute(entry.getKey(), entry.getValue());
}
definition.addAD(ad);
}
for (KapuaTicon kuraIcon : kuraDefinition.getIcon()) {
KapuaTicon icon = new TiconImpl();
icon.setResource(kuraIcon.getResource());
icon.setSize(kuraIcon.getSize());
definition.addIcon(icon);
}
for (Object kuraAny : kuraDefinition.getAny()) {
definition.addAny(kuraAny);
}
for (Entry<QName, String> entry : kuraDefinition.getOtherAttributes().entrySet()) {
definition.putOtherAttribute(entry.getKey(), entry.getValue());
}
return definition;
}
Aggregations