Search in sources :

Example 41 with IMicroElement

use of com.helger.xml.microdom.IMicroElement in project as2-server by phax.

the class XMLCommandRegistry method load.

public void load(@Nonnull final InputStream in) throws OpenAS2Exception {
    final IMicroDocument aDoc = MicroReader.readMicroXML(in);
    final IMicroElement eRoot = aDoc.getDocumentElement();
    clearCommands();
    for (final IMicroElement eElement : eRoot.getAllChildElements()) {
        final String sNodeName = eElement.getTagName();
        if (sNodeName.equals("command"))
            loadCommand(eElement, null);
        else if (sNodeName.equals("multicommand"))
            loadMultiCommand(eElement, null);
        else
            throw new OpenAS2Exception("Undefined tag: " + sNodeName);
    }
}
Also used : OpenAS2Exception(com.helger.as2lib.exception.OpenAS2Exception) IMicroElement(com.helger.xml.microdom.IMicroElement) IMicroDocument(com.helger.xml.microdom.IMicroDocument)

Aggregations

IMicroElement (com.helger.xml.microdom.IMicroElement)41 Nonnull (javax.annotation.Nonnull)30 MicroElement (com.helger.xml.microdom.MicroElement)18 IMicroDocument (com.helger.xml.microdom.IMicroDocument)7 OpenAS2Exception (com.helger.as2lib.exception.OpenAS2Exception)3 IReadableResource (com.helger.commons.io.resource.IReadableResource)3 File (java.io.File)3 CommandResult (com.helger.as2.cmd.CommandResult)2 XMLPartnershipFactory (com.helger.as2lib.partner.xml.XMLPartnershipFactory)2 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 IMicroNode (com.helger.xml.microdom.IMicroNode)2 MicroDocument (com.helger.xml.microdom.MicroDocument)2 Partnership (com.helger.as2lib.partner.Partnership)1 Partner (com.helger.as2lib.partner.xml.Partner)1 IMessageProcessor (com.helger.as2lib.processor.IMessageProcessor)1 ValueEnforcer (com.helger.commons.ValueEnforcer)1 Nonempty (com.helger.commons.annotation.Nonempty)1 ICommonsList (com.helger.commons.collection.impl.ICommonsList)1 DefaultHierarchyVisitorCallback (com.helger.commons.hierarchy.visit.DefaultHierarchyVisitorCallback)1 EHierarchyVisitorReturn (com.helger.commons.hierarchy.visit.EHierarchyVisitorReturn)1