1  /*
     2   * Copyright the original author or authors.
     3   * 
     4   * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   * 
     8   *      http://www.mozilla.org/MPL/MPL-1.1.html
     9   * 
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  import org.as2lib.data.type.Byte;
    18  import org.as2lib.io.file.SimpleTextFile;
    19  
    20  /**
    21   * {@code XmlFile} is implementation of {@code TextFile} for a xml resource.
    22   * 
    23   * @author Martin Heidegger
    24   * @version 1.0
    25   */
    26  class org.as2lib.io.file.XmlFile extends SimpleTextFile {
    27  	
    28  	/** Container Xml file. */
    29  	private var xml:XML;
    30  	
    31  	/**
    32  	 * Constructs a new {@code XmlFile}.
    33  	 * 
    34  	 * @param source content of the {@code XmlFile} to create
    35  	 * @param size size in {@link Byte} of the loaded resource
    36  	 * @param uri location of the loaded resource
    37  	 */
    38  	public function XmlFile(source:String, size:Byte, uri:String) {
    39  		super(source, size, uri);
    40  		xml = new XML();
    41  		xml.parseXML(source);
    42  	}
    43  	
    44  	/**
    45  	 * Returns the XML content in form of a proper accessable {@code XML} instance.
    46  	 * 
    47  	 * @return {@code XML} instance to access the XML content
    48  	 */
    49  	public function getXml(Void):XML {
    50  		return xml;
    51  	}
    52  }