From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../classpath/external/relaxngDatatype/.cvsignore | 2 + .../classpath/external/relaxngDatatype/Makefile.am | 14 + .../classpath/external/relaxngDatatype/Makefile.in | 450 +++++++++++++++++++++ .../classpath/external/relaxngDatatype/README.txt | 54 +++ .../classpath/external/relaxngDatatype/copying.txt | 30 ++ .../org/relaxng/datatype/Datatype.java | 237 +++++++++++ .../org/relaxng/datatype/DatatypeBuilder.java | 45 +++ .../org/relaxng/datatype/DatatypeException.java | 39 ++ .../org/relaxng/datatype/DatatypeLibrary.java | 37 ++ .../relaxng/datatype/DatatypeLibraryFactory.java | 26 ++ .../datatype/DatatypeStreamingValidator.java | 46 +++ .../org/relaxng/datatype/ValidationContext.java | 66 +++ .../datatype/helpers/DatatypeLibraryLoader.java | 261 ++++++++++++ .../helpers/ParameterlessDatatypeBuilder.java | 42 ++ .../datatype/helpers/StreamingValidatorImpl.java | 55 +++ 15 files changed, 1404 insertions(+) create mode 100644 libjava/classpath/external/relaxngDatatype/.cvsignore create mode 100644 libjava/classpath/external/relaxngDatatype/Makefile.am create mode 100644 libjava/classpath/external/relaxngDatatype/Makefile.in create mode 100755 libjava/classpath/external/relaxngDatatype/README.txt create mode 100755 libjava/classpath/external/relaxngDatatype/copying.txt create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/Datatype.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeBuilder.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeException.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibrary.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibraryFactory.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeStreamingValidator.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/ValidationContext.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java create mode 100755 libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/StreamingValidatorImpl.java (limited to 'libjava/classpath/external/relaxngDatatype') diff --git a/libjava/classpath/external/relaxngDatatype/.cvsignore b/libjava/classpath/external/relaxngDatatype/.cvsignore new file mode 100644 index 000000000..282522db0 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/libjava/classpath/external/relaxngDatatype/Makefile.am b/libjava/classpath/external/relaxngDatatype/Makefile.am new file mode 100644 index 000000000..8afce6597 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/Makefile.am @@ -0,0 +1,14 @@ +## Input file for automake to generate the Makefile.in used by configure + +EXTRA_DIST = README.txt \ +copying.txt \ +org/relaxng/datatype/Datatype.java \ +org/relaxng/datatype/DatatypeBuilder.java \ +org/relaxng/datatype/DatatypeException.java \ +org/relaxng/datatype/DatatypeLibrary.java \ +org/relaxng/datatype/DatatypeLibraryFactory.java \ +org/relaxng/datatype/DatatypeStreamingValidator.java \ +org/relaxng/datatype/ValidationContext.java \ +org/relaxng/datatype/helpers/DatatypeLibraryLoader.java \ +org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java \ +org/relaxng/datatype/helpers/StreamingValidatorImpl.java diff --git a/libjava/classpath/external/relaxngDatatype/Makefile.in b/libjava/classpath/external/relaxngDatatype/Makefile.in new file mode 100644 index 000000000..f90913716 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/Makefile.in @@ -0,0 +1,450 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = external/relaxngDatatype +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \ + $(top_srcdir)/../../config/lead-dot.m4 \ + $(top_srcdir)/../../config/lib-ld.m4 \ + $(top_srcdir)/../../config/lib-link.m4 \ + $(top_srcdir)/../../config/lib-prefix.m4 \ + $(top_srcdir)/../../config/multi.m4 \ + $(top_srcdir)/../../config/no-executables.m4 \ + $(top_srcdir)/../../config/override.m4 \ + $(top_srcdir)/../../libtool.m4 \ + $(top_srcdir)/../../ltoptions.m4 \ + $(top_srcdir)/../../ltsugar.m4 \ + $(top_srcdir)/../../ltversion.m4 \ + $(top_srcdir)/../../lt~obsolete.m4 \ + $(top_srcdir)/m4/ac_prog_antlr.m4 \ + $(top_srcdir)/m4/ac_prog_java.m4 \ + $(top_srcdir)/m4/ac_prog_java_works.m4 \ + $(top_srcdir)/m4/ac_prog_javac.m4 \ + $(top_srcdir)/m4/ac_prog_javac_works.m4 \ + $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/ax_func_which_gethostbyname_r.m4 \ + $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +ANTLR = @ANTLR@ +ANTLR_JAR = @ANTLR_JAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLASSPATH_CONVENIENCE = @CLASSPATH_CONVENIENCE@ +CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@ +CLASSPATH_MODULE = @CLASSPATH_MODULE@ +COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@ +CP = @CP@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATE = @DATE@ +DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ECJ_JAR = @ECJ_JAR@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +EXAMPLESDIR = @EXAMPLESDIR@ +EXEEXT = @EXEEXT@ +EXTRA_CFLAGS = @EXTRA_CFLAGS@ +FGREP = @FGREP@ +FIND = @FIND@ +FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ +FREETYPE2_LIBS = @FREETYPE2_LIBS@ +GCONF_CFLAGS = @GCONF_CFLAGS@ +GCONF_LIBS = @GCONF_LIBS@ +GDK_CFLAGS = @GDK_CFLAGS@ +GDK_LIBS = @GDK_LIBS@ +GJDOC = @GJDOC@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMP_CFLAGS = @GMP_CFLAGS@ +GMP_LIBS = @GMP_LIBS@ +GREP = @GREP@ +GSTREAMER_BASE_CFLAGS = @GSTREAMER_BASE_CFLAGS@ +GSTREAMER_BASE_LIBS = @GSTREAMER_BASE_LIBS@ +GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ +GSTREAMER_FILE_READER = @GSTREAMER_FILE_READER@ +GSTREAMER_LIBS = @GSTREAMER_LIBS@ +GSTREAMER_MIXER_PROVIDER = @GSTREAMER_MIXER_PROVIDER@ +GSTREAMER_PLUGINS_BASE_CFLAGS = @GSTREAMER_PLUGINS_BASE_CFLAGS@ +GSTREAMER_PLUGINS_BASE_LIBS = @GSTREAMER_PLUGINS_BASE_LIBS@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JAR = @JAR@ +JAVA = @JAVA@ +JAVAC = @JAVAC@ +JAVAC_IS_GCJ = @JAVAC_IS_GCJ@ +JAVAC_MEM_OPT = @JAVAC_MEM_OPT@ +JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@ +JAY = @JAY@ +JAY_SKELETON = @JAY_SKELETON@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDEBUG = @LIBDEBUG@ +LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MOC = @MOC@ +MOZILLA_CFLAGS = @MOZILLA_CFLAGS@ +MOZILLA_LIBS = @MOZILLA_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@ +PANGOFT2_LIBS = @PANGOFT2_LIBS@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_TO_ESCHER = @PATH_TO_ESCHER@ +PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_DIR = @PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ +RANLIB = @RANLIB@ +REMOVE = @REMOVE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@ +STRIP = @STRIP@ +TOOLSDIR = @TOOLSDIR@ +USER_JAVAH = @USER_JAVAH@ +VERSION = @VERSION@ +WANT_NATIVE_BIG_INTEGER = @WANT_NATIVE_BIG_INTEGER@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +XMKMF = @XMKMF@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_LIBS = @XSLT_LIBS@ +XTEST_LIBS = @XTEST_LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_ANTLR = @ac_ct_ANTLR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +default_toolkit = @default_toolkit@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +glibjdir = @glibjdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +multi_basedir = @multi_basedir@ +nativeexeclibdir = @nativeexeclibdir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +toolexeclibdir = @toolexeclibdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +uudecode = @uudecode@ +vm_classes = @vm_classes@ +EXTRA_DIST = README.txt \ +copying.txt \ +org/relaxng/datatype/Datatype.java \ +org/relaxng/datatype/DatatypeBuilder.java \ +org/relaxng/datatype/DatatypeException.java \ +org/relaxng/datatype/DatatypeLibrary.java \ +org/relaxng/datatype/DatatypeLibraryFactory.java \ +org/relaxng/datatype/DatatypeStreamingValidator.java \ +org/relaxng/datatype/ValidationContext.java \ +org/relaxng/datatype/helpers/DatatypeLibraryLoader.java \ +org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java \ +org/relaxng/datatype/helpers/StreamingValidatorImpl.java + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu external/relaxngDatatype/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu external/relaxngDatatype/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libjava/classpath/external/relaxngDatatype/README.txt b/libjava/classpath/external/relaxngDatatype/README.txt new file mode 100755 index 000000000..70d49b5fa --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/README.txt @@ -0,0 +1,54 @@ +====================================================================== + README FILE FOR DATATYPE INTERFACES FOR RELAX NG +====================================================================== + + + +RELAX NG supports multiple datatype vocabularies. To achive this, an +interface between datatype vocabularies and schema processors is +necessary. This interface is intended to be a standard Java interface +for this purpose. + + +---------------------------------------------------------------------- +LICENSE +---------------------------------------------------------------------- + +See copying.txt. + +Note: this license is the BSD license. + + + +---------------------------------------------------------------------- +FOR DEVELOPER +---------------------------------------------------------------------- + +If you are planning to implement a datatype library, A sample datatype +library implementation by James Clark is available at [1], which +comes with documentation and source code. + +If you are planning to implement a schema processor, then don't forget +to check out org.relaxng.datatype.helpers.DatatypeLibraryLoader, as +this allows you to dynamically locate datatype implementations. + + +---------------------------------------------------------------------- +LINKS +---------------------------------------------------------------------- + +* OASIS RELAX NG TC + http://www.oasis-open.org/committees/relax-ng/ +* RELAX home page + http://www.xml.gr.jp/relax/ + + +---------------------------------------------------------------------- +REFERENCES +---------------------------------------------------------------------- +[1] Sample datatype library implementation by James Clark + http://www.thaiopensource.com/relaxng/datatype-sample.zip + +Document written by Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) +====================================================================== +END OF README diff --git a/libjava/classpath/external/relaxngDatatype/copying.txt b/libjava/classpath/external/relaxngDatatype/copying.txt new file mode 100755 index 000000000..1b86eab60 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/copying.txt @@ -0,0 +1,30 @@ +Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/Datatype.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/Datatype.java new file mode 100755 index 000000000..325384c27 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/Datatype.java @@ -0,0 +1,237 @@ +package org.relaxng.datatype; + +/** + * Datatype object. + * + * This object has the following functionality: + * + *
    + *
  1. functionality to identify a class of character sequences. This is + * done through the isValid method. + * + *
  2. functionality to produce a "value object" from a character sequence and + * context information. + * + *
  3. functionality to test the equality of two value objects. + *
+ * + * This interface also defines the createStreamingValidator method, + * which is intended to efficiently support the validation of + * large character sequences. + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public interface Datatype { + + /** + * Checks if the specified 'literal' matches this Datatype + * with respect to the current context. + * + * @param literal + * the lexical representation to be checked. + * @param context + * If this datatype is context-dependent + * (i.e. the {@link #isContextDependent} method returns true), + * then the caller must provide a non-null valid context object. + * Otherwise, the caller can pass null. + * + * @return + * true if the 'literal' is a member of this Datatype; + * false if it's not a member of this Datatype. + */ + boolean isValid( String literal, ValidationContext context ); + + /** + * Similar to the isValid method but throws an exception with diagnosis + * in case of errors. + * + *

+ * If the specified 'literal' is a valid lexical representation for this + * datatype, then this method must return without throwing any exception. + * If not, the callee must throw an exception (with diagnosis message, + * if possible.) + * + *

+ * The application can use this method to provide detailed error message + * to users. This method is kept separate from the isValid method to + * achieve higher performance during normal validation. + * + * @exception DatatypeException + * If the given literal is invalid, then this exception is thrown. + * If the callee supports error diagnosis, then the exception should + * contain a diagnosis message. + */ + void checkValid( String literal, ValidationContext context ) + throws DatatypeException; + + /** + * Creates an instance of a streaming validator for this type. + * + *

+ * By using streaming validators instead of the isValid method, + * the caller can avoid keeping the entire string, which is + * sometimes quite big, in memory. + * + * @param context + * If this datatype is context-dependent + * (i.e. the {@link #isContextDependent} method returns true), + * then the caller must provide a non-null valid context object. + * Otherwise, the caller can pass null. + * The callee may keep a reference to this context object + * only while the returned streaming validator is being used. + */ + DatatypeStreamingValidator createStreamingValidator( ValidationContext context ); + + /** + * Converts lexcial value and the current context to the corresponding + * value object. + * + *

+ * The caller cannot generally assume that the value object is + * a meaningful Java object. For example, the caller cannot expect + * this method to return java.lang.Number type for + * the "integer" type of XML Schema Part 2. + * + *

+ * Also, the caller cannot assume that the equals method and + * the hashCode method of the value object are consistent with + * the semantics of the datatype. For that purpose, the sameValue + * method and the valueHashCode method have to be used. Note that + * this means you cannot use classes like + * java.util.Hashtable to store the value objects. + * + *

+ * The returned value object should be used solely for the sameValue + * and valueHashCode methods. + * + * @param context + * If this datatype is context-dependent + * (when the {@link #isContextDependent} method returns true), + * then the caller must provide a non-null valid context object. + * Otherwise, the caller can pass null. + * + * @return null + * when the given lexical value is not a valid lexical + * value for this type. + */ + Object createValue( String literal, ValidationContext context ); + + /** + * Tests the equality of two value objects which were originally + * created by the createValue method of this object. + * + * The behavior is undefined if objects not created by this type + * are passed. It is the caller's responsibility to ensure that + * value objects belong to this type. + * + * @return + * true if two value objects are considered equal according to + * the definition of this datatype; false if otherwise. + */ + boolean sameValue( Object value1, Object value2 ); + + + /** + * Computes the hash code for a value object, + * which is consistent with the sameValue method. + * + * @return + * hash code for the specified value object. + */ + int valueHashCode( Object value ); + + + + + /** + * Indicates that the datatype doesn't have ID/IDREF semantics. + * + * This value is one of the possible return values of the + * {@link #getIdType} method. + */ + public static final int ID_TYPE_NULL = 0; + + /** + * Indicates that RELAX NG compatibility processors should + * treat this datatype as having ID semantics. + * + * This value is one of the possible return values of the + * {@link #getIdType} method. + */ + public static final int ID_TYPE_ID = 1; + + /** + * Indicates that RELAX NG compatibility processors should + * treat this datatype as having IDREF semantics. + * + * This value is one of the possible return values of the + * {@link #getIdType} method. + */ + public static final int ID_TYPE_IDREF = 2; + + /** + * Indicates that RELAX NG compatibility processors should + * treat this datatype as having IDREFS semantics. + * + * This value is one of the possible return values of the + * {@link #getIdType} method. + */ + public static final int ID_TYPE_IDREFS = 3; + + /** + * Checks if the ID/IDREF semantics is associated with this + * datatype. + * + *

+ * This method is introduced to support the RELAX NG DTD + * compatibility spec. (Of course it's always free to use + * this method for other purposes.) + * + *

+ * If you are implementing a datatype library and have no idea about + * the "RELAX NG DTD compatibility" thing, just return + * ID_TYPE_NULL is fine. + * + * @return + * If this datatype doesn't have any ID/IDREF semantics, + * it returns {@link #ID_TYPE_NULL}. If it has such a semantics + * (for example, XSD:ID, XSD:IDREF and comp:ID type), then + * it returns {@link #ID_TYPE_ID}, {@link #ID_TYPE_IDREF} or + * {@link #ID_TYPE_IDREFS}. + */ + public int getIdType(); + + + /** + * Checks if this datatype may need a context object for + * the validation. + * + *

+ * The callee must return true even when the context + * is not always necessary. (For example, the "QName" type + * doesn't need a context object when validating unprefixed + * string. But nonetheless QName must return true.) + * + *

+ * XSD's string and short types + * are examples of context-independent datatypes. + * Its QName and ENTITY types + * are examples of context-dependent datatypes. + * + *

+ * When a datatype is context-independent, then + * the {@link #isValid} method, the {@link #checkValid} method, + * the {@link #createStreamingValidator} method and + * the {@link #createValue} method can be called without + * providing a context object. + * + * @return + * true if this datatype is context-dependent + * (it needs a context object sometimes); + * + * false if this datatype is context-independent + * (it never needs a context object). + */ + public boolean isContextDependent(); +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeBuilder.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeBuilder.java new file mode 100755 index 000000000..0a2b55e2e --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeBuilder.java @@ -0,0 +1,45 @@ +package org.relaxng.datatype; + +/** + * Creates a user-defined type by adding parameters to + * the pre-defined type. + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public interface DatatypeBuilder { + + /** + * Adds a new parameter. + * + * @param name + * The name of the parameter to be added. + * @param strValue + * The raw value of the parameter. Caller may not normalize + * this value because any white space is potentially significant. + * @param context + * The context information which can be used by the callee to + * acquire additional information. This context object is + * valid only during this method call. The callee may not + * keep a reference to this object. + * @exception DatatypeException + * When the given parameter is inappropriate for some reason. + * The callee is responsible to recover from this error. + * That is, the object should behave as if no such error + * was occured. + */ + void addParameter( String name, String strValue, ValidationContext context ) + throws DatatypeException; + + /** + * Derives a new Datatype from a Datatype by parameters that + * were already set through the addParameter method. + * + * @exception DatatypeException + * DatatypeException must be thrown if the derivation is + * somehow invalid. For example, a required parameter is missing, + * etc. The exception should contain a diagnosis message + * if possible. + */ + Datatype createDatatype() throws DatatypeException; +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeException.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeException.java new file mode 100755 index 000000000..554385fe4 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeException.java @@ -0,0 +1,39 @@ +package org.relaxng.datatype; + +/** + * Signals Datatype related exceptions. + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public class DatatypeException extends Exception { + + public DatatypeException( int index, String msg ) { + super(msg); + this.index = index; + } + public DatatypeException( String msg ) { + this(UNKNOWN,msg); + } + /** + * A constructor for those datatype libraries which don't support any + * diagnostic information at all. + */ + public DatatypeException() { + this(UNKNOWN,null); + } + + + private final int index; + + public static final int UNKNOWN = -1; + + /** + * Gets the index of the content where the error occured. + * UNKNOWN can be returned to indicate that no index information + * is available. + */ + public int getIndex() { + return index; + } +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibrary.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibrary.java new file mode 100755 index 000000000..3a9b4d0bb --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibrary.java @@ -0,0 +1,37 @@ +package org.relaxng.datatype; + +/** + * A Datatype library + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public interface DatatypeLibrary { + + /** + * Creates a new instance of DatatypeBuilder. + * + * The callee should throw a DatatypeException in case of an error. + * + * @param baseTypeLocalName + * The local name of the base type. + * + * @return + * A non-null valid datatype object. + */ + DatatypeBuilder createDatatypeBuilder( String baseTypeLocalName ) + throws DatatypeException; + + /** + * Gets or creates a pre-defined type. + * + * This is just a short-cut of + * createDatatypeBuilder(typeLocalName).createDatatype(); + * + * The callee should throw a DatatypeException in case of an error. + * + * @return + * A non-null valid datatype object. + */ + Datatype createDatatype( String typeLocalName ) throws DatatypeException; +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibraryFactory.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibraryFactory.java new file mode 100755 index 000000000..ebc9b910b --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeLibraryFactory.java @@ -0,0 +1,26 @@ +package org.relaxng.datatype; + +/** + * Factory class for the DatatypeLibrary class. + * + *

+ * The datatype library should provide the implementation of + * this interface if it wants to be found by the schema processors. + * The implementor also have to place a file in your jar file. + * See the reference datatype library implementation for detail. + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public interface DatatypeLibraryFactory +{ + /** + * Creates a new instance of a DatatypeLibrary that supports + * the specified namespace URI. + * + * @return + * null if the specified namespace URI is not + * supported. + */ + DatatypeLibrary createDatatypeLibrary( String namespaceURI ); +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeStreamingValidator.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeStreamingValidator.java new file mode 100755 index 000000000..d181b0329 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/DatatypeStreamingValidator.java @@ -0,0 +1,46 @@ +package org.relaxng.datatype; + +/** + * Datatype streaming validator. + * + *

+ * The streaming validator is an optional feature that is useful for + * certain Datatypes. It allows the caller to incrementally provide + * the literal. + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public interface DatatypeStreamingValidator { + + /** + * Passes an additional fragment of the literal. + * + *

+ * The application can call this method several times, then call + * the isValid method (or the checkValid method) to check the validity + * of the accumulated characters. + */ + void addCharacters( char[] buf, int start, int len ); + + /** + * Tells if the accumulated literal is valid with respect to + * the underlying Datatype. + * + * @return + * True if it is valid. False if otherwise. + */ + boolean isValid(); + + /** + * Similar to the isValid method, but this method throws + * Exception (with possibly diagnostic information), instead of + * returning false. + * + * @exception DatatypeException + * If the callee supports the diagnosis and the accumulated + * literal is invalid, then this exception that possibly + * contains diagnosis information is thrown. + */ + void checkValid() throws DatatypeException; +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/ValidationContext.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/ValidationContext.java new file mode 100755 index 000000000..b25df7c7a --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/ValidationContext.java @@ -0,0 +1,66 @@ +package org.relaxng.datatype; + +/** + * An interface that must be implemented by caller to + * provide context information that is necessary to + * perform validation of some Datatypes. + * + * @author James Clark + * @author Kohsuke KAWAGUCHI + */ +public interface ValidationContext { + + /** + * Resolves a namespace prefix to the corresponding namespace URI. + * + * This method is used for validating the QName type, for example. + * + *

+ * If the prefix is "" (empty string), it indicates + * an unprefixed value. The callee + * should resolve it as for an unprefixed + * element, rather than for an unprefixed attribute. + * + *

+ * If the prefix is "xml", then the callee must resolve + * this prefix into "http://www.w3.org/XML/1998/namespace", + * as defined in the XML Namespaces Recommendation. + * + * @return + * namespace URI of this prefix. + * If the specified prefix is not declared, + * the implementation must return null. + */ + String resolveNamespacePrefix( String prefix ); + + /** + * Returns the base URI of the context. The null string may be returned + * if no base URI is known. + */ + String getBaseUri(); + + /** + * Checks if an unparsed entity is declared with the + * specified name. + * + * @return + * true + * if the DTD has an unparsed entity declaration for + * the specified name. + * false + * otherwise. + */ + boolean isUnparsedEntity( String entityName ); + + /** + * Checks if a notation is declared with the + * specified name. + * + * @return + * true + * if the DTD has a notation declaration for the specified name. + * false + * otherwise. + */ + boolean isNotation( String notationName ); +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java new file mode 100755 index 000000000..3aa7c0481 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) 2001, Thai Open Source Software Center Ltd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Thai Open Source Software Center Ltd nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.relaxng.datatype.helpers; + +import org.relaxng.datatype.DatatypeLibraryFactory; +import org.relaxng.datatype.DatatypeLibrary; +import java.util.Enumeration; +import java.util.NoSuchElementException; +import java.util.Vector; +import java.io.Reader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URL; + +/** + * Discovers the datatype library implementation from the classpath. + * + *

+ * The call of the createDatatypeLibrary method finds an implementation + * from a given datatype library URI at run-time. + */ +public class DatatypeLibraryLoader implements DatatypeLibraryFactory { + private final Service service = new Service(DatatypeLibraryFactory.class); + + public DatatypeLibrary createDatatypeLibrary(String uri) { + for (Enumeration e = service.getProviders(); + e.hasMoreElements();) { + DatatypeLibraryFactory factory + = (DatatypeLibraryFactory)e.nextElement(); + DatatypeLibrary library = factory.createDatatypeLibrary(uri); + if (library != null) + return library; + } + return null; + } + + private static class Service { + private final Class serviceClass; + private final Enumeration configFiles; + private Enumeration classNames = null; + private final Vector providers = new Vector(); + private Loader loader; + + private class ProviderEnumeration implements Enumeration { + private int nextIndex = 0; + + public boolean hasMoreElements() { + return nextIndex < providers.size() || moreProviders(); + } + + public Object nextElement() { + try { + return providers.elementAt(nextIndex++); + } + catch (ArrayIndexOutOfBoundsException e) { + throw new NoSuchElementException(); + } + } + } + + private static class Singleton implements Enumeration { + private Object obj; + private Singleton(Object obj) { + this.obj = obj; + } + + public boolean hasMoreElements() { + return obj != null; + } + + public Object nextElement() { + if (obj == null) + throw new NoSuchElementException(); + Object tem = obj; + obj = null; + return tem; + } + } + + // JDK 1.1 + private static class Loader { + Enumeration getResources(String resName) { + ClassLoader cl = Loader.class.getClassLoader(); + URL url; + if (cl == null) + url = ClassLoader.getSystemResource(resName); + else + url = cl.getResource(resName); + return new Singleton(url); + } + + Class loadClass(String name) throws ClassNotFoundException { + return Class.forName(name); + } + } + + // JDK 1.2+ + private static class Loader2 extends Loader { + private ClassLoader cl; + + Loader2() { + cl = Loader2.class.getClassLoader(); + // If the thread context class loader has the class loader + // of this class as an ancestor, use the thread context class + // loader. Otherwise, the thread context class loader + // probably hasn't been set up properly, so don't use it. + ClassLoader clt = Thread.currentThread().getContextClassLoader(); + for (ClassLoader tem = clt; tem != null; tem = tem.getParent()) + if (tem == cl) { + cl = clt; + break; + } + } + + Enumeration getResources(String resName) { + try { + return cl.getResources(resName); + } + catch (IOException e) { + return new Singleton(null); + } + } + + Class loadClass(String name) throws ClassNotFoundException { + return Class.forName(name, true, cl); + } + } + + public Service(Class cls) { + try { + loader = new Loader2(); + } + catch (NoSuchMethodError e) { + loader = new Loader(); + } + serviceClass = cls; + String resName = "META-INF/services/" + serviceClass.getName(); + configFiles = loader.getResources(resName); + } + + public Enumeration getProviders() { + return new ProviderEnumeration(); + } + + synchronized private boolean moreProviders() { + for (;;) { + while (classNames == null) { + if (!configFiles.hasMoreElements()) + return false; + classNames = parseConfigFile((URL)configFiles.nextElement()); + } + while (classNames.hasMoreElements()) { + String className = (String)classNames.nextElement(); + try { + Class cls = loader.loadClass(className); + Object obj = cls.newInstance(); + if (serviceClass.isInstance(obj)) { + providers.addElement(obj); + return true; + } + } + catch (ClassNotFoundException e) { } + catch (InstantiationException e) { } + catch (IllegalAccessException e) { } + catch (LinkageError e) { } + } + classNames = null; + } + } + + private static final int START = 0; + private static final int IN_NAME = 1; + private static final int IN_COMMENT = 2; + + private static Enumeration parseConfigFile(URL url) { + try { + InputStream in = url.openStream(); + Reader r; + try { + r = new InputStreamReader(in, "UTF-8"); + } + catch (UnsupportedEncodingException e) { + r = new InputStreamReader(in, "UTF8"); + } + r = new BufferedReader(r); + Vector tokens = new Vector(); + StringBuffer tokenBuf = new StringBuffer(); + int state = START; + for (;;) { + int n = r.read(); + if (n < 0) + break; + char c = (char)n; + switch (c) { + case '\r': + case '\n': + state = START; + break; + case ' ': + case '\t': + break; + case '#': + state = IN_COMMENT; + break; + default: + if (state != IN_COMMENT) { + state = IN_NAME; + tokenBuf.append(c); + } + break; + } + if (tokenBuf.length() != 0 && state != IN_NAME) { + tokens.addElement(tokenBuf.toString()); + tokenBuf.setLength(0); + } + } + if (tokenBuf.length() != 0) + tokens.addElement(tokenBuf.toString()); + return tokens.elements(); + } + catch (IOException e) { + return null; + } + } + } + +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java new file mode 100755 index 000000000..c59b09355 --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java @@ -0,0 +1,42 @@ +package org.relaxng.datatype.helpers; + +import org.relaxng.datatype.*; + +/** + * Dummy implementation of {@link DatatypeBuilder}. + * + * This implementation can be used for Datatypes which have no parameters. + * Any attempt to add parameters will be rejected. + * + *

+ * Typical usage would be: + *


+ * class MyDatatypeLibrary implements DatatypeLibrary {
+ *     ....
+ *     DatatypeBuilder createDatatypeBuilder( String typeName ) {
+ *         return new ParameterleessDatatypeBuilder(createDatatype(typeName));
+ *     }
+ *     ....
+ * }
+ * 
+ * + * @author Kohsuke KAWAGUCHI + */ +public final class ParameterlessDatatypeBuilder implements DatatypeBuilder { + + /** This type object is returned for the derive method. */ + private final Datatype baseType; + + public ParameterlessDatatypeBuilder( Datatype baseType ) { + this.baseType = baseType; + } + + public void addParameter( String name, String strValue, ValidationContext context ) + throws DatatypeException { + throw new DatatypeException(); + } + + public Datatype createDatatype() throws DatatypeException { + return baseType; + } +} diff --git a/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/StreamingValidatorImpl.java b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/StreamingValidatorImpl.java new file mode 100755 index 000000000..f553e908e --- /dev/null +++ b/libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/StreamingValidatorImpl.java @@ -0,0 +1,55 @@ +package org.relaxng.datatype.helpers; + +import org.relaxng.datatype.*; + +/** + * Dummy implementation of {@link DatatypeStreamingValidator}. + * + *

+ * This implementation can be used as a quick hack when the performance + * of streaming validation is not important. And this implementation + * also shows you how to implement the DatatypeStreamingValidator interface. + * + *

+ * Typical usage would be: + *


+ * class MyDatatype implements Datatype {
+ *     ....
+ *     public DatatypeStreamingValidator createStreamingValidator( ValidationContext context ) {
+ *         return new StreamingValidatorImpl(this,context);
+ *     }
+ *     ....
+ * }
+ * 
+ * + * @author Kohsuke KAWAGUCHI + */ +public final class StreamingValidatorImpl implements DatatypeStreamingValidator { + + /** This buffer accumulates characters. */ + private final StringBuffer buffer = new StringBuffer(); + + /** Datatype obejct that creates this streaming validator. */ + private final Datatype baseType; + + /** The current context. */ + private final ValidationContext context; + + public void addCharacters( char[] buf, int start, int len ) { + // append characters to the current buffer. + buffer.append(buf,start,len); + } + + public boolean isValid() { + return baseType.isValid(buffer.toString(),context); + } + + public void checkValid() throws DatatypeException { + baseType.checkValid(buffer.toString(),context); + } + + public StreamingValidatorImpl( Datatype baseType, ValidationContext context ) { + this.baseType = baseType; + this.context = context; + } +} -- cgit v1.2.3