net.anotheria.anosite.gen.asfederateddata.data.GuardDefXMLHelper Maven / Gradle / Ivy
/**
********************************************************************************
*** GuardDefXMLHelper.java ***
*** generated by AnoSiteGenerator (ASG), Version: 3.2.2 ***
*** Copyright (C) 2005 - 2023 Anotheria.net, www.anotheria.net ***
*** All Rights Reserved. ***
********************************************************************************
*** Don't edit this code, if you aren't sure ***
*** that you do exactly know what you are doing! ***
*** It's better to invest time in the generator, as into the generated code. ***
********************************************************************************
*/
package net.anotheria.anosite.gen.asfederateddata.data;
import net.anotheria.util.xml.XMLNode;
import net.anotheria.util.xml.XMLAttribute;
import net.anotheria.asg.data.XMLHelper;
import net.anotheria.asg.data.MultilingualObject;
public class GuardDefXMLHelper{
public static final String[] LANGUAGES = new String[]{"EN","DE"};
private static XMLNode _toXML(GuardDef object, String[] languages){
XMLNode ret = new XMLNode("GuardDef");
ret.addAttribute(new XMLAttribute("id", object.getId()));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("name", null, object.getName() ));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("clazz", null, object.getClazz() ));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("parameter1", null, object.getParameter1() ));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("parameter2", null, object.getParameter2() ));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("parameter3", null, object.getParameter3() ));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("parameter4", null, object.getParameter4() ));
ret.addChildNode(XMLHelper.createXMLNodeForStringValue("parameter5", null, object.getParameter5() ));
ret.addChildNode(XMLHelper.createXMLNodeForTextValue("description", null, object.getDescription() ));
if(object instanceof MultilingualObject){
MultilingualObject multilangDoc = (MultilingualObject) object;
ret.addChildNode(XMLHelper.createXMLNodeForBooleanValue("multilingualDisabled", null, multilangDoc.isMultilingualDisabledInstance()));
}
return ret;
}
public static XMLNode toXML(GuardDef object){
return _toXML(object, LANGUAGES);
}
public static XMLNode toXML(GuardDef object, String... languages){
if (languages==null || languages.length==0)
return toXML(object);
return _toXML(object, languages);
}
public static GuardDef fromXML(XMLNode node){
return null;
}
}