You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UriType.java 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * UriType.java
  3. * $Id$
  4. *
  5. * Created: Tue Nov 20 22:18:11 2001
  6. *
  7. *
  8. * Copyright 1999-2003 The Apache Software Foundation.
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. *
  22. *
  23. * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a>
  24. * @version $Revision$ $Name$
  25. */
  26. package org.apache.fop.datatypes;
  27. import org.apache.fop.fo.expr.PropertyException;
  28. import org.apache.fop.fo.properties.Property;
  29. /**
  30. * Class for URLs specified with <tt>uri()</tt> function.
  31. */
  32. public class UriType extends AbstractPropertyValue {
  33. private static final String tag = "$Name$";
  34. private static final String revision = "$Revision$";
  35. /**
  36. * A URI Specification
  37. */
  38. private String uri;
  39. /**
  40. * @param property the <tt>int</tt> index of the property on which
  41. * this value is being defined.
  42. * @param uri the <tt>String</tt> containing the uri extracted from
  43. * <tt>url(...)</tt>.
  44. * @exception PropertyException
  45. */
  46. public UriType(int property, String uri)
  47. throws PropertyException
  48. {
  49. super(property, PropertyValue.URI_TYPE);
  50. this.uri = uri;
  51. }
  52. /**
  53. * @param propertyName the <tt>String</tt> name of the property on which
  54. * this value is being defined.
  55. * @param uri the <tt>String</tt> containing the uri extracted from
  56. * <tt>url(...)</tt>.
  57. * @exception PropertyException
  58. */
  59. public UriType(String propertyName, String uri)
  60. throws PropertyException
  61. {
  62. super(propertyName, PropertyValue.URI_TYPE);
  63. this.uri = uri;
  64. }
  65. /**
  66. * @return a <tt>String</tt> containing the URI.
  67. */
  68. public String getUri() {
  69. return uri;
  70. }
  71. /**
  72. * validate the <i>UriType</i> against the associated property.
  73. */
  74. public void validate() throws PropertyException {
  75. super.validate(Property.URI_SPECIFICATION);
  76. }
  77. }