~ubuntu-branches/ubuntu/utopic/jing-trang/utopic

« back to all changes in this revision

Viewing changes to mod/dtd-parse/src/main/com/thaiopensource/xml/em/OpenEntity.java

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Thibault
  • Date: 2009-09-01 15:53:03 UTC
  • Revision ID: james.westby@ubuntu.com-20090901155303-2kweef05h5v9j3ni
Tags: upstream-20090818
ImportĀ upstreamĀ versionĀ 20090818

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.thaiopensource.xml.em;
 
2
 
 
3
import java.io.Reader;
 
4
 
 
5
/**
 
6
 * Information about an open external entity.
 
7
 * This is used to by <code>EntityManager</code> to return
 
8
 * information about an external entity that is has opened.
 
9
 * @see EntityManager
 
10
 */
 
11
public class OpenEntity {
 
12
  private final Reader reader;
 
13
  private final String baseUri;
 
14
  private final String location;
 
15
  private final String encoding;
 
16
 
 
17
  /**
 
18
   * Creates and initializes an <code>OpenEntity</code>. which uses
 
19
   */
 
20
  public OpenEntity(Reader reader, String location, String baseUri, String encoding) {
 
21
    this.reader = reader;
 
22
    this.location = location;
 
23
    this.baseUri = baseUri;
 
24
    this.encoding = encoding;
 
25
  }
 
26
 
 
27
  /**
 
28
   * Returns an Reader containing the entity's bytes.
 
29
   * If this is called more than once on the same
 
30
   * OpenEntity, it will return the same Reader.
 
31
   */
 
32
  public final Reader getReader() {
 
33
    return reader;
 
34
  }
 
35
 
 
36
  /**
 
37
   * Returns the URI to use as the base URI for resolving relative URIs
 
38
   * contained in the entity.
 
39
   */
 
40
  public final String getBaseUri() {
 
41
    return baseUri;
 
42
  }
 
43
 
 
44
  /**
 
45
   * Returns a string representation of the location of the entity
 
46
   * suitable for use in error messages.
 
47
   */
 
48
  public final String getLocation() {
 
49
    return location;
 
50
  }
 
51
 
 
52
  /**
 
53
   * Returns the encoding used by the entity or null if the encoding
 
54
   * that was used is unknown.
 
55
   */
 
56
  public final String getEncoding() {
 
57
    return encoding;
 
58
  }
 
59
 
 
60
}