public void loadConfig()

in src/com/intellij/idea/plugin/hybris/system/type/model/generator/ModelGen.java [75:141]


    public void loadConfig(final Element element) {
        final Element namespaceEl = element.getChild("namespaces");
        for (Element e : namespaceEl.getChildren("schemaLocation")) {
            final String name = e.getAttributeValue("name");
            final String file = e.getAttributeValue("file");
            schemaLocationMap.put(name, file);
        }
        for (Element e : namespaceEl.getChildren("reserved-name")) {
            final String name = e.getAttributeValue("name");
            final String replacement = e.getAttributeValue("replace-with");
            model.name2replaceMap.put(name, replacement);
        }
        NamespaceDesc def = new NamespaceDesc("", "generated", "java.lang.Object", "", null, null, null, null);
        for (Element nsElement : namespaceEl.getChildren("namespace")) {
            final String name = nsElement.getAttributeValue("name");
            final NamespaceDesc nsDesc = new NamespaceDesc(name, def);

            final String skip = nsElement.getAttributeValue("skip");
            final String prefix = nsElement.getAttributeValue("prefix");
            final String superC = nsElement.getAttributeValue("super");
            final String imports = nsElement.getAttributeValue("imports");
            final String packageS = nsElement.getAttributeValue("package");
            final String packageEnumS = nsElement.getAttributeValue("enums");
            final String interfaces = nsElement.getAttributeValue("interfaces");
            final ArrayList<String> list = new ArrayList<>();
            for (Element pkgElement : nsElement.getChildren("package")) {
                final String pkgName = pkgElement.getAttributeValue("name");
                final String fileName = pkgElement.getAttributeValue("file");
                list.add(fileName);
                list.add(pkgName);
            }
            for (Element pkgElement : nsElement.getChildren("property")) {
                final String propertyName = pkgElement.getAttributeValue("name");
                final String propertyValue = pkgElement.getAttributeValue("value");
                nsDesc.props.put(propertyName, propertyValue);
            }

            if (skip != null) {
                nsDesc.skip = skip.equalsIgnoreCase("true");
            }
            if (prefix != null) {
                nsDesc.prefix = prefix;
            }
            if (superC != null) {
                nsDesc.superClass = superC;
            }
            if (imports != null) {
                nsDesc.imports = imports;
            }
            if (packageS != null) {
                nsDesc.pkgName = packageS;
            }
            if (packageEnumS != null) {
                nsDesc.enumPkg = packageEnumS;
            }
            if (interfaces != null) {
                nsDesc.intfs = interfaces;
            }
            if (!list.isEmpty()) {
                nsDesc.pkgNames = ArrayUtil.toStringArray(list);
            }
            if (name.length() == 0) {
                def = nsDesc;
            }
            model.nsdMap.put(name, nsDesc);
        }
    }