Changeset 7435


Ignore:
Timestamp:
12/17/10 13:21:11 (9 years ago)
Author:
aivar
Message:

Refactored XMLHelper into XMLParser and XMLWriter. Worked on factories.

Location:
branches/maven/projects/deep-zoom-plugin/src/main/java/loci/workflow
Files:
4 added
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/maven/projects/deep-zoom-plugin/src/main/java/loci/workflow/IComponentFactory.java

    r7432 r7435  
    66package loci.workflow; 
    77 
     8import loci.util.xml.XMLException; 
     9 
    810/** 
    911 * 
     
    1214public interface IComponentFactory { 
    1315 
    14     public IComponent create(String xml); 
     16    /** 
     17     * Creates a component from XML. 
     18     * 
     19     * @param xml 
     20     * @return 
     21     */ 
     22    public IComponent create(String xml) throws XMLException; 
    1523} 
  • branches/maven/projects/deep-zoom-plugin/src/main/java/loci/workflow/WorkFlow.java

    r7432 r7435  
    66package loci.workflow; 
    77 
     8import loci.util.xml.XMLParser; 
     9import loci.util.xml.XMLWriter; 
     10import loci.util.xml.XMLException; 
     11import loci.util.xml.XMLTag; 
    812import java.lang.StringBuilder; 
    913import java.util.ArrayList; 
     
    2327 */ 
    2428public class WorkFlow implements IComponent, IWorkFlow { 
    25     static final String WORKFLOW = "workflow"; 
    26     static final String NAME = "name"; 
    27     static final String COMPONENTS = "components"; 
    28     static final String COMPONENT = "component"; 
    29     static final String CHAINS = "chains"; 
    30     static final String CHAIN = "chain"; 
    31     static final String DEST = "dest"; 
    32     static final String SRC = "src"; 
    33     static final String INPUTS = "inputs"; 
    34     static final String INPUT = "input"; 
    35     static final String OUTPUTS = "outputs"; 
    36     static final String OUTPUT = "output"; 
     29    public static final String WORKFLOW = "workflow"; 
     30    public static final String NAME = "name"; 
     31    public static final String COMPONENTS = "components"; 
     32    public static final String COMPONENT = "component"; 
     33    public static final String CHAINS = "chains"; 
     34    public static final String CHAIN = "chain"; 
     35    public static final String DEST = "dest"; 
     36    public static final String SRC = "src"; 
     37    public static final String INPUTS = "inputs"; 
     38    public static final String INPUT = "input"; 
     39    public static final String OUTPUTS = "outputs"; 
     40    public static final String OUTPUT = "output"; 
    3741 
    3842    static IComponentFactory s_componentFactory; 
     
    7680    public boolean fromXML(String xml) { 
    7781        boolean success = false; 
    78         XMLHelper xmlHelper = new XMLHelper(); 
     82        XMLParser xmlHelper = new XMLParser(); 
    7983 
    8084        try { 
     
    293297    } 
    294298     
    295     private ComponentAndName parseComponentAndName(XMLHelper xmlHelper, String xml) throws XMLException { 
     299    private ComponentAndName parseComponentAndName(XMLParser xmlHelper, String xml) throws XMLException { 
    296300        XMLTag tag = xmlHelper.getNextTag(xml); 
    297301        if (!COMPONENT.equals(tag.getName())) { 
     
    311315    public String toXML() { 
    312316        StringBuilder xmlBuilder = new StringBuilder(); 
    313         XMLHelper xmlHelper = new XMLHelper(xmlBuilder); 
     317        XMLWriter xmlHelper = new XMLWriter(xmlBuilder); 
    314318 
    315319        // add workflow tag and name 
Note: See TracChangeset for help on using the changeset viewer.