View Javadoc
1   /*
2    * reserved comment block
3    * DO NOT REMOVE OR ALTER!
4    */
5   /*
6    * Copyright 1999-2004 The Apache Software Foundation.
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   */
20  /*
21   * $Id: XMLStringFactory.java,v 1.2.4.1 2005/09/15 08:16:03 suresh_emailid Exp $
22   */
23  package com.sun.org.apache.xml.internal.utils;
24  
25  /**
26   * A concrete class that implements this interface creates XMLString objects.
27   */
28  public abstract class XMLStringFactory
29  {
30  
31    /**
32     * Create a new XMLString from a Java string.
33     *
34     *
35     * @param string Java String reference, which must be non-null.
36     *
37     * @return An XMLString object that wraps the String reference.
38     */
39    public abstract XMLString newstr(String string);
40  
41    /**
42     * Create a XMLString from a FastStringBuffer.
43     *
44     *
45     * @param string FastStringBuffer reference, which must be non-null.
46     * @param start The start position in the array.
47     * @param length The number of characters to read from the array.
48     *
49     * @return An XMLString object that wraps the FastStringBuffer reference.
50     */
51    public abstract XMLString newstr(FastStringBuffer string, int start,
52                                     int length);
53  
54    /**
55     * Create a XMLString from a FastStringBuffer.
56     *
57     *
58     * @param string FastStringBuffer reference, which must be non-null.
59     * @param start The start position in the array.
60     * @param length The number of characters to read from the array.
61     *
62     * @return An XMLString object that wraps the FastStringBuffer reference.
63     */
64    public abstract XMLString newstr(char[] string, int start,
65                                     int length);
66  
67    /**
68     * Get a cheap representation of an empty string.
69     *
70     * @return An non-null reference to an XMLString that represents "".
71     */
72    public abstract XMLString emptystr();
73  }