Examples of HierarchyWrapper


Examples of sortpom.wrapper.operation.HierarchyWrapper

        if (sortAlfabeticalOnly) {
            wrapperFactory = new WrapperFactory() {

                @Override
                public HierarchyWrapper createFromRootElement(final Element rootElement) {
                    return new HierarchyWrapper(new AlphabeticalSortedWrapper(rootElement));
                }

                @SuppressWarnings("unchecked")
                @Override
                public <T extends Content> Wrapper<T> create(final T content) {
View Full Code Here

Examples of sortpom.wrapper.operation.HierarchyWrapper

    /** Creates a new dom document that contains the sorted xml. */
    public void sortXml() {
        newDocument = (Document) originalDocument.clone();
        final Element rootElement = (Element) originalDocument.getRootElement().clone();

        HierarchyWrapper rootWrapper = factory.createFromRootElement(rootElement);

        rootWrapper.createWrappedStructure(factory);
        rootWrapper.detachStructure();
        rootWrapper.sortStructureAttributes();
        rootWrapper.sortStructureElements();
        rootWrapper.connectXmlStructure();

        newDocument.setRootElement(rootWrapper.getElementContent().getContent());
    }
View Full Code Here

Examples of sortpom.wrapper.operation.HierarchyWrapper

    }

    /** @see WrapperFactory#createFromRootElement(org.jdom.Element) */
    public HierarchyWrapper createFromRootElement(final Element rootElement) {
        initializeSortOrderMap();
        return new HierarchyWrapper(create((Content) rootElement));
    }
View Full Code Here

Examples of sortpom.wrapper.operation.HierarchyWrapper

        SAXBuilder parser = new SAXBuilder();
        Document document = parser.build(new ByteArrayInputStream(xml.getBytes(UTF_8)));

        WrapperFactoryImpl wrapperFactory = new WrapperFactoryImpl(fileUtil);
        wrapperFactory.setup(pluginParameters);
        HierarchyWrapper rootWrapper = wrapperFactory.createFromRootElement(document.getRootElement());
        rootWrapper.createWrappedStructure(wrapperFactory);

        return rootWrapper.toString();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.