1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
  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. * $Id: XMLStringFactory.java,v 1.4 2004/02/17 04:21:14 minchau Exp $
  18. */
  19. package com.sun.org.apache.xml.internal.utils;
  20. /**
  21. * A concrete class that implements this interface creates XMLString objects.
  22. */
  23. public abstract class XMLStringFactory
  24. {
  25. /**
  26. * Create a new XMLString from a Java string.
  27. *
  28. *
  29. * @param string Java String reference, which must be non-null.
  30. *
  31. * @return An XMLString object that wraps the String reference.
  32. */
  33. public abstract XMLString newstr(String string);
  34. /**
  35. * Create a XMLString from a FastStringBuffer.
  36. *
  37. *
  38. * @param string FastStringBuffer reference, which must be non-null.
  39. * @param start The start position in the array.
  40. * @param length The number of characters to read from the array.
  41. *
  42. * @return An XMLString object that wraps the FastStringBuffer reference.
  43. */
  44. public abstract XMLString newstr(FastStringBuffer string, int start,
  45. int length);
  46. /**
  47. * Create a XMLString from a FastStringBuffer.
  48. *
  49. *
  50. * @param string FastStringBuffer reference, which must be non-null.
  51. * @param start The start position in the array.
  52. * @param length The number of characters to read from the array.
  53. *
  54. * @return An XMLString object that wraps the FastStringBuffer reference.
  55. */
  56. public abstract XMLString newstr(char[] string, int start,
  57. int length);
  58. /**
  59. * Get a cheap representation of an empty string.
  60. *
  61. * @return An non-null reference to an XMLString that represents "".
  62. */
  63. public abstract XMLString emptystr();
  64. }