You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(97) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(127) |
Feb
(34) |
Mar
(16) |
Apr
(26) |
May
(55) |
Jun
(107) |
Jul
(36) |
Aug
(72) |
Sep
(90) |
Oct
(41) |
Nov
(27) |
Dec
(13) |
| 2008 |
Jan
(37) |
Feb
(39) |
Mar
(98) |
Apr
(115) |
May
(134) |
Jun
(120) |
Jul
(86) |
Aug
(149) |
Sep
(68) |
Oct
(66) |
Nov
(104) |
Dec
(49) |
| 2009 |
Jan
(131) |
Feb
(132) |
Mar
(125) |
Apr
(172) |
May
(161) |
Jun
(43) |
Jul
(47) |
Aug
(38) |
Sep
(18) |
Oct
(6) |
Nov
(1) |
Dec
(15) |
| 2010 |
Jan
(21) |
Feb
(8) |
Mar
(10) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(4) |
| 2011 |
Jan
(23) |
Feb
(10) |
Mar
(13) |
Apr
(3) |
May
|
Jun
(19) |
Jul
(11) |
Aug
(22) |
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(7) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(30) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
| 2013 |
Jan
(3) |
Feb
(40) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: <ls...@us...> - 2007-08-31 20:45:20
|
Revision: 3445
http://jnode.svn.sourceforge.net/jnode/?rev=3445&view=rev
Author: lsantha
Date: 2007-08-31 13:45:14 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/src/openjdk/vm/java/io/NativeFileSystem.java
Added Paths:
-----------
trunk/core/src/openjdk/java/java/io/ExpiringCache.java
trunk/core/src/openjdk/java/java/io/UnixFileSystem.java
trunk/core/src/openjdk/vm/java/io/NativeUnixFileSystem.java
Added: trunk/core/src/openjdk/java/java/io/ExpiringCache.java
===================================================================
--- trunk/core/src/openjdk/java/java/io/ExpiringCache.java (rev 0)
+++ trunk/core/src/openjdk/java/java/io/ExpiringCache.java 2007-08-31 20:45:14 UTC (rev 3445)
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @(#)ExpiringCache.java 1.12 07/05/05
+ */
+
+package java.io;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import java.util.Set;
+
+class ExpiringCache {
+ private long millisUntilExpiration;
+ private Map map;
+ // Clear out old entries every few queries
+ private int queryCount;
+ private int queryOverflow = 300;
+ private int MAX_ENTRIES = 200;
+
+ static class Entry {
+ private long timestamp;
+ private String val;
+
+ Entry(long timestamp, String val) {
+ this.timestamp = timestamp;
+ this.val = val;
+ }
+
+ long timestamp() { return timestamp; }
+ void setTimestamp(long timestamp) { this.timestamp = timestamp; }
+
+ String val() { return val; }
+ void setVal(String val) { this.val = val; }
+ }
+
+ ExpiringCache() {
+ this(30000);
+ }
+
+ ExpiringCache(long millisUntilExpiration) {
+ this.millisUntilExpiration = millisUntilExpiration;
+ map = new LinkedHashMap() {
+ protected boolean removeEldestEntry(Map.Entry eldest) {
+ return size() > MAX_ENTRIES;
+ }
+ };
+ }
+
+ synchronized String get(String key) {
+ if (++queryCount >= queryOverflow) {
+ cleanup();
+ }
+ Entry entry = entryFor(key);
+ if (entry != null) {
+ return entry.val();
+ }
+ return null;
+ }
+
+ synchronized void put(String key, String val) {
+ if (++queryCount >= queryOverflow) {
+ cleanup();
+ }
+ Entry entry = entryFor(key);
+ if (entry != null) {
+ entry.setTimestamp(System.currentTimeMillis());
+ entry.setVal(val);
+ } else {
+ map.put(key, new Entry(System.currentTimeMillis(), val));
+ }
+ }
+
+ synchronized void clear() {
+ map.clear();
+ }
+
+ private Entry entryFor(String key) {
+ Entry entry = (Entry) map.get(key);
+ if (entry != null) {
+ long delta = System.currentTimeMillis() - entry.timestamp();
+ if (delta < 0 || delta >= millisUntilExpiration) {
+ map.remove(key);
+ entry = null;
+ }
+ }
+ return entry;
+ }
+
+ private void cleanup() {
+ Set keySet = map.keySet();
+ // Avoid ConcurrentModificationExceptions
+ String[] keys = new String[keySet.size()];
+ int i = 0;
+ for (Iterator iter = keySet.iterator(); iter.hasNext(); ) {
+ String key = (String) iter.next();
+ keys[i++] = key;
+ }
+ for (int j = 0; j < keys.length; j++) {
+ entryFor(keys[j]);
+ }
+ queryCount = 0;
+ }
+}
Added: trunk/core/src/openjdk/java/java/io/UnixFileSystem.java
===================================================================
--- trunk/core/src/openjdk/java/java/io/UnixFileSystem.java (rev 0)
+++ trunk/core/src/openjdk/java/java/io/UnixFileSystem.java 2007-08-31 20:45:14 UTC (rev 3445)
@@ -0,0 +1,323 @@
+/*
+ * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.io;
+
+import java.security.AccessController;
+import sun.security.action.GetPropertyAction;
+
+
+class UnixFileSystem extends FileSystem {
+
+ private final char slash;
+ private final char colon;
+ private final String javaHome;
+
+ public UnixFileSystem() {
+ slash =
+ ((String) AccessController.doPrivileged(
+ new GetPropertyAction("file.separator"))).charAt(0);
+ colon =
+ ((String) AccessController.doPrivileged(
+ new GetPropertyAction("path.separator"))).charAt(0);
+ javaHome =
+ (String) AccessController.doPrivileged(
+ new GetPropertyAction("java.home"));
+ }
+
+
+ /* -- Normalization and construction -- */
+
+ public char getSeparator() {
+ return slash;
+ }
+
+ public char getPathSeparator() {
+ return colon;
+ }
+
+ /* A normal Unix pathname contains no duplicate slashes and does not end
+ with a slash. It may be the empty string. */
+
+ /* Normalize the given pathname, whose length is len, starting at the given
+ offset; everything before this offset is already normal. */
+ private String normalize(String pathname, int len, int off) {
+ if (len == 0) return pathname;
+ int n = len;
+ while ((n > 0) && (pathname.charAt(n - 1) == '/')) n--;
+ if (n == 0) return "/";
+ StringBuffer sb = new StringBuffer(pathname.length());
+ if (off > 0) sb.append(pathname.substring(0, off));
+ char prevChar = 0;
+ for (int i = off; i < n; i++) {
+ char c = pathname.charAt(i);
+ if ((prevChar == '/') && (c == '/')) continue;
+ sb.append(c);
+ prevChar = c;
+ }
+ return sb.toString();
+ }
+
+ /* Check that the given pathname is normal. If not, invoke the real
+ normalizer on the part of the pathname that requires normalization.
+ This way we iterate through the whole pathname string only once. */
+ public String normalize(String pathname) {
+ int n = pathname.length();
+ char prevChar = 0;
+ for (int i = 0; i < n; i++) {
+ char c = pathname.charAt(i);
+ if ((prevChar == '/') && (c == '/'))
+ return normalize(pathname, n, i - 1);
+ prevChar = c;
+ }
+ if (prevChar == '/') return normalize(pathname, n, n - 1);
+ return pathname;
+ }
+
+ public int prefixLength(String pathname) {
+ if (pathname.length() == 0) return 0;
+ return (pathname.charAt(0) == '/') ? 1 : 0;
+ }
+
+ public String resolve(String parent, String child) {
+ if (child.equals("")) return parent;
+ if (child.charAt(0) == '/') {
+ if (parent.equals("/")) return child;
+ return parent + child;
+ }
+ if (parent.equals("/")) return parent + child;
+ return parent + '/' + child;
+ }
+
+ public String getDefaultParent() {
+ return "/";
+ }
+
+ public String fromURIPath(String path) {
+ String p = path;
+ if (p.endsWith("/") && (p.length() > 1)) {
+ // "/foo/" --> "/foo", but "/" --> "/"
+ p = p.substring(0, p.length() - 1);
+ }
+ return p;
+ }
+
+
+ /* -- Path operations -- */
+
+ public boolean isAbsolute(File f) {
+ return (f.getPrefixLength() != 0);
+ }
+
+ public String resolve(File f) {
+ if (isAbsolute(f)) return f.getPath();
+ return resolve(System.getProperty("user.dir"), f.getPath());
+ }
+
+ // Caches for canonicalization results to improve startup performance.
+ // The first cache handles repeated canonicalizations of the same path
+ // name. The prefix cache handles repeated canonicalizations within the
+ // same directory, and must not create results differing from the true
+ // canonicalization algorithm in canonicalize_md.c. For this reason the
+ // prefix cache is conservative and is not used for complex path names.
+ private ExpiringCache cache = new ExpiringCache();
+ // On Unix symlinks can jump anywhere in the file system, so we only
+ // treat prefixes in java.home as trusted and cacheable in the
+ // canonicalization algorithm
+ private ExpiringCache javaHomePrefixCache = new ExpiringCache();
+
+ public String canonicalize(String path) throws IOException {
+ if (!useCanonCaches) {
+ return canonicalize0(path);
+ } else {
+ String res = cache.get(path);
+ if (res == null) {
+ String dir = null;
+ String resDir = null;
+ if (useCanonPrefixCache) {
+ // Note that this can cause symlinks that should
+ // be resolved to a destination directory to be
+ // resolved to the directory they're contained in
+ dir = parentOrNull(path);
+ if (dir != null) {
+ resDir = javaHomePrefixCache.get(dir);
+ if (resDir != null) {
+ // Hit only in prefix cache; full path is canonical
+ String filename = path.substring(1 + dir.length());
+ res = resDir + slash + filename;
+ cache.put(dir + slash + filename, res);
+ }
+ }
+ }
+ if (res == null) {
+ res = canonicalize0(path);
+ cache.put(path, res);
+ if (useCanonPrefixCache &&
+ dir != null && dir.startsWith(javaHome)) {
+ resDir = parentOrNull(res);
+ // Note that we don't allow a resolved symlink
+ // to elsewhere in java.home to pollute the
+ // prefix cache (java.home prefix cache could
+ // just as easily be a set at this point)
+ if (resDir != null && resDir.equals(dir)) {
+ File f = new File(res);
+ if (f.exists() && !f.isDirectory()) {
+ javaHomePrefixCache.put(dir, resDir);
+ }
+ }
+ }
+ }
+ }
+ assert canonicalize0(path).equals(res) || path.startsWith(javaHome);
+ return res;
+ }
+ }
+ private native String canonicalize0(String path) throws IOException;
+ // Best-effort attempt to get parent of this path; used for
+ // optimization of filename canonicalization. This must return null for
+ // any cases where the code in canonicalize_md.c would throw an
+ // exception or otherwise deal with non-simple pathnames like handling
+ // of "." and "..". It may conservatively return null in other
+ // situations as well. Returning null will cause the underlying
+ // (expensive) canonicalization routine to be called.
+ static String parentOrNull(String path) {
+ if (path == null) return null;
+ char sep = File.separatorChar;
+ int last = path.length() - 1;
+ int idx = last;
+ int adjacentDots = 0;
+ int nonDotCount = 0;
+ while (idx > 0) {
+ char c = path.charAt(idx);
+ if (c == '.') {
+ if (++adjacentDots >= 2) {
+ // Punt on pathnames containing . and ..
+ return null;
+ }
+ } else if (c == sep) {
+ if (adjacentDots == 1 && nonDotCount == 0) {
+ // Punt on pathnames containing . and ..
+ return null;
+ }
+ if (idx == 0 ||
+ idx >= last - 1 ||
+ path.charAt(idx - 1) == sep) {
+ // Punt on pathnames containing adjacent slashes
+ // toward the end
+ return null;
+ }
+ return path.substring(0, idx);
+ } else {
+ ++nonDotCount;
+ adjacentDots = 0;
+ }
+ --idx;
+ }
+ return null;
+ }
+
+ /* -- Attribute accessors -- */
+
+ public native int getBooleanAttributes0(File f);
+
+ public int getBooleanAttributes(File f) {
+ int rv = getBooleanAttributes0(f);
+ String name = f.getName();
+ boolean hidden = (name.length() > 0) && (name.charAt(0) == '.');
+ return rv | (hidden ? BA_HIDDEN : 0);
+ }
+
+ public native boolean checkAccess(File f, int access);
+ public native long getLastModifiedTime(File f);
+ public native long getLength(File f);
+ public native boolean setPermission(File f, int access, boolean enable, boolean owneronly);
+
+ /* -- File operations -- */
+
+ public native boolean createFileExclusively(String path)
+ throws IOException;
+ public boolean delete(File f) {
+ // Keep canonicalization caches in sync after file deletion
+ // and renaming operations. Could be more clever than this
+ // (i.e., only remove/update affected entries) but probably
+ // not worth it since these entries expire after 30 seconds
+ // anyway.
+ cache.clear();
+ javaHomePrefixCache.clear();
+ return delete0(f);
+ }
+ private native boolean delete0(File f);
+ public native String[] list(File f);
+ public native boolean createDirectory(File f);
+ public boolean rename(File f1, File f2) {
+ // Keep canonicalization caches in sync after file deletion
+ // and renaming operations. Could be more clever than this
+ // (i.e., only remove/update affected entries) but probably
+ // not worth it since these entries expire after 30 seconds
+ // anyway.
+ cache.clear();
+ javaHomePrefixCache.clear();
+ return rename0(f1, f2);
+ }
+ private native boolean rename0(File f1, File f2);
+ public native boolean setLastModifiedTime(File f, long time);
+ public native boolean setReadOnly(File f);
+
+
+ /* -- Filesystem interface -- */
+
+ public File[] listRoots() {
+ try {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ security.checkRead("/");
+ }
+ return new File[] { new File("/") };
+ } catch (SecurityException x) {
+ return new File[0];
+ }
+ }
+
+ /* -- Disk usage -- */
+ public native long getSpace(File f, int t);
+
+ /* -- Basic infrastructure -- */
+
+ public int compare(File f1, File f2) {
+ return f1.getPath().compareTo(f2.getPath());
+ }
+
+ public int hashCode(File f) {
+ return f.getPath().hashCode() ^ 1234321;
+ }
+
+
+ private static native void initIDs();
+
+ static {
+ initIDs();
+ }
+
+}
Modified: trunk/core/src/openjdk/vm/java/io/NativeFileSystem.java
===================================================================
--- trunk/core/src/openjdk/vm/java/io/NativeFileSystem.java 2007-08-31 20:36:35 UTC (rev 3444)
+++ trunk/core/src/openjdk/vm/java/io/NativeFileSystem.java 2007-08-31 20:45:14 UTC (rev 3445)
@@ -13,6 +13,7 @@
*/
public static Object getFileSystem()
{
- return new JNodeFileSystem();
+ //return new JNodeFileSystem();
+ return new UnixFileSystem();
}
}
Added: trunk/core/src/openjdk/vm/java/io/NativeUnixFileSystem.java
===================================================================
--- trunk/core/src/openjdk/vm/java/io/NativeUnixFileSystem.java (rev 0)
+++ trunk/core/src/openjdk/vm/java/io/NativeUnixFileSystem.java 2007-08-31 20:45:14 UTC (rev 3445)
@@ -0,0 +1,120 @@
+/*
+ * $Id$
+ */
+package java.io;
+
+/**
+ * @author Levente S\xE1ntha
+ */
+public class NativeUnixFileSystem {
+ private static String canonicalize0(UnixFileSystem ufs, String path) throws IOException {
+ // note : we expect that the File class from OpenJDK give an absolute path
+ return VMFile.toCanonicalForm(path);
+ }
+
+ private static int getBooleanAttributes0(UnixFileSystem ufs, File f) {
+ int attributes = 0;
+
+ attributes |= (VMFile.exists(f.getPath()) ? FileSystem.BA_EXISTS : 0);
+ attributes |= (VMFile.isFile(f.getPath()) ? FileSystem.BA_REGULAR : 0);
+ attributes |= (VMFile.isDirectory(f.getPath()) ? FileSystem.BA_DIRECTORY : 0);
+ attributes |= (VMFile.isHidden(f.getPath()) ? FileSystem.BA_HIDDEN : 0);
+
+ return attributes;
+ }
+
+ private static boolean checkAccess(UnixFileSystem ufs, File f, int access) {
+ boolean canAccess;
+ if (! VMFile.exists(f.getPath()))
+ return false;
+
+ switch(access)
+ {
+ case FileSystem.ACCESS_READ: canAccess = VMFile.canRead(f.getPath()); break;
+ case FileSystem.ACCESS_WRITE:
+ if (VMFile.isDirectory(f.getPath()))
+ canAccess = VMFile.canWriteDirectory(f);
+ else
+ canAccess = VMFile.canWrite(f.getPath());
+
+ break;
+ case FileSystem.ACCESS_EXECUTE: canAccess = VMFile.canExecute(f.getPath()); break;
+ default: throw new IllegalArgumentException("invalid access : "+access);
+ }
+ return canAccess;
+ }
+
+ private static long getLastModifiedTime(UnixFileSystem ufs, File f) {
+ return VMFile.lastModified(f.getPath());
+ }
+
+ private static long getLength(UnixFileSystem ufs, File f) {
+ return VMFile.length(f.getPath());
+ }
+
+ private static boolean setPermission(UnixFileSystem ufs, File f, int access, boolean enable, boolean owneronly) {
+ boolean success = false;
+ switch(access)
+ {
+ case FileSystem.ACCESS_READ: success = VMFile.setReadable(f.getPath(), enable, owneronly); break;
+ case FileSystem.ACCESS_WRITE: success = VMFile.setWritable(f.getPath(), enable, owneronly); break;
+ case FileSystem.ACCESS_EXECUTE: success = VMFile.setExecutable(f.getPath(), enable, owneronly); break;
+ }
+ return success;
+ }
+
+ private static boolean createFileExclusively(UnixFileSystem ufs, String path) {
+ try {
+ return VMFile.create(path);
+ } catch(IOException ioe){
+ return false;
+ }
+ }
+
+ private static boolean delete0(UnixFileSystem ufs, File f) {
+ return VMFile.delete(f.getPath());
+ }
+
+ private static String[] list(UnixFileSystem ufs, File f) {
+ if (!f.exists() || !f.isDirectory())
+ return null;
+
+ // Get the list of files
+ return VMFile.list(f.getPath());
+ }
+
+ private static boolean createDirectory(UnixFileSystem ufs, File f) {
+ return VMFile.mkdir(f.getPath());
+ }
+
+ private static boolean rename0(UnixFileSystem ufs, File f1, File f2) {
+ return VMFile.renameTo(f1.getPath(), f2.getPath());
+ }
+
+ private static boolean setLastModifiedTime(UnixFileSystem ufs, File f, long time) {
+ return VMFile.setLastModified(f.getPath(), time);
+ }
+
+ private static boolean setReadOnly(UnixFileSystem ufs, File f) {
+ // Test for existence.
+ if (! VMFile.exists(f.getPath()))
+ return false;
+
+ return VMFile.setReadOnly(f.getPath());
+ }
+
+ private static long getSpace(UnixFileSystem ufs, File f, int t) {
+ long space = 0L;
+ switch(t)
+ {
+ case FileSystem.SPACE_TOTAL: space = VMFile.getTotalSpace(f.getPath()); break; //TODO
+ case FileSystem.SPACE_FREE: space = VMFile.getFreeSpace(f.getPath()); break; //TODO
+ case FileSystem.SPACE_USABLE: space = VMFile.getUsableSpace(f.getPath()); break; //TODO
+ }
+ return space;
+ }
+
+ private static void initIDs() {
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 20:36:49
|
Revision: 3444
http://jnode.svn.sourceforge.net/jnode/?rev=3444&view=rev
Author: lsantha
Date: 2007-08-31 13:36:35 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Using new size formatting.
Modified Paths:
--------------
trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java
Modified: trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java 2007-08-31 20:35:20 UTC (rev 3443)
+++ trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java 2007-08-31 20:36:35 UTC (rev 3444)
@@ -56,8 +56,8 @@
throws Exception {
final Runtime rt = Runtime.getRuntime();
- out.println("Memory size: " + NumberUtils.size(rt.totalMemory()));
- out.println("Free memory: " + NumberUtils.size(rt.freeMemory()));
+ out.println("Memory size: " + NumberUtils.toBinaryByte(rt.totalMemory()));
+ out.println("Free memory: " + NumberUtils.toBinaryByte(rt.freeMemory()));
out.println("Starting gc...");
@@ -67,8 +67,8 @@
Thread.yield();
long end = System.currentTimeMillis();
- out.println("Memory size: " + NumberUtils.size(rt.totalMemory()));
- out.println("Free memory: " + NumberUtils.size(rt.freeMemory()));
+ out.println("Memory size: " + NumberUtils.toBinaryByte(rt.totalMemory()));
+ out.println("Free memory: " + NumberUtils.toBinaryByte(rt.freeMemory()));
out.println("Time taken : " + (end-start) + "ms");
out.println("Stats : " + stats.toString());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 20:35:48
|
Revision: 3443
http://jnode.svn.sourceforge.net/jnode/?rev=3443&view=rev
Author: lsantha
Date: 2007-08-31 13:35:20 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Using new size formatting.
Modified Paths:
--------------
trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java
Modified: trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java 2007-08-31 20:30:14 UTC (rev 3442)
+++ trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java 2007-08-31 20:35:20 UTC (rev 3443)
@@ -46,8 +46,8 @@
*/
public void execute(CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) throws Exception {
final Runtime rt = Runtime.getRuntime();
- out.println("Total memory " + NumberUtils.size(rt.totalMemory()));
- out.println("Used memory " + NumberUtils.size(rt.totalMemory() - rt.freeMemory()));
- out.println("Free memory " + NumberUtils.size(rt.freeMemory()));
+ out.println("Total memory " + NumberUtils.toBinaryByte(rt.totalMemory()));
+ out.println("Used memory " + NumberUtils.toBinaryByte(rt.totalMemory() - rt.freeMemory()));
+ out.println("Free memory " + NumberUtils.toBinaryByte(rt.freeMemory()));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 20:30:16
|
Revision: 3442
http://jnode.svn.sourceforge.net/jnode/?rev=3442&view=rev
Author: lsantha
Date: 2007-08-31 13:30:14 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Fixed typo in method name.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/util/NumberUtils.java
Modified: trunk/core/src/core/org/jnode/util/NumberUtils.java
===================================================================
--- trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-31 20:25:54 UTC (rev 3441)
+++ trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-31 20:30:14 UTC (rev 3442)
@@ -229,7 +229,7 @@
* @param v the size to convert
* @return the text for of the size
*/
- public static String toDeciamByte(long v) {
+ public static String toDecimalByte(long v) {
return DecimalPrefix.apply(v) + "B";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 20:25:59
|
Revision: 3441
http://jnode.svn.sourceforge.net/jnode/?rev=3441&view=rev
Author: lsantha
Date: 2007-08-31 13:25:54 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Added support for standard decimal (metric or SI) and binary prefixes.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/util/BinaryPrefix.java
trunk/core/src/core/org/jnode/util/DecimalPrefix.java
trunk/core/src/core/org/jnode/util/NumberUtils.java
trunk/core/src/core/org/jnode/util/SizeUnit.java
Modified: trunk/core/src/core/org/jnode/util/BinaryPrefix.java
===================================================================
--- trunk/core/src/core/org/jnode/util/BinaryPrefix.java 2007-08-31 20:11:03 UTC (rev 3440)
+++ trunk/core/src/core/org/jnode/util/BinaryPrefix.java 2007-08-31 20:25:54 UTC (rev 3441)
@@ -51,7 +51,7 @@
*/
public static String apply(long v) {
for (BinaryPrefix unit : values()) {
- if ((v < 1024) && (v > 0)) {
+ if ((v < 1024) && (v >= 0)) {
return String.valueOf(v) + unit.getUnit();
}
Modified: trunk/core/src/core/org/jnode/util/DecimalPrefix.java
===================================================================
--- trunk/core/src/core/org/jnode/util/DecimalPrefix.java 2007-08-31 20:11:03 UTC (rev 3440)
+++ trunk/core/src/core/org/jnode/util/DecimalPrefix.java 2007-08-31 20:25:54 UTC (rev 3441)
@@ -51,7 +51,7 @@
*/
public static String apply(long v) {
for (DecimalPrefix unit : values()) {
- if ((v < 1000l) && (v > 0l)) {
+ if ((v < 1000l) && (v >= 0l)) {
return String.valueOf(v) + unit.getUnit();
}
Modified: trunk/core/src/core/org/jnode/util/NumberUtils.java
===================================================================
--- trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-31 20:11:03 UTC (rev 3440)
+++ trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-31 20:25:54 UTC (rev 3441)
@@ -211,10 +211,11 @@
* Convert the given value to a size string like 64K
* @param v the size to convert
* @return the text for of the size
+ * @deprecated use toDeciamByte() or toBinaryByte() instead
*/
public static String size(long v) {
for (SizeUnit unit : SizeUnit.values()) {
- if ((v < 1024) && (v > 0)) {
+ if ((v < 1024) && (v >= 0)) {
return String.valueOf(v) + unit.getUnit();
}
@@ -222,6 +223,25 @@
}
return String.valueOf(v >>> 10) + SizeUnit.MAX.getUnit();
}
+
+ /**
+ * Convert the given value to a size string like 64K
+ * @param v the size to convert
+ * @return the text for of the size
+ */
+ public static String toDeciamByte(long v) {
+ return DecimalPrefix.apply(v) + "B";
+ }
+
+ /**
+ * Convert the given value to a size string like 64K
+ * @param v the size to convert
+ * @return the text for of the size
+ */
+ public static String toBinaryByte(long v) {
+ return BinaryPrefix.apply(v) + "B";
+ }
+
/**
*
Modified: trunk/core/src/core/org/jnode/util/SizeUnit.java
===================================================================
--- trunk/core/src/core/org/jnode/util/SizeUnit.java 2007-08-31 20:11:03 UTC (rev 3440)
+++ trunk/core/src/core/org/jnode/util/SizeUnit.java 2007-08-31 20:25:54 UTC (rev 3441)
@@ -3,6 +3,9 @@
import java.math.BigInteger;
import org.jnode.vm.annotation.SharedStatics;
+/**
+ * @deprecated use DecimalPrefix or BinaryPrefix instead.
+ */
@SharedStatics
public enum SizeUnit {
B(1l, "B"),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 20:11:06
|
Revision: 3440
http://jnode.svn.sourceforge.net/jnode/?rev=3440&view=rev
Author: lsantha
Date: 2007-08-31 13:11:03 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Added support for standard decimal (metric or SI) and binary prefixes.
Added Paths:
-----------
trunk/core/src/core/org/jnode/util/BinaryPrefix.java
trunk/core/src/core/org/jnode/util/DecimalPrefix.java
Added: trunk/core/src/core/org/jnode/util/BinaryPrefix.java
===================================================================
--- trunk/core/src/core/org/jnode/util/BinaryPrefix.java (rev 0)
+++ trunk/core/src/core/org/jnode/util/BinaryPrefix.java 2007-08-31 20:11:03 UTC (rev 3440)
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ */
+package org.jnode.util;
+
+import org.jnode.vm.annotation.SharedStatics;
+
+@SharedStatics
+public enum BinaryPrefix {
+ B(1l, ""),
+ K(1024l, "K"),
+ M(1024l*1024l, "M"),
+ G(1024l*1024l*1024l, "G"),
+ T(1024l*1024l*1024l*1024l, "T"),
+ P(1024l*1024l*1024l*1024l*1024l, "P"),
+ E(1024l*1024l*1024l*1024l*1024l*1024l, "E");
+ //these units have too big multipliers to fit in a long
+ // (aka they are greater than 2^64) :
+ //Z(1024l*1024l*1024l*1024l*1024l*1024l*1024l, "Z"),
+ //Y(1024l*1024l*1024l*1024l*1024l*1024l*1024l*1024l, "Y");
+
+ public static final BinaryPrefix MIN = B;
+ public static final BinaryPrefix MAX = E;
+
+ final private long multiplier;
+ final private String unit;
+
+ private BinaryPrefix(long multiplier, String unit)
+ {
+ this.multiplier = multiplier;
+ this.unit = unit;
+ }
+
+ public long getMultiplier() {
+ return multiplier;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public String toString()
+ {
+ return multiplier + ", " + unit;
+ }
+
+ /**
+ * Convert the given value to a size string like 64K
+ * @param v the size to convert
+ * @return the text for of the size
+ */
+ public static String apply(long v) {
+ for (BinaryPrefix unit : values()) {
+ if ((v < 1024) && (v > 0)) {
+ return String.valueOf(v) + unit.getUnit();
+ }
+
+ v = v >>> 10;
+ }
+ return String.valueOf(v >>> 10) + MAX.getUnit();
+ }
+}
Added: trunk/core/src/core/org/jnode/util/DecimalPrefix.java
===================================================================
--- trunk/core/src/core/org/jnode/util/DecimalPrefix.java (rev 0)
+++ trunk/core/src/core/org/jnode/util/DecimalPrefix.java 2007-08-31 20:11:03 UTC (rev 3440)
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ */
+package org.jnode.util;
+
+import org.jnode.vm.annotation.SharedStatics;
+
+@SharedStatics
+public enum DecimalPrefix {
+ B(1l, ""),
+ K(1000l, "k"),
+ M(1000l*1000l, "M"),
+ G(1000l*1000l*1000l, "G"),
+ T(1000l*1000l*1000l*1000l, "T"),
+ P(1000l*1000l*1000l*1000l*1000l, "P"),
+ E(1000l*1000l*1000l*1000l*1000l*1000l, "E");
+ //these units have too big multipliers to fit in a long
+ // (aka they are greater than 2^64) :
+ //Z(1024l*1024l*1024l*1024l*1024l*1024l*1024l, "Z"),
+ //Y(1024l*1024l*1024l*1024l*1024l*1024l*1024l*1024l, "Y");
+
+ public static final DecimalPrefix MIN = B;
+ public static final DecimalPrefix MAX = E;
+
+ final private long multiplier;
+ final private String unit;
+
+ private DecimalPrefix(long multiplier, String unit)
+ {
+ this.multiplier = multiplier;
+ this.unit = unit;
+ }
+
+ public long getMultiplier() {
+ return multiplier;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public String toString()
+ {
+ return multiplier + ", " + unit;
+ }
+
+ /**
+ * Convert the given value to a size string like 64K
+ * @param v the size to convert
+ * @return the text for of the size
+ */
+ public static String apply(long v) {
+ for (DecimalPrefix unit : values()) {
+ if ((v < 1000l) && (v > 0l)) {
+ return String.valueOf(v) + unit.getUnit();
+ }
+
+ v = v / 1000l;
+ }
+ return String.valueOf(v / 1000l) + MAX.getUnit();
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 19:59:53
|
Revision: 3439
http://jnode.svn.sourceforge.net/jnode/?rev=3439&view=rev
Author: lsantha
Date: 2007-08-31 12:59:49 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Fixed size prefix by peda.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/util/NumberUtils.java
Modified: trunk/core/src/core/org/jnode/util/NumberUtils.java
===================================================================
--- trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-29 21:11:15 UTC (rev 3438)
+++ trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-31 19:59:49 UTC (rev 3439)
@@ -206,24 +206,22 @@
return v.toString();
}
}
-
- /**
+
+ /**
* Convert the given value to a size string like 64K
* @param v the size to convert
* @return the text for of the size
*/
- public static String size(long v) {
- for(SizeUnit unit : SizeUnit.values())
- {
- if ((v < unit.getMultiplier()) || SizeUnit.MAX.equals(unit))
- {
- return String.valueOf(v) + unit.getUnit();
- }
-
- v = v >>> 10;
- }
- return String.valueOf(v) + SizeUnit.MAX.getUnit();
- }
+ public static String size(long v) {
+ for (SizeUnit unit : SizeUnit.values()) {
+ if ((v < 1024) && (v > 0)) {
+ return String.valueOf(v) + unit.getUnit();
+ }
+
+ v = v >>> 10;
+ }
+ return String.valueOf(v >>> 10) + SizeUnit.MAX.getUnit();
+ }
/**
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-31 19:38:22
|
Revision: 3431
http://jnode.svn.sourceforge.net/jnode/?rev=3431&view=rev
Author: lsantha
Date: 2007-08-25 13:31:28 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Excluded AnnotateTask.java from the build.
Modified Paths:
--------------
trunk/all/lib/jnode.xml
Modified: trunk/all/lib/jnode.xml
===================================================================
--- trunk/all/lib/jnode.xml 2007-08-25 20:15:42 UTC (rev 3430)
+++ trunk/all/lib/jnode.xml 2007-08-25 20:31:28 UTC (rev 3431)
@@ -14,7 +14,7 @@
target="${java.target}"
source="${java.source}"
encoding="${java.encoding}"
- excludes="**/*-template.java,**/package-info.java">
+ excludes="**/*-template.java,**/package-info.java, **/AnnotateTask.java">
<bootclasspath path="${jnode-core.jar}"/>
<compilerarg value="${compilerarg}"/>
</javac>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2007-08-29 21:11:22
|
Revision: 3438
http://jnode.svn.sourceforge.net/jnode/?rev=3438&view=rev
Author: fduminy
Date: 2007-08-29 14:11:15 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
fixed bug with NumberUtils.size (http://www.jnode.org/node/969)
Modified Paths:
--------------
trunk/core/src/core/org/jnode/util/NumberUtils.java
trunk/core/src/core/org/jnode/util/SizeUnit.java
Modified: trunk/core/src/core/org/jnode/util/NumberUtils.java
===================================================================
--- trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-29 20:40:14 UTC (rev 3437)
+++ trunk/core/src/core/org/jnode/util/NumberUtils.java 2007-08-29 21:11:15 UTC (rev 3438)
@@ -213,17 +213,16 @@
* @return the text for of the size
*/
public static String size(long v) {
- SizeUnit prevUnit = SizeUnit.MIN;
for(SizeUnit unit : SizeUnit.values())
{
- if (v < unit.getMultiplier())
+ if ((v < unit.getMultiplier()) || SizeUnit.MAX.equals(unit))
{
- return String.valueOf(v) + prevUnit.getUnit();
+ return String.valueOf(v) + unit.getUnit();
}
+
v = v >>> 10;
- prevUnit = unit;
}
- return String.valueOf(v) + prevUnit.getUnit();
+ return String.valueOf(v) + SizeUnit.MAX.getUnit();
}
/**
Modified: trunk/core/src/core/org/jnode/util/SizeUnit.java
===================================================================
--- trunk/core/src/core/org/jnode/util/SizeUnit.java 2007-08-29 20:40:14 UTC (rev 3437)
+++ trunk/core/src/core/org/jnode/util/SizeUnit.java 2007-08-29 21:11:15 UTC (rev 3438)
@@ -37,5 +37,8 @@
return unit;
}
-
+ public String toString()
+ {
+ return multiplier + ", " + unit;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2007-08-29 20:40:16
|
Revision: 3437
http://jnode.svn.sourceforge.net/jnode/?rev=3437&view=rev
Author: fduminy
Date: 2007-08-29 13:40:14 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
added missing packages in plugin descriptors
Modified Paths:
--------------
trunk/core/descriptors/org.classpath.ext.core.xml
trunk/core/descriptors/org.classpath.ext.xml.xml
Modified: trunk/core/descriptors/org.classpath.ext.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.core.xml 2007-08-27 21:43:33 UTC (rev 3436)
+++ trunk/core/descriptors/org.classpath.ext.core.xml 2007-08-29 20:40:14 UTC (rev 3437)
@@ -65,6 +65,16 @@
<export name="java.util.concurrent.locks.*"/>
<export name="javax.accessibility.*"/>
+ <export name="javax.activation.*"/>
+ <export name="javax.activity.*"/>
+ <export name="javax.annotation.*"/>
+ <export name="javax.annotation.processing.*"/>
+ <export name="javax.jws.*"/>
+ <export name="javax.jws.soap.*"/>
+ <export name="javax.lang.model.*"/>
+ <export name="javax.lang.model.element.*"/>
+ <export name="javax.lang.model.type.*"/>
+ <export name="javax.lang.model.util.*"/>
<export name="javax.management.*"/>
<export name="javax.naming.*"/>
<export name="javax.naming.directory.*"/>
@@ -79,6 +89,8 @@
<export name="javax.script.*"/>
+ <export name="javax.tools.*"/>
+
<export name="sun.audio.*"/>
<export name="sun.security.*"/>
Modified: trunk/core/descriptors/org.classpath.ext.xml.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.xml.xml 2007-08-27 21:43:33 UTC (rev 3436)
+++ trunk/core/descriptors/org.classpath.ext.xml.xml 2007-08-29 20:40:14 UTC (rev 3437)
@@ -135,21 +135,44 @@
<export name="com.sun.xml.internal.stream.*"/>
<export name="javax.xml.*"/>
+ <export name="javax.xml.bind.*"/>
+ <export name="javax.xml.bind.annotation.*"/>
+ <export name="javax.xml.bind.annotation.adapters.*"/>
+ <export name="javax.xml.bind.attachment.*"/>
+ <export name="javax.xml.bind.helpers.*"/>
+ <export name="javax.xml.bind.util.*"/>
+ <export name="javax.xml.crypto.*"/>
+ <export name="javax.xml.crypto.dom.*"/>
+ <export name="javax.xml.crypto.dsig.*"/>
+ <export name="javax.xml.crypto.dsig.dom.*"/>
+ <export name="javax.xml.crypto.dsig.keyinfo.*"/>
+ <export name="javax.xml.crypto.dsig.spec.*"/>
<export name="javax.xml.datatype.*"/>
<export name="javax.xml.namespace.*"/>
<export name="javax.xml.parsers.*"/>
+ <export name="javax.xml.soap.*"/>
<export name="javax.xml.transform.*"/>
<export name="javax.xml.transform.dom.*"/>
<export name="javax.xml.transform.sax.*"/>
<export name="javax.xml.transform.stax.*"/>
<export name="javax.xml.transform.stream.*"/>
<export name="javax.xml.validation.*"/>
+ <export name="javax.xml.ws.*"/>
+ <export name="javax.xml.ws.handler.*"/>
+ <export name="javax.xml.ws.handler.soap.*"/>
+ <export name="javax.xml.ws.http.*"/>
+ <export name="javax.xml.ws.soap.*"/>
+ <export name="javax.xml.ws.spi.*"/>
<export name="javax.xml.xpath.*"/>
+
+ <export name="org.jcp.xml.dsig.internal.*"/>
+ <export name="org.jcp.xml.dsig.internal.dom.*"/>
<export name="org.relaxng.datatype.*"/>
<export name="org.relaxng.datatype.helpers.*"/>
<export name="org.w3c.dom.css.*"/>
<export name="org.w3c.dom.events.*"/>
+ <export name="org.w3c.dom.html.*"/>
<export name="org.w3c.dom.ranges.*"/>
<export name="org.w3c.dom.stylesheets.*"/>
<export name="org.w3c.dom.traversal.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 22:15:16
|
Revision: 3405
http://jnode.svn.sourceforge.net/jnode/?rev=3405&view=rev
Author: lsantha
Date: 2007-08-25 01:13:51 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/javax/javax/xml/parsers/
trunk/core/src/classpath/javax/javax/xml/transform/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2007-08-27 21:43:38
|
Revision: 3436
http://jnode.svn.sourceforge.net/jnode/?rev=3436&view=rev
Author: fduminy
Date: 2007-08-27 14:43:33 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
added missing packages
Modified Paths:
--------------
trunk/core/descriptors/org.classpath.ext.sql.xml
trunk/core/descriptors/org.classpath.ext.xml
Modified: trunk/core/descriptors/org.classpath.ext.sql.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.sql.xml 2007-08-27 21:41:12 UTC (rev 3435)
+++ trunk/core/descriptors/org.classpath.ext.sql.xml 2007-08-27 21:43:33 UTC (rev 3436)
@@ -12,8 +12,13 @@
<runtime>
<library name="jnode-core.jar">
- <export name="java.sql.*"/>
+ <export name="java.sql.*"/>
+
<export name="javax.sql.*"/>
+ <export name="javax.sql.rowset.*"/>
+ <export name="javax.sql.rowset.serial.*"/>
+ <export name="javax.sql.rowset.spi.*"/>
+
<export name="javax.transaction.*"/>
<export name="javax.transaction.xa.*"/>
</library>
Modified: trunk/core/descriptors/org.classpath.ext.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.xml 2007-08-27 21:41:12 UTC (rev 3435)
+++ trunk/core/descriptors/org.classpath.ext.xml 2007-08-27 21:43:33 UTC (rev 3436)
@@ -33,6 +33,7 @@
<export name="javax.security.auth.callback.*"/>
<export name="javax.security.auth.login.*"/>
<export name="javax.security.auth.spi.*"/>
+ <export name="javax.security.auth.kerberos.*"/>
<export name="javax.security.cert.*"/>
<export name="javax.security.sasl.*"/>
@@ -44,6 +45,8 @@
<export name="javax.swing.plaf.*"/>
<export name="javax.swing.plaf.basic.*"/>
<export name="javax.swing.plaf.metal.*"/>
+ <export name="javax.swing.plaf.multi.*"/>
+ <export name="javax.swing.plaf.synth.*"/>
<export name="javax.swing.table.*"/>
<export name="javax.swing.text.*"/>
<export name="javax.swing.text.html.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2007-08-27 21:41:18
|
Revision: 3435
http://jnode.svn.sourceforge.net/jnode/?rev=3435&view=rev
Author: fduminy
Date: 2007-08-27 14:41:12 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
openjdk integration : sound APIs
Modified Paths:
--------------
trunk/core/descriptors/org.classpath.ext.core.xml
Added Paths:
-----------
trunk/core/src/icedtea/com/sun/media/sound/AbstractPlayer.java
trunk/core/src/icedtea/com/sun/media/sound/AutoConnectSequencer.java
trunk/core/src/icedtea/com/sun/media/sound/DataPusher.java
trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDevice.java
trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDeviceProvider.java
trunk/core/src/icedtea/com/sun/media/sound/HeadspaceMixer.java
trunk/core/src/icedtea/com/sun/media/sound/HeadspaceSoundbank.java
trunk/core/src/icedtea/com/sun/media/sound/JDK13Services.java
trunk/core/src/icedtea/com/sun/media/sound/MidiInDevice.java
trunk/core/src/icedtea/com/sun/media/sound/MidiInDeviceProvider.java
trunk/core/src/icedtea/com/sun/media/sound/MidiOutDevice.java
trunk/core/src/icedtea/com/sun/media/sound/MidiOutDeviceProvider.java
trunk/core/src/icedtea/com/sun/media/sound/MidiUtils.java
trunk/core/src/icedtea/com/sun/media/sound/MixerClip.java
trunk/core/src/icedtea/com/sun/media/sound/MixerMidiChannel.java
trunk/core/src/icedtea/com/sun/media/sound/MixerSequencer.java
trunk/core/src/icedtea/com/sun/media/sound/MixerSourceLine.java
trunk/core/src/icedtea/com/sun/media/sound/MixerSynth.java
trunk/core/src/icedtea/com/sun/media/sound/MixerThread.java
trunk/core/src/icedtea/com/sun/media/sound/Platform.java
trunk/core/src/icedtea/com/sun/media/sound/PortMixer.java
trunk/core/src/icedtea/com/sun/media/sound/PortMixerProvider.java
trunk/core/src/icedtea/com/sun/media/sound/ReferenceCountingDevice.java
trunk/core/src/icedtea/com/sun/media/sound/SimpleInputDevice.java
trunk/core/src/icedtea/com/sun/media/sound/SimpleInputDeviceProvider.java
trunk/core/src/icedtea/com/sun/media/sound/Toolkit.java
trunk/core/src/openjdk/javax/javax/sound/
trunk/core/src/openjdk/javax/javax/sound/midi/
trunk/core/src/openjdk/javax/javax/sound/midi/ControllerEventListener.java
trunk/core/src/openjdk/javax/javax/sound/midi/Instrument.java
trunk/core/src/openjdk/javax/javax/sound/midi/InvalidMidiDataException.java
trunk/core/src/openjdk/javax/javax/sound/midi/MetaEventListener.java
trunk/core/src/openjdk/javax/javax/sound/midi/MetaMessage.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiChannel.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiDevice.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiEvent.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiFileFormat.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiMessage.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiSystem.java
trunk/core/src/openjdk/javax/javax/sound/midi/MidiUnavailableException.java
trunk/core/src/openjdk/javax/javax/sound/midi/Patch.java
trunk/core/src/openjdk/javax/javax/sound/midi/Receiver.java
trunk/core/src/openjdk/javax/javax/sound/midi/Sequence.java
trunk/core/src/openjdk/javax/javax/sound/midi/Sequencer.java
trunk/core/src/openjdk/javax/javax/sound/midi/ShortMessage.java
trunk/core/src/openjdk/javax/javax/sound/midi/Soundbank.java
trunk/core/src/openjdk/javax/javax/sound/midi/SoundbankResource.java
trunk/core/src/openjdk/javax/javax/sound/midi/Synthesizer.java
trunk/core/src/openjdk/javax/javax/sound/midi/SysexMessage.java
trunk/core/src/openjdk/javax/javax/sound/midi/Track.java
trunk/core/src/openjdk/javax/javax/sound/midi/Transmitter.java
trunk/core/src/openjdk/javax/javax/sound/midi/VoiceStatus.java
trunk/core/src/openjdk/javax/javax/sound/midi/package.html
trunk/core/src/openjdk/javax/javax/sound/midi/spi/
trunk/core/src/openjdk/javax/javax/sound/midi/spi/MidiDeviceProvider.java
trunk/core/src/openjdk/javax/javax/sound/midi/spi/MidiFileReader.java
trunk/core/src/openjdk/javax/javax/sound/midi/spi/MidiFileWriter.java
trunk/core/src/openjdk/javax/javax/sound/midi/spi/SoundbankReader.java
trunk/core/src/openjdk/javax/javax/sound/midi/spi/package.html
trunk/core/src/openjdk/javax/javax/sound/sampled/
trunk/core/src/openjdk/javax/javax/sound/sampled/AudioFileFormat.java
trunk/core/src/openjdk/javax/javax/sound/sampled/AudioFormat.java
trunk/core/src/openjdk/javax/javax/sound/sampled/AudioInputStream.java
trunk/core/src/openjdk/javax/javax/sound/sampled/AudioPermission.java
trunk/core/src/openjdk/javax/javax/sound/sampled/AudioSystem.java
trunk/core/src/openjdk/javax/javax/sound/sampled/BooleanControl.java
trunk/core/src/openjdk/javax/javax/sound/sampled/Clip.java
trunk/core/src/openjdk/javax/javax/sound/sampled/CompoundControl.java
trunk/core/src/openjdk/javax/javax/sound/sampled/Control.java
trunk/core/src/openjdk/javax/javax/sound/sampled/DataLine.java
trunk/core/src/openjdk/javax/javax/sound/sampled/EnumControl.java
trunk/core/src/openjdk/javax/javax/sound/sampled/FloatControl.java
trunk/core/src/openjdk/javax/javax/sound/sampled/Line.java
trunk/core/src/openjdk/javax/javax/sound/sampled/LineEvent.java
trunk/core/src/openjdk/javax/javax/sound/sampled/LineListener.java
trunk/core/src/openjdk/javax/javax/sound/sampled/LineUnavailableException.java
trunk/core/src/openjdk/javax/javax/sound/sampled/Mixer.java
trunk/core/src/openjdk/javax/javax/sound/sampled/Port.java
trunk/core/src/openjdk/javax/javax/sound/sampled/ReverbType.java
trunk/core/src/openjdk/javax/javax/sound/sampled/SourceDataLine.java
trunk/core/src/openjdk/javax/javax/sound/sampled/TargetDataLine.java
trunk/core/src/openjdk/javax/javax/sound/sampled/UnsupportedAudioFileException.java
trunk/core/src/openjdk/javax/javax/sound/sampled/package.html
trunk/core/src/openjdk/javax/javax/sound/sampled/spi/
trunk/core/src/openjdk/javax/javax/sound/sampled/spi/AudioFileReader.java
trunk/core/src/openjdk/javax/javax/sound/sampled/spi/AudioFileWriter.java
trunk/core/src/openjdk/javax/javax/sound/sampled/spi/FormatConversionProvider.java
trunk/core/src/openjdk/javax/javax/sound/sampled/spi/MixerProvider.java
trunk/core/src/openjdk/javax/javax/sound/sampled/spi/package.html
trunk/core/src/openjdk/sun/sun/audio/
trunk/core/src/openjdk/sun/sun/audio/AudioData.java
trunk/core/src/openjdk/sun/sun/audio/AudioDataStream.java
trunk/core/src/openjdk/sun/sun/audio/AudioDevice.java
trunk/core/src/openjdk/sun/sun/audio/AudioPlayer.java
trunk/core/src/openjdk/sun/sun/audio/AudioSecurityAction.java
trunk/core/src/openjdk/sun/sun/audio/AudioSecurityExceptionAction.java
trunk/core/src/openjdk/sun/sun/audio/AudioStream.java
trunk/core/src/openjdk/sun/sun/audio/AudioStreamSequence.java
trunk/core/src/openjdk/sun/sun/audio/AudioTranslatorStream.java
trunk/core/src/openjdk/sun/sun/audio/ContinuousAudioDataStream.java
trunk/core/src/openjdk/sun/sun/audio/InvalidAudioFormatException.java
trunk/core/src/openjdk/sun/sun/audio/NativeAudioStream.java
Removed Paths:
-------------
trunk/core/src/classpath/javax/javax/sound/
Modified: trunk/core/descriptors/org.classpath.ext.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.core.xml 2007-08-26 09:11:46 UTC (rev 3434)
+++ trunk/core/descriptors/org.classpath.ext.core.xml 2007-08-27 21:41:12 UTC (rev 3435)
@@ -13,6 +13,8 @@
<runtime>
<library name="jnode-core.jar">
+ <export name="com.sun.media.sound.*"/>
+
<export name="gnu.classpath.*"/>
<export name="gnu.java.awt.*"/>
@@ -70,11 +72,15 @@
<export name="javax.naming.ldap.*"/>
<export name="javax.naming.spi.*"/>
+ <export name="javax.sound.midi.*"/>
+ <export name="javax.sound.midi.spi.*"/>
<export name="javax.sound.sampled.*"/>
<export name="javax.sound.sampled.spi.*"/>
<export name="javax.script.*"/>
+ <export name="sun.audio.*"/>
+
<export name="sun.security.*"/>
<export name="sun.security.util.*"/>
Added: trunk/core/src/icedtea/com/sun/media/sound/AbstractPlayer.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/AbstractPlayer.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/AbstractPlayer.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* AbstractPlayer.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class AbstractPlayer
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/AutoConnectSequencer.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/AutoConnectSequencer.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/AutoConnectSequencer.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,50 @@
+/* AutoConnectSequencer.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+import javax.sound.midi.Receiver;
+
+public class AutoConnectSequencer {
+
+ public void setAutoConnect(Receiver rec) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/core/src/icedtea/com/sun/media/sound/DataPusher.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/DataPusher.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/DataPusher.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,62 @@
+/* DataPusher.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.SourceDataLine;
+
+public class DataPusher {
+
+ public DataPusher(SourceDataLine sourcedataline, AudioInputStream as) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated constructor stub
+ }
+
+ public void stop() {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+ public void start() {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDevice.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDevice.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDevice.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* DirectAudioDevice.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class DirectAudioDevice
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDeviceProvider.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDeviceProvider.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/DirectAudioDeviceProvider.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* DirectAudioDeviceProvider.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class DirectAudioDeviceProvider
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/HeadspaceMixer.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/HeadspaceMixer.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/HeadspaceMixer.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,44 @@
+/* HeadspaceMixer.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class HeadspaceMixer
+{
+
+}
+
Added: trunk/core/src/icedtea/com/sun/media/sound/HeadspaceSoundbank.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/HeadspaceSoundbank.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/HeadspaceSoundbank.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* HeadspaceSoundbank.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class HeadspaceSoundbank
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/JDK13Services.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/JDK13Services.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/JDK13Services.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,62 @@
+/* JDK13Services.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+import java.util.List;
+
+public class JDK13Services {
+
+ public static String getDefaultProviderClassName(Class deviceClass) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+ public static String getDefaultInstanceName(Class deviceClass) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List getProviders(Class providerClass) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/core/src/icedtea/com/sun/media/sound/MidiInDevice.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MidiInDevice.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MidiInDevice.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* MidiInDevice.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MidiInDevice
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MidiInDeviceProvider.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MidiInDeviceProvider.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MidiInDeviceProvider.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* MidiInDeviceProvider.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MidiInDeviceProvider
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MidiOutDevice.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MidiOutDevice.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MidiOutDevice.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,44 @@
+/* MidiOutDevice.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MidiOutDevice
+{
+
+}
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MidiOutDeviceProvider.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MidiOutDeviceProvider.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MidiOutDeviceProvider.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* MidiOutDeviceProvider.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MidiOutDeviceProvider
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MidiUtils.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MidiUtils.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MidiUtils.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,59 @@
+/* MidiUtils.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.Sequence;
+
+public class MidiUtils {
+
+ public static final byte META_END_OF_TRACK_TYPE = 0;
+
+ public static long tick2microsecond(Sequence sequence, long tickLength, Object object) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+ public static boolean isMetaEndOfTrack(MidiMessage message) {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/core/src/icedtea/com/sun/media/sound/MixerClip.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MixerClip.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MixerClip.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,44 @@
+/* MixerClip.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MixerClip
+{
+
+}
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MixerMidiChannel.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MixerMidiChannel.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MixerMidiChannel.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* MixerMidiChannel.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MixerMidiChannel
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MixerSequencer.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MixerSequencer.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MixerSequencer.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* MixerSequencer.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MixerSequencer
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MixerSourceLine.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MixerSourceLine.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MixerSourceLine.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,44 @@
+/* MixerSourceLine.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MixerSourceLine
+{
+
+}
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MixerSynth.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MixerSynth.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MixerSynth.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* MixerSynth.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MixerSynth
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/MixerThread.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/MixerThread.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/MixerThread.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,44 @@
+/* MixerThread.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class MixerThread
+{
+
+}
+
Added: trunk/core/src/icedtea/com/sun/media/sound/Platform.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/Platform.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/Platform.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* Platform.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class Platform
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/PortMixer.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/PortMixer.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/PortMixer.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* PortMixer.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class PortMixer
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/PortMixerProvider.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/PortMixerProvider.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/PortMixerProvider.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,45 @@
+/* PortMixerProvider.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+public class PortMixerProvider
+{
+
+}
+
+
Added: trunk/core/src/icedtea/com/sun/media/sound/ReferenceCountingDevice.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/ReferenceCountingDevice.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/ReferenceCountingDevice.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,57 @@
+/* ReferenceCountingDevice.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package com.sun.media.sound;
+
+import javax.sound.midi.Receiver;
+import javax.sound.midi.Transmitter;
+
+public class ReferenceCountingDevice {
+
+ public Receiver getReceiverReferenceCounting() {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+ public Transmitter getTransmitterReferenceCounting() {
+ throw new RuntimeException("Not implemented.");
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/core/src/icedtea/com/sun/media/sound/SimpleInputDevice.java
===================================================================
--- trunk/core/src/icedtea/com/sun/media/sound/SimpleInputDevice.java (rev 0)
+++ trunk/core/src/icedtea/com/sun/media/sound/SimpleInputDevice.java 2007-08-27 21:41:12 UTC (rev 3435)
@@ -0,0 +1,44 @@
+/* SimpleInputDevice.java -- stub file.
+ Copyright (C) 2007 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holder...
[truncated message content] |
|
From: <ls...@us...> - 2007-08-27 19:58:35
|
Revision: 3410
http://jnode.svn.sourceforge.net/jnode/?rev=3410&view=rev
Author: lsantha
Date: 2007-08-25 02:47:56 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/sun/sun/tools/jar/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 19:43:28
|
Revision: 3409
http://jnode.svn.sourceforge.net/jnode/?rev=3409&view=rev
Author: lsantha
Date: 2007-08-25 02:26:05 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/gnu/gnu/xml/stream/
trunk/core/src/classpath/gnu/gnu/xml/validation/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 19:42:11
|
Revision: 3407
http://jnode.svn.sourceforge.net/jnode/?rev=3407&view=rev
Author: lsantha
Date: 2007-08-25 02:23:55 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/javax/javax/xml/XMLConstants.java
trunk/core/src/openjdk/javax/javax/xml/datatype/
trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConfigurationException.java
trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConstants.java
trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeFactory.java
trunk/core/src/openjdk/javax/javax/xml/datatype/Duration.java
trunk/core/src/openjdk/javax/javax/xml/datatype/FactoryFinder.java
trunk/core/src/openjdk/javax/javax/xml/datatype/SecuritySupport.java
trunk/core/src/openjdk/javax/javax/xml/datatype/XMLGregorianCalendar.java
trunk/core/src/openjdk/javax/javax/xml/datatype/package.html
trunk/core/src/openjdk/javax/javax/xml/namespace/
trunk/core/src/openjdk/javax/javax/xml/namespace/NamespaceContext.java
trunk/core/src/openjdk/javax/javax/xml/namespace/QName.java
trunk/core/src/openjdk/javax/javax/xml/namespace/package.html
trunk/core/src/openjdk/javax/javax/xml/package.html
trunk/core/src/openjdk/javax/javax/xml/validation/
trunk/core/src/openjdk/javax/javax/xml/validation/Schema.java
trunk/core/src/openjdk/javax/javax/xml/validation/SchemaFactory.java
trunk/core/src/openjdk/javax/javax/xml/validation/SchemaFactoryFinder.java
trunk/core/src/openjdk/javax/javax/xml/validation/SchemaFactoryLoader.java
trunk/core/src/openjdk/javax/javax/xml/validation/SecuritySupport.java
trunk/core/src/openjdk/javax/javax/xml/validation/TypeInfoProvider.java
trunk/core/src/openjdk/javax/javax/xml/validation/Validator.java
trunk/core/src/openjdk/javax/javax/xml/validation/ValidatorHandler.java
trunk/core/src/openjdk/javax/javax/xml/validation/package.html
trunk/core/src/openjdk/javax/javax/xml/xpath/
trunk/core/src/openjdk/javax/javax/xml/xpath/SecuritySupport.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPath.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathConstants.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathException.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathExpression.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathExpressionException.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathFactory.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathFactoryConfigurationException.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathFactoryFinder.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathFunction.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathFunctionException.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathFunctionResolver.java
trunk/core/src/openjdk/javax/javax/xml/xpath/XPathVariableResolver.java
trunk/core/src/openjdk/javax/javax/xml/xpath/package.html
Added: trunk/core/src/openjdk/javax/javax/xml/XMLConstants.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/XMLConstants.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/XMLConstants.java 2007-08-25 09:23:55 UTC (rev 3407)
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml;
+
+/**
+ * <p>Utility class to contain basic XML values as constants.</p>
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @version $Revision: 1.2 $, $Date: 2005/06/10 03:50:26 $
+ * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a>
+ * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a>
+ * @see <a href="http://www.w3.org/XML/xml-V10-2e-errata">XML 1.0 Second Edition Specification Errata</a>
+ * @see <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</a>
+ * @see <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a>
+ * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a>
+ * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a>
+ * @since 1.5
+ **/
+
+public final class XMLConstants {
+
+ /**
+ * <p>Private constructor to prevent instantiation.</p>
+ */
+ private XMLConstants() {
+ }
+
+ /**
+ * <p>Namespace URI to use to represent that there is no Namespace.</p>
+ *
+ * <p>Defined by the Namespace specification to be "".</p>
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting">
+ * Namespaces in XML, 5.2 Namespace Defaulting</a>
+ */
+ public static final String NULL_NS_URI = "";
+
+ /**
+ * <p>Prefix to use to represent the default XML Namespace.</p>
+ *
+ * <p>Defined by the XML specification to be "".</p>
+ *
+ * @see <a
+ * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
+ * Namespaces in XML, 3. Qualified Names</a>
+ */
+ public static final String DEFAULT_NS_PREFIX = "";
+
+ /**
+ * <p>The official XML Namespace name URI.</p>
+ *
+ * <p>Defined by the XML specification to be
+ * "<code>http://www.w3.org/XML/1998/namespace</code>".</p>
+ *
+ * @see <a
+ * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
+ * Namespaces in XML, 3. Qualified Names</a>
+ */
+ public static final String XML_NS_URI =
+ "http://www.w3.org/XML/1998/namespace";
+
+ /**
+ * <p>The official XML Namespace prefix.</p>
+ *
+ * <p>Defined by the XML specification to be "<code>xml</code>".</p>
+ *
+ * @see <a
+ * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
+ * Namespaces in XML, 3. Qualified Names<</a>
+ */
+ public static final String XML_NS_PREFIX = "xml";
+
+ /**
+ * <p>The official XML attribute used for specifying XML Namespace
+ * declarations, {@link #XMLNS_ATTRIBUTE
+ * XMLConstants.XMLNS_ATTRIBUTE}, Namespace name URI.</p>
+ *
+ * <p>Defined by the XML specification to be
+ * "<code>http://www.w3.org/2000/xmlns/</code>".</p>
+ *
+ * @see <a
+ * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
+ * Namespaces in XML, 3. Qualified Names</a>
+ * @see <a
+ * href="http://www.w3.org/XML/xml-names-19990114-errata/">
+ * Namespaces in XML Errata</a>
+ */
+ public static final String XMLNS_ATTRIBUTE_NS_URI =
+ "http://www.w3.org/2000/xmlns/";
+
+ /**
+ * <p>The official XML attribute used for specifying XML Namespace
+ * declarations.</p>
+ *
+ * <p>It is <strong><em>NOT</em></strong> valid to use as a
+ * prefix. Defined by the XML specification to be
+ * "<code>xmlns</code>".</p>
+ *
+ * @see <a
+ * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
+ * Namespaces in XML, 3. Qualified Names</a>
+ */
+ public static final String XMLNS_ATTRIBUTE = "xmlns";
+
+ /**
+ * <p>W3C XML Schema Namespace URI.</p>
+ *
+ * <p>Defined to be "<code>http://www.w3.org/2001/XMLSchema</code>".
+ *
+ * @see <a href=
+ * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ * XML Schema Part 1:
+ * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a>
+ */
+ public static final String W3C_XML_SCHEMA_NS_URI =
+ "http://www.w3.org/2001/XMLSchema";
+
+ /**
+ * <p>W3C XML Schema Instance Namespace URI.</p>
+ *
+ * <p>Defined to be "<code>http://www.w3.org/2001/XMLSchema-instance</code>".</p>
+ *
+ * @see <a href=
+ * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ * XML Schema Part 1:
+ * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a>
+ */
+ public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI =
+ "http://www.w3.org/2001/XMLSchema-instance";
+
+ /**
+ * <p>W3C XPath Datatype Namespace URI.</p>
+ *
+ * <p>Defined to be "<code>http://www.w3.org/2003/11/xpath-datatypes</code>".</p>
+ *
+ * @see <a href="http://www.w3.org/TR/xpath-datamodel">XQuery 1.0 and XPath 2.0 Data Model</a>
+ */
+ public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes";
+
+ /**
+ * <p>XML Document Type Declaration Namespace URI as an arbitrary value.</p>
+ *
+ * <p>Since not formally defined by any existing standard, arbitrarily define to be "<code>http://www.w3.org/TR/REC-xml</code>".
+ */
+ public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";
+
+ /**
+ * <p>RELAX NG Namespace URI.</p>
+ *
+ * <p>Defined to be "<code>http://relaxng.org/ns/structure/1.0</code>".</p>
+ *
+ * @see <a href="http://relaxng.org/spec-20011203.html">RELAX NG Specification</a>
+ */
+ public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0";
+
+ /**
+ * <p>Feature for secure processing.</p>
+ *
+ * <ul>
+ * <li>
+ * <code>true</code> instructs the implementation to process XML securely.
+ * This may set limits on XML constructs to avoid conditions such as denial of service attacks.
+ * </li>
+ * <li>
+ * <code>false</code> instructs the implementation to process XML acording the letter of the XML specifications
+ * ingoring security issues such as limits on XML constructs to avoid conditions such as denial of service attacks.
+ * </li>
+ * </ul>
+ */
+ public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
+}
Added: trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConfigurationException.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConfigurationException.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConfigurationException.java 2007-08-25 09:23:55 UTC (rev 3407)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.datatype;
+
+/**
+ * <p>Indicates a serious configuration error.</p>
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @version $Revision: 1.3 $, $Date: 2005/09/14 21:57:16 $
+ * @since 1.5
+ */
+
+public class DatatypeConfigurationException extends Exception {
+
+ /**
+ * <p>Create a new <code>DatatypeConfigurationException</code> with
+ * no specified detail mesage and cause.</p>
+ */
+
+ public DatatypeConfigurationException() {
+ super();
+ }
+
+ /**
+ * <p>Create a new <code>DatatypeConfigurationException</code> with
+ * the specified detail message.</p>
+ *
+ * @param message The detail message.
+ */
+
+ public DatatypeConfigurationException(String message) {
+ super(message);
+ }
+
+ /**
+ * <p>Create a new <code>DatatypeConfigurationException</code> with
+ * the specified detail message and cause.</p>
+ *
+ * @param message The detail message.
+ * @param cause The cause. A <code>null</code> value is permitted, and indicates that the cause is nonexistent or unknown.
+ */
+
+ public DatatypeConfigurationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * <p>Create a new <code>DatatypeConfigurationException</code> with
+ * the specified cause.</p>
+ *
+ * @param cause The cause. A <code>null</code> value is permitted, and indicates that the cause is nonexistent or unknown.
+ */
+
+ public DatatypeConfigurationException(Throwable cause) {
+ super(cause);
+ }
+}
Added: trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConstants.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConstants.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeConstants.java 2007-08-25 09:23:55 UTC (rev 3407)
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.datatype;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
+/**
+ * <p>Utility class to contain basic Datatype values as constants.</p>
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @version $Revision: 1.4 $, $Date: 2006/01/24 01:23:06 $
+ * @since 1.5
+ */
+
+public final class DatatypeConstants {
+
+ /**
+ * <p>Private constructor to prevent instantiation.</p>
+ */
+ private DatatypeConstants() {
+ }
+
+ /**
+ * Value for first month of year.
+ */
+ public static final int JANUARY = 1;
+
+ /**
+ * Value for second month of year.
+ */
+ public static final int FEBRUARY = 2;
+
+ /**
+ * Value for third month of year.
+ */
+ public static final int MARCH = 3;
+
+ /**
+ * Value for fourth month of year.
+ */
+ public static final int APRIL = 4;
+
+ /**
+ * Value for fifth month of year.
+ */
+ public static final int MAY = 5;
+
+ /**
+ * Value for sixth month of year.
+ */
+ public static final int JUNE = 6;
+
+ /**
+ * Value for seventh month of year.
+ */
+ public static final int JULY = 7;
+
+ /**
+ * Value for eighth month of year.
+ */
+ public static final int AUGUST = 8;
+
+ /**
+ * Value for ninth month of year.
+ */
+ public static final int SEPTEMBER = 9;
+
+ /**
+ * Value for tenth month of year.
+ */
+ public static final int OCTOBER = 10;
+
+ /**
+ * Value for eleven month of year.
+ */
+ public static final int NOVEMBER = 11;
+
+ /**
+ * Value for twelve month of year.
+ */
+ public static final int DECEMBER = 12;
+
+ /**
+ * <p>Comparison result.</p>
+ */
+ public static final int LESSER = -1;
+
+ /**
+ * <p>Comparison result.</p>
+ */
+ public static final int EQUAL = 0;
+
+ /**
+ * <p>Comparison result.</p>
+ */
+ public static final int GREATER = 1;
+
+ /**
+ * <p>Comparison result.</p>
+ */
+ public static final int INDETERMINATE = 2;
+
+ /**
+ * Designation that an "int" field is not set.
+ */
+ public static final int FIELD_UNDEFINED = Integer.MIN_VALUE;
+
+ /**
+ * <p>A constant that represents the years field.</p>
+ */
+ public static final Field YEARS = new Field("YEARS", 0);
+
+ /**
+ * <p>A constant that represents the months field.</p>
+ */
+ public static final Field MONTHS = new Field("MONTHS", 1);
+
+ /**
+ * <p>A constant that represents the days field.</p>
+ */
+ public static final Field DAYS = new Field("DAYS", 2);
+
+ /**
+ * <p>A constant that represents the hours field.</p>
+ */
+ public static final Field HOURS = new Field("HOURS", 3);
+
+ /**
+ * <p>A constant that represents the minutes field.</p>
+ */
+ public static final Field MINUTES = new Field("MINUTES", 4);
+
+ /**
+ * <p>A constant that represents the seconds field.</p>
+ */
+ public static final Field SECONDS = new Field("SECONDS", 5);
+
+ /**
+ * Type-safe enum class that represents six fields
+ * of the {@link Duration} class.
+ * @since 1.5
+ */
+ public static final class Field {
+
+ /**
+ * <p><code>String</code> representation of <code>Field</code>.</p>
+ */
+ private final String str;
+ /**
+ * <p>Unique id of the field.</p>
+ *
+ * <p>This value allows the {@link Duration} class to use switch
+ * statements to process fields.</p>
+ */
+ private final int id;
+
+ /**
+ * <p>Construct a <code>Field</code> with specified values.</p>
+ * @param str <code>String</code> representation of <code>Field</code>
+ * @param id <code>int</code> representation of <code>Field</code>
+ */
+ private Field(final String str, final int id) {
+ this.str = str;
+ this.id = id;
+ }
+ /**
+ * Returns a field name in English. This method
+ * is intended to be used for debugging/diagnosis
+ * and not for display to end-users.
+ *
+ * @return
+ * a non-null valid String constant.
+ */
+ public String toString() { return str; }
+
+ /**
+ * <p>Get id of this Field.</p>
+ *
+ * @return Id of field.
+ */
+ public int getId() {
+ return id;
+ }
+ }
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>dateTime</code>.</p>
+ */
+ public static final QName DATETIME = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "dateTime");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>time</code>.</p>
+ */
+ public static final QName TIME = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "time");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>date</code>.</p>
+ */
+ public static final QName DATE = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "date");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gYearMonth</code>.</p>
+ */
+ public static final QName GYEARMONTH = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gYearMonth");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gMonthDay</code>.</p>
+ */
+ public static final QName GMONTHDAY = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gMonthDay");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gYear</code>.</p>
+ */
+ public static final QName GYEAR = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gYear");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gMonth</code>.</p>
+ */
+ public static final QName GMONTH = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gMonth");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gDay</code>.</p>
+ */
+ public static final QName GDAY = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gDay");
+
+ /**
+ * <p>Fully qualified name for W3C XML Schema datatype <code>duration</code>.</p>
+ */
+ public static final QName DURATION = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "duration");
+
+ /**
+ * <p>Fully qualified name for XQuery 1.0 and XPath 2.0 datatype <code>dayTimeDuration</code>.</p>
+ */
+ public static final QName DURATION_DAYTIME = new QName(XMLConstants.W3C_XPATH_DATATYPE_NS_URI, "dayTimeDuration");
+
+ /**
+ * <p>Fully qualified name for XQuery 1.0 and XPath 2.0 datatype <code>yearMonthDuration</code>.</p>
+ */
+ public static final QName DURATION_YEARMONTH = new QName(XMLConstants.W3C_XPATH_DATATYPE_NS_URI, "yearMonthDuration");
+
+ /**
+ * W3C XML Schema max timezone offset is -14:00. Zone offset is in minutes.
+ */
+ public static final int MAX_TIMEZONE_OFFSET = -14 * 60;
+
+ /**
+ * W3C XML Schema min timezone offset is +14:00. Zone offset is in minutes.
+ */
+ public static final int MIN_TIMEZONE_OFFSET = 14 * 60;
+
+}
Added: trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeFactory.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeFactory.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/datatype/DatatypeFactory.java 2007-08-25 09:23:55 UTC (rev 3407)
@@ -0,0 +1,1064 @@
+/*
+ * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.datatype;
+
+import java.math.BigInteger;
+import java.math.BigDecimal;
+import java.util.GregorianCalendar;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * <p>Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>
+ *
+ * <p><a name="DatatypeFactory.newInstance"/>{@link #newInstance()} is used to create a new <code>DatatypeFactory</code>.
+ * The following implementation resolution mechanisms are used in the following order:</p>
+ * <ol>
+ * <li>
+ * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "<code>javax.xml.datatype.DatatypeFactory</code>",
+ * exists, a class with the name of the property's value is instantiated.
+ * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
+ * </li>
+ * <li>
+ * If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a {@link java.util.Properties} <code>Object</code>.
+ * The <code>Properties</code> <code>Object </code> is then queried for the property as documented in the prior step
+ * and processed as documented in the prior step.
+ * </li>
+ * <li>
+ * The services resolution mechanism is used, e.g. <code>META-INF/services/java.xml.datatype.DatatypeFactory</code>.
+ * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
+ * </li>
+ * <li>
+ * The final mechanism is to attempt to instantiate the <code>Class</code> specified by
+ * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}.
+ * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
+ * </li>
+ * </ol>
+ *
+ * @author <a href="mailto:Jos...@Su...">Joseph Fialli</a>
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @author <a href="mailto:Nee...@su...">Neeraj Bajaj</a>
+ *
+ * @version $Revision: 1.10 $, $Date: 2006/05/19 01:08:42 $
+ * @since 1.5
+ */
+public abstract class DatatypeFactory {
+
+ /**
+ * <p>Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.</p>
+ *
+ * <p>Default value is <code>javax.xml.datatype.DatatypeFactory</code>.</p>
+ */
+ public static final String DATATYPEFACTORY_PROPERTY = "javax.xml.datatype.DatatypeFactory";
+
+ /**
+ * <p>Default implementation class name as defined in
+ * <em>JSR 206: Java(TM) API for XML Processing (JAXP) 1.3</em>.</p>
+ *
+ * <p>Implementers should specify the name of an appropriate class
+ * to be instantiated if no other implementation resolution mechanism
+ * succeeds.</p>
+ *
+ * <p>Users should not refer to this field; it is intended only to
+ * document a factory implementation detail.
+ * </p>
+ */
+ public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS = new String("com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl");
+
+ /**
+ * http://www.w3.org/TR/xpath-datamodel/#xdtschema defines two regexps
+ * to constrain the value space of dayTimeDuration ([^YM]*[DT].*)
+ * and yearMonthDuration ([^DT]*). Note that these expressions rely on
+ * the fact that the value must be an xs:Duration, they simply exclude
+ * some Durations.
+ */
+ private static final Pattern XDTSCHEMA_YMD =
+ Pattern.compile("[^DT]*");
+
+ private static final Pattern XDTSCHEMA_DTD =
+ Pattern.compile("[^YM]*[DT].*");
+
+ /**
+ * <p>Protected constructor to prevent instaniation outside of package.</p>
+ *
+ * <p>Use {@link #newInstance()} to create a <code>DatatypeFactory</code>.</p>
+ */
+ protected DatatypeFactory() {
+ }
+
+ /**
+ * <p>Obtain a new instance of a <code>DatatypeFactory</code>.</p>
+ *
+ * <p>The implementation resolution mechanisms are <a href="#DatatypeFactory.newInstance">defined</a> in this
+ * <code>Class</code>'s documentation.</p>
+ *
+ * @return New instance of a <code>DatatypeFactory</code>
+ *
+ * @throws DatatypeConfigurationException If the implementation is not
+ * available or cannot be instantiated.
+ *
+ * @see #newInstance(String factoryClassName, ClassLoader classLoader)
+ */
+ public static DatatypeFactory newInstance()
+ throws DatatypeConfigurationException {
+
+ try {
+ return (DatatypeFactory) FactoryFinder.find(
+ /* The default property name according to the JAXP spec */
+ DATATYPEFACTORY_PROPERTY,
+ /* The fallback implementation class name */
+ DATATYPEFACTORY_IMPLEMENTATION_CLASS);
+ } catch (FactoryFinder.ConfigurationError e) {
+ throw new DatatypeConfigurationException(e.getMessage(), e.getException());
+ }
+ }
+
+ /**
+ * <p>Obtain a new instance of a <code>DatatypeFactory</code> from class name.
+ * This function is useful when there are multiple providers in the classpath.
+ * It gives more control to the application as it can specify which provider
+ * should be loaded.</p>
+ *
+ * <p>Once an application has obtained a reference to a <code>DatatypeFactory</code>
+ * it can use the factory to configure and obtain datatype instances.</P>
+ *
+ *
+ * <h2>Tip for Trouble-shooting</h2>
+ * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * this method to print a lot of debug messages
+ * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ *
+ * <p> If you have problems try:</p>
+ * <pre>
+ * java -Djaxp.debug=1 YourProgram ....
+ * </pre>
+ *
+ * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.datatype.DatatypeFactory</code>.
+ *
+ * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
+ * current <code>Thread</code>'s context classLoader is used to load the factory class.
+ *
+ * @return New instance of a <code>DatatypeFactory</code>
+ *
+ * @throws DatatypeConfigurationException if <code>factoryClassName</code> is <code>null</code>, or
+ * the factory class cannot be loaded, instantiated.
+ *
+ * @see #newInstance()
+ *
+ * @since 1.6
+ */
+ public static DatatypeFactory newInstance(String factoryClassName, ClassLoader classLoader)
+ throws DatatypeConfigurationException {
+ try {
+ return (DatatypeFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
+ } catch (FactoryFinder.ConfigurationError e) {
+ throw new DatatypeConfigurationException(e.getMessage(), e.getException());
+ }
+ }
+
+ /**
+ * <p>Obtain a new instance of a <code>Duration</code>
+ * specifying the <code>Duration</code> as its string representation, "PnYnMnDTnHnMnS",
+ * as defined in XML Schema 1.0 section 3.2.6.1.</p>
+ *
+ * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
+ * <blockquote>
+ * duration represents a duration of time.
+ * The value space of duration is a six-dimensional space where the coordinates designate the
+ * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
+ * These components are ordered in their significance by their order of appearance i.e. as
+ * year, month, day, hour, minute, and second.
+ * </blockquote>
+ * <p>All six values are set and availabe from the created {@link Duration}</p>
+ *
+ * <p>The XML Schema specification states that values can be of an arbitrary size.
+ * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
+ * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
+ * if implementation capacities are exceeded.</p>
+ *
+ * @param lexicalRepresentation <code>String</code> representation of a <code>Duration</code>.
+ *
+ * @return New <code>Duration</code> created from parsing the <code>lexicalRepresentation</code>.
+ *
+ * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code>.
+ * @throws UnsupportedOperationException If implementation cannot support requested values.
+ * @throws NullPointerException if <code>lexicalRepresentation</code> is <code>null</code>.
+ */
+ public abstract Duration newDuration(final String lexicalRepresentation);
+
+ /**
+ * <p>Obtain a new instance of a <code>Duration</code>
+ * specifying the <code>Duration</code> as milliseconds.</p>
+ *
+ * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
+ * <blockquote>
+ * duration represents a duration of time.
+ * The value space of duration is a six-dimensional space where the coordinates designate the
+ * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
+ * These components are ordered in their significance by their order of appearance i.e. as
+ * year, month, day, hour, minute, and second.
+ * </blockquote>
+ * <p>All six values are set by computing their values from the specified milliseconds
+ * and are availabe using the <code>get</code> methods of the created {@link Duration}.
+ * The values conform to and are defined by:</p>
+ * <ul>
+ * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
+ * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
+ * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
+ * </li>
+ * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
+ * </ul>
+ *
+ * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
+ * {@link java.util.Calendar#YEAR} = 1970,
+ * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
+ * {@link java.util.Calendar#DATE} = 1, etc.
+ * This is important as there are variations in the Gregorian Calendar,
+ * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
+ * so the result of {@link Duration#getMonths()} and {@link Duration#getDays()} can be influenced.</p>
+ *
+ * @param durationInMilliSeconds Duration in milliseconds to create.
+ *
+ * @return New <code>Duration</code> representing <code>durationInMilliSeconds</code>.
+ */
+ public abstract Duration newDuration(final long durationInMilliSeconds);
+
+ /**
+ * <p>Obtain a new instance of a <code>Duration</code>
+ * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
+ *
+ * <p>The XML Schema specification states that values can be of an arbitrary size.
+ * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
+ * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
+ * if implementation capacities are exceeded.</p>
+ *
+ * <p>A <code>null</code> value indicates that field is not set.</p>
+ *
+ * @param isPositive Set to <code>false</code> to create a negative duration. When the length
+ * of the duration is zero, this parameter will be ignored.
+ * @param years of this <code>Duration</code>
+ * @param months of this <code>Duration</code>
+ * @param days of this <code>Duration</code>
+ * @param hours of this <code>Duration</code>
+ * @param minutes of this <code>Duration</code>
+ * @param seconds of this <code>Duration</code>
+ *
+ * @return New <code>Duration</code> created from the specified values.
+ *
+ * @throws IllegalArgumentException If the values are not a valid representation of a
+ * <code>Duration</code>: if all the fields (years, months, ...) are null or
+ * if any of the fields is negative.
+ * @throws UnsupportedOperationException If implementation cannot support requested values.
+ */
+ public abstract Duration newDuration(
+ final boolean isPositive,
+ final BigInteger years,
+ final BigInteger months,
+ final BigInteger days,
+ final BigInteger hours,
+ final BigInteger minutes,
+ final BigDecimal seconds);
+
+ /**
+ * <p>Obtain a new instance of a <code>Duration</code>
+ * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
+ *
+ * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
+ *
+ * @param isPositive Set to <code>false</code> to create a negative duration. When the length
+ * of the duration is zero, this parameter will be ignored.
+ * @param years of this <code>Duration</code>
+ * @param months of this <code>Duration</code>
+ * @param days of this <code>Duration</code>
+ * @param hours of this <code>Duration</code>
+ * @param minutes of this <code>Duration</code>
+ * @param seconds of this <code>Duration</code>
+ *
+ * @return New <code>Duration</code> created from the specified values.
+ *
+ * @throws IllegalArgumentException If the values are not a valid representation of a
+ * <code>Duration</code>: if any of the fields is negative.
+ *
+ * @see #newDuration(
+ * boolean isPositive,
+ * BigInteger years,
+ * BigInteger months,
+ * BigInteger days,
+ * BigInteger hours,
+ * BigInteger minutes,
+ * BigDecimal seconds)
+ */
+ public Duration newDuration(
+ final boolean isPositive,
+ final int years,
+ final int months,
+ final int days,
+ final int hours,
+ final int minutes,
+ final int seconds) {
+
+ // years may not be set
+ BigInteger realYears = (years != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) years) : null;
+
+ // months may not be set
+ BigInteger realMonths = (months != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) months) : null;
+
+ // days may not be set
+ BigInteger realDays = (days != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) days) : null;
+
+ // hours may not be set
+ BigInteger realHours = (hours != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) hours) : null;
+
+ // minutes may not be set
+ BigInteger realMinutes = (minutes != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) minutes) : null;
+
+ // seconds may not be set
+ BigDecimal realSeconds = (seconds != DatatypeConstants.FIELD_UNDEFINED) ? BigDecimal.valueOf((long) seconds) : null;
+
+ return newDuration(
+ isPositive,
+ realYears,
+ realMonths,
+ realDays,
+ realHours,
+ realMinutes,
+ realSeconds
+ );
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> by parsing its <code>String</code> representation,
+ * "<em>PnDTnHnMnS</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
+ *
+ * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
+ * whose lexical representation contains only day, hour, minute, and second components.
+ * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
+ *
+ * <p>All four values are set and availabe from the created {@link Duration}</p>
+ *
+ * <p>The XML Schema specification states that values can be of an arbitrary size.
+ * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
+ * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
+ * if implementation capacities are exceeded.</p>
+ *
+ * @param lexicalRepresentation Lexical representation of a duration.
+ *
+ * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
+ *
+ * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of days and time.
+ * @throws UnsupportedOperationException If implementation cannot support requested values.
+ * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
+ */
+ public Duration newDurationDayTime(final String lexicalRepresentation) {
+ // lexicalRepresentation must be non-null
+ if (lexicalRepresentation == null) {
+ throw new NullPointerException(
+ "Trying to create an xdt:dayTimeDuration with an invalid"
+ + " lexical representation of \"null\"");
+ }
+
+ // test lexicalRepresentation against spec regex
+ Matcher matcher = XDTSCHEMA_DTD.matcher(lexicalRepresentation);
+ if (!matcher.matches()) {
+ throw new IllegalArgumentException(
+ "Trying to create an xdt:dayTimeDuration with an invalid"
+ + " lexical representation of \"" + lexicalRepresentation
+ + "\", data model requires years and months only.");
+ }
+
+ return newDuration(lexicalRepresentation);
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified milliseconds as defined in
+ * <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
+ *
+ * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
+ * whose lexical representation contains only day, hour, minute, and second components.
+ * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
+ *
+ * <p>All four values are set by computing their values from the specified milliseconds
+ * and are availabe using the <code>get</code> methods of the created {@link Duration}.
+ * The values conform to and are defined by:</p>
+ * <ul>
+ * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
+ * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
+ * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
+ * </li>
+ * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
+ * </ul>
+ *
+ * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
+ * {@link java.util.Calendar#YEAR} = 1970,
+ * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
+ * {@link java.util.Calendar#DATE} = 1, etc.
+ * This is important as there are variations in the Gregorian Calendar,
+ * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
+ * so the result of {@link Duration#getDays()} can be influenced.</p>
+ *
+ * <p>Any remaining milliseconds after determining the day, hour, minute and second are discarded.</p>
+ *
+ * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
+ *
+ * @return New <code>Duration</code> created with the specified <code>durationInMilliseconds</code>.
+ *
+ * @see <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>
+ */
+ public Duration newDurationDayTime(final long durationInMilliseconds) {
+
+ return newDuration(durationInMilliseconds);
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
+ * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
+ * <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
+ *
+ * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
+ * whose lexical representation contains only day, hour, minute, and second components.
+ * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
+ *
+ * <p>The XML Schema specification states that values can be of an arbitrary size.
+ * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
+ * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
+ * if implementation capacities are exceeded.</p>
+ *
+ * <p>A <code>null</code> value indicates that field is not set.</p>
+ *
+ * @param isPositive Set to <code>false</code> to create a negative duration. When the length
+ * of the duration is zero, this parameter will be ignored.
+ * @param day Day of <code>Duration</code>.
+ * @param hour Hour of <code>Duration</code>.
+ * @param minute Minute of <code>Duration</code>.
+ * @param second Second of <code>Duration</code>.
+ *
+ * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
+ * and <code>second</code>.
+ *
+ * @throws IllegalArgumentException If the values are not a valid representation of a
+ * <code>Duration</code>: if all the fields (day, hour, ...) are null or
+ * if any of the fields is negative.
+ * @throws UnsupportedOperationException If implementation cannot support requested values.
+ */
+ public Duration newDurationDayTime(
+ final boolean isPositive,
+ final BigInteger day,
+ final BigInteger hour,
+ final BigInteger minute,
+ final BigInteger second) {
+
+ return newDuration(
+ isPositive,
+ null, // years
+ null, // months
+ day,
+ hour,
+ minute,
+ (second != null)? new BigDecimal(second):null
+ );
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
+ * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
+ * <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
+ *
+ * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
+ * whose lexical representation contains only day, hour, minute, and second components.
+ * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
+ *
+ * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
+ *
+ * @param isPositive Set to <code>false</code> to create a negative duration. When the length
+ * of the duration is zero, this parameter will be ignored.
+ * @param day Day of <code>Duration</code>.
+ * @param hour Hour of <code>Duration</code>.
+ * @param minute Minute of <code>Duration</code>.
+ * @param second Second of <code>Duration</code>.
+ *
+ * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
+ * and <code>second</code>.
+ *
+ * @throws IllegalArgumentException If the values are not a valid representation of a
+ * <code>Duration</code>: if any of the fields (day, hour, ...) is negative.
+ */
+ public Duration newDurationDayTime(
+ final boolean isPositive,
+ final int day,
+ final int hour,
+ final int minute,
+ final int second) {
+
+ return newDurationDayTime(
+ isPositive,
+ BigInteger.valueOf((long) day),
+ BigInteger.valueOf((long) hour),
+ BigInteger.valueOf((long) minute),
+ BigInteger.valueOf((long) second)
+ );
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> by parsing its <code>String</code> representation,
+ * "<em>PnYnM</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
+ *
+ * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
+ * whose lexical representation contains only year and month components.
+ * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
+ *
+ * <p>Both values are set and availabe from the created {@link Duration}</p>
+ *
+ * <p>The XML Schema specification states that values can be of an arbitrary size.
+ * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
+ * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
+ * if implementation capacities are exceeded.</p>
+ *
+ * @param lexicalRepresentation Lexical representation of a duration.
+ *
+ * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
+ *
+ * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of years and months.
+ * @throws UnsupportedOperationException If implementation cannot support requested values.
+ * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
+ */
+ public Duration newDurationYearMonth(
+ final String lexicalRepresentation) {
+
+ // lexicalRepresentation must be non-null
+ if (lexicalRepresentation == null) {
+ throw new NullPointerException(
+ "Trying to create an xdt:yearMonthDuration with an invalid"
+ + " lexical representation of \"null\"");
+ }
+
+ // test lexicalRepresentation against spec regex
+ Matcher matcher = XDTSCHEMA_YMD.matcher(lexicalRepresentation);
+ if (!matcher.matches()) {
+ throw new IllegalArgumentException(
+ "Trying to create an xdt:yearMonthDuration with an invalid"
+ + " lexical representation of \"" + lexicalRepresentation
+ + "\", data model requires days and times only.");
+ }
+
+ return newDuration(lexicalRepresentation);
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified milliseconds as defined in
+ * <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
+ *
+ * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
+ * whose lexical representation contains only year and month components.
+ * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
+ *
+ * <p>Both values are set by computing their values from the specified milliseconds
+ * and are availabe using the <code>get</code> methods of the created {@link Duration}.
+ * The values conform to and are defined by:</p>
+ * <ul>
+ * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
+ * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
+ * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
+ * </li>
+ * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
+ * </ul>
+ *
+ * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
+ * {@link java.util.Calendar#YEAR} = 1970,
+ * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
+ * {@link java.util.Calendar#DATE} = 1, etc.
+ * This is important as there are variations in the Gregorian Calendar,
+ * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
+ * so the result of {@link Duration#getMonths()} can be influenced.</p>
+ *
+ * <p>Any remaining milliseconds after determining the year and month are discarded.</p>
+ *
+ * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
+ *
+ * @return New <code>Duration</code> created using the specified <code>durationInMilliseconds</code>.
+ */
+ public Duration newDurationYearMonth(
+ final long durationInMilliseconds) {
+
+ // create a Duration that only has sign, year & month
+ // Duration is immutable, so need to create a new Duration
+ // implementations may override this method in a more efficient way
+ Duration fullDuration = newDuration(durationInMilliseconds);
+ boolean isPositive = (fullDuration.getSign() == -1) ? false : true;
+ BigInteger years =
+ (BigInteger) fullDuration.getField(DatatypeConstants.YEARS);
+ if (years == null) { years = BigInteger.ZERO; }
+ BigInteger months =
+ (BigInteger) fullDuration.getField(DatatypeConstants.MONTHS);
+ if (months == null) { months = BigInteger.ZERO; }
+
+ return newDurationYearMonth(isPositive, years, months);
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
+ * <code>year</code> and <code>month</code> as defined in
+ * <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthyDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
+ *
+ * <p>The XML Schema specification states that values can be of an arbitrary size.
+ * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
+ * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
+ * if implementation capacities are exceeded.</p>
+ *
+ * <p>A <code>null</code> value indicates that field is not set.</p>
+ *
+ * @param isPositive Set to <code>false</code> to create a negative duration. When the length
+ * of the duration is zero, this parameter will be ignored.
+ * @param year Year of <code>Duration</code>.
+ * @param month Month of <code>Duration</code>.
+ *
+ * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
+ *
+ * @throws IllegalArgumentException If the values are not a valid representation of a
+ * <code>Duration</code>: if all of the fields (year, month) are null or
+ * if any of the fields is negative.
+ * @throws UnsupportedOperationException If implementation cannot support requested values.
+ */
+ public Duration newDurationYearMonth(
+ final boolean isPositive,
+ final BigInteger year,
+ final BigInteger month) {
+
+ return newDuration(
+ isPositive,
+ year,
+ month,
+ null, // days
+ null, // hours
+ null, // minutes
+ null // seconds
+ );
+ }
+
+ /**
+ * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
+ * <code>year</code> and <code>month</code> as defined in
+ * <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthyDuration">
+ * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
+ *
+ * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
+ *
+ * @param isPositive Set to <code>false</code> to create a negative duration. When the length
+ * of the duration is zero, this parameter will be ignored.
+ * @param year Year of <code>Duration</code>.
+ * @param month Month of <code>Duration</code>.
+ *
+ * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
+ *
+ * @throws IllegalArgumentException If the values are not a valid representation of a
+ * <code>Duration</code>: if any of the fields (year, month) is negative.
+ */
+ public Duration newDurationYearMonth(
+ final boolean isPositive,
+ final int year,
+ final int month) {
+
+ return newDurationYearMonth(
+ isPositive,
+ BigInteger.valueOf((long) year),
+ BigInteger.valueOf((long) month));
+ }
+
+ /**
+ * <p>Create a new instance of an <code>XMLGregorianCalendar</code>.</p>
+ *
+ * <p>All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null.</p>
+ *
+ * @return New <code>XMLGregorianCalendar</code> with all date/time datatype fields set to
+ * {@link DatatypeConstants#FIELD_UNDEFINED} or null.
+ */
+ public abstract XMLGregorianCalendar newXMLGregorianCalendar();
+
+ /**
+ * <p>Create a new XMLGregorianCalendar by parsing the String as a lexical representation.</p>
+ *
+ * <p>Parsing the lexical string representation is defined in
+ * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
+ * <em>Lexical Representation</em>.</a></p>
+ *
+ * <p>The string representation may not have any leading and trailing whitespaces.</p>
+ *
+ * <p>The parsing is done field by field so that
+ * the following holds for any lexically correct String x:</p>
+ * <pre>
+ * newXMLGregorianCalendar(x).toXMLFormat().equals(x)
+ * </pre>
+ * <p>Except for the noted lexical/canonical representation mismatches
+ * listed in <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-45">
+ * XML Schema 1.0 errata, Section 3.2.7.2</a>.</p>
+ *
+ * @param lexicalRepresentation Lexical representation of one the eight XML Schema date/time datatypes.
+ *
+ * @return <code>XMLGregorianCalendar</code> created from the <code>lexicalRepresentation</code>.
+ *
+ * @throws IllegalArgumentException If the <code>lexicalRepresentation</code> is not a valid <code>XMLGregorianCalendar</code>.
+ * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
+ */
+ public abstract XMLGregorianCalendar newXMLGregorianCalendar(final String lexicalRepresentation);
+
+ /**
+ * <p>Create an <code>XMLGregorianCalendar</code> from a {@link GregorianCalendar}.</p>
+ *
+ * <table border="2" rules="all" cellpadding="2">
+ * <thead>
+ * <tr>
+ * <th align="center" colspan="2">
+ * Field by Field Conversion from
+ * {@link GregorianCalendar} to an {@link XMLGregorianCalendar}
+ * </th>
+ * </tr>
+ * <tr>
+ * <th><code>java.util.GregorianCalendar</code> field</th>
+ * <th><code>javax.xml.datatype.XMLGregorianCalendar</code> field</th>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td><code>ERA == GregorianCalendar.BC ? -YEAR : YEAR</code></td>
+ * <td>{@link XMLGregorianCalendar#setYear(int year)}</td>
+ * </tr>
+ * <tr>
+ * <td><code>MONTH + 1</code></td>
+ * <td>{@link XMLGregorianCalendar#setMonth(int month)}</td>
+ * </tr>
+ * <tr>
+ * <td><code>DAY_OF_MONTH</code></td>
+ * <td>{@link XMLGregorianCalendar#setDay(int day)}</td>
+ * </tr>
+ * <tr>
+ * <td><code>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code></td>
+ * <td>{@link XMLGregorianCalendar#setTime(int hour, int minute, int second, BigDecimal fractional)}</td>
+ * </tr>
+ * <tr>
+ * <td>
+ * <code>(ZONE_OFFSET + DST_OFFSET) / (60*1000)</code><br/>
+ * <em>(in minutes)</em>
+ * </td>
+ * <td>{@link XMLGregorianCalendar#setTimezone(int offset)}<sup><em>*</em></sup>
+ * </td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * <p><em>*</em>conversion loss of information. It is not possible to represent
+ * a <code>java.util.GregorianCalendar</code> daylight savings timezone id in the
+ * XML Schema 1.0 date/time datatype representation.</p>
+ *
+ * <p>To compute the return value's <code>TimeZone</code> field,
+ * <ul>
+ * <li>when <code>this.getTimezone() != FIELD_UNDEFINED</code>,
+ * create a <code>java.util.TimeZone</code> with a custom timezone id
+ * using the <code>this.getTimezone()</code>.</li>
+ * <li>else use the <code>GregorianCalendar</code> default timezone value
+ * for the host is defined as specified by
+ * <code>java.util.TimeZone.getDefault()</code>.</li></p>
+ *
+ * @param cal <code>java.util.GregorianCalendar</code> used to create <code>XMLGregorianCalendar</code>
+ *
+ * @return <code>XMLGregorianCalendar</code> created from <code>java.util.GregorianCalendar</code>
+ *
+ * @throws NullPointerException If <code>cal</code> is <code>null</code>.
+ */
+ public abstract XMLGregorianCalendar newXMLGregorianCalendar(...
[truncated message content] |
|
From: <ls...@us...> - 2007-08-27 17:41:11
|
Revision: 3415
http://jnode.svn.sourceforge.net/jnode/?rev=3415&view=rev
Author: lsantha
Date: 2007-08-25 12:27:54 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/src/classpath/java/java/awt/Component.java
trunk/core/src/classpath/java/java/awt/peer/ComponentPeer.java
trunk/core/src/classpath/java/java/awt/peer/FramePeer.java
Modified: trunk/core/src/classpath/java/java/awt/Component.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/Component.java 2007-08-25 19:26:55 UTC (rev 3414)
+++ trunk/core/src/classpath/java/java/awt/Component.java 2007-08-25 19:27:54 UTC (rev 3415)
@@ -4173,7 +4173,7 @@
*/
public boolean isFocusTraversable()
{
- return enabled && visible && (peer == null || isLightweight() || peer.isFocusTraversable());
+ return enabled && visible && (peer == null || isLightweight() || peer.isFocusable());
}
/**
Modified: trunk/core/src/classpath/java/java/awt/peer/ComponentPeer.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/peer/ComponentPeer.java 2007-08-25 19:26:55 UTC (rev 3414)
+++ trunk/core/src/classpath/java/java/awt/peer/ComponentPeer.java 2007-08-25 19:27:54 UTC (rev 3415)
@@ -64,6 +64,15 @@
*/
public interface ComponentPeer
{
+ //jnode openjdk
+ public static final int SET_LOCATION = 1,
+ SET_SIZE = 2,
+ SET_BOUNDS = 3,
+ SET_CLIENT_SIZE = 4,
+ RESET_OPERATION = 5,
+ NO_EMBEDDED_CHECK = (1 << 14),
+ DEFAULT_OPERATION = SET_BOUNDS;
+
/**
* Returns the construction status of the specified image. This is called
* by {@link Component#checkImage(Image, int, int, ImageObserver)}.
@@ -200,14 +209,6 @@
/**
* Returns <code>true</code> if the component can receive keyboard input
- * focus. This is called from {@link Component#isFocusTraversable()}.
- *
- * @specnote Part of the earlier 1.1 API, replaced by isFocusable().
- */
- boolean isFocusTraversable();
-
- /**
- * Returns <code>true</code> if the component can receive keyboard input
* focus. This is called from {@link Component#isFocusable()}.
*/
boolean isFocusable();
Modified: trunk/core/src/classpath/java/java/awt/peer/FramePeer.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/peer/FramePeer.java 2007-08-25 19:26:55 UTC (rev 3414)
+++ trunk/core/src/classpath/java/java/awt/peer/FramePeer.java 2007-08-25 19:27:54 UTC (rev 3415)
@@ -71,5 +71,7 @@
* @since 1.5
*/
void setBoundsPrivate(int x, int y, int width, int height);
+ //jnode openjdk
+ Rectangle getBoundsPrivate();
} // interface FramePeer
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 17:40:25
|
Revision: 3425
http://jnode.svn.sourceforge.net/jnode/?rev=3425&view=rev
Author: lsantha
Date: 2007-08-25 12:55:46 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/org/org/w3c/dom/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 17:40:25
|
Revision: 3428
http://jnode.svn.sourceforge.net/jnode/?rev=3428&view=rev
Author: lsantha
Date: 2007-08-25 13:14:18 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/tools/gnu/classpath/tools/rmic/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 17:40:23
|
Revision: 3421
http://jnode.svn.sourceforge.net/jnode/?rev=3421&view=rev
Author: lsantha
Date: 2007-08-25 12:40:24 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/descriptors/org.classpath.core.xml
Modified: trunk/core/descriptors/org.classpath.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.core.xml 2007-08-25 19:40:09 UTC (rev 3420)
+++ trunk/core/descriptors/org.classpath.core.xml 2007-08-25 19:40:24 UTC (rev 3421)
@@ -83,7 +83,6 @@
<export name="gnu.javax.crypto.*"/>
<export name="gnu.javax.crypto.jce.*"/>
<export name="gnu.javax.net.ssl.provider.*"/>
- <export name="gnu.xml.stream.*"/>
<export name="java.applet.Applet"/>
<export name="java.awt.AWTPermission"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 17:40:04
|
Revision: 3423
http://jnode.svn.sourceforge.net/jnode/?rev=3423&view=rev
Author: lsantha
Date: 2007-08-25 12:50:20 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/gnu/gnu/xml/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 16:53:36
|
Revision: 3419
http://jnode.svn.sourceforge.net/jnode/?rev=3419&view=rev
Author: lsantha
Date: 2007-08-25 12:36:13 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/tools/gnu/classpath/tools/appletviewer/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 16:53:24
|
Revision: 3411
http://jnode.svn.sourceforge.net/jnode/?rev=3411&view=rev
Author: lsantha
Date: 2007-08-25 12:23:35 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/vm/java/util/prefs/
trunk/core/src/openjdk/vm/java/util/prefs/NativeFileSystemPreferences.java
trunk/core/src/openjdk/vm/sun/misc/NativeMessageUtils.java
Added: trunk/core/src/openjdk/vm/java/util/prefs/NativeFileSystemPreferences.java
===================================================================
--- trunk/core/src/openjdk/vm/java/util/prefs/NativeFileSystemPreferences.java (rev 0)
+++ trunk/core/src/openjdk/vm/java/util/prefs/NativeFileSystemPreferences.java 2007-08-25 19:23:35 UTC (rev 3411)
@@ -0,0 +1,34 @@
+/*
+ * $Id$
+ */
+package java.util.prefs;
+
+/**
+ * @author Levente S\xE1ntha
+ */
+public class NativeFileSystemPreferences {
+ /**
+ * @see java.util.prefs.FileSystemPreferences#lockFile0(String, int, boolean)
+ */
+ private static int[] lockFile0(String fileName, int permission, boolean shared){
+ //todo implement it
+ return new int[]{1, 0};
+ }
+
+ /**
+ *
+ * @see java.util.prefs.FileSystemPreferences#unlockFile0(int)
+ */
+ private static int unlockFile0(int lockHandle){
+ //todo implement it
+ return 0;
+ }
+
+ /**
+ * @see java.util.prefs.FileSystemPreferences#chmod(String, int)
+ */
+ private static int chmod(String fileName, int permission){
+ //todo implement it
+ return 0;
+ }
+}
Added: trunk/core/src/openjdk/vm/sun/misc/NativeMessageUtils.java
===================================================================
--- trunk/core/src/openjdk/vm/sun/misc/NativeMessageUtils.java (rev 0)
+++ trunk/core/src/openjdk/vm/sun/misc/NativeMessageUtils.java 2007-08-25 19:23:35 UTC (rev 3411)
@@ -0,0 +1,31 @@
+/*
+ * $Id$
+ */
+package sun.misc;
+
+/**
+ * @author Levente S\xE1ntha
+ */
+public class NativeMessageUtils {
+ /**
+ * Print a message directly to stderr, bypassing all the
+ * character conversion methods.
+ * @param msg message to print
+ * @see sun.misc.MessageUtils#toStderr(String)
+ */
+ public static void toStderr(String msg){
+ //todo improve it
+ System.err.print(msg);
+ }
+
+ /**
+ * Print a message directly to stdout, bypassing all the
+ * character conversion methods.
+ * @param msg message to print
+ * @see sun.misc.MessageUtils#toStdout(String)
+ */
+ public static void toStdout(String msg){
+ //todo improve it
+ System.out.print(msg);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 15:52:41
|
Revision: 3404
http://jnode.svn.sourceforge.net/jnode/?rev=3404&view=rev
Author: lsantha
Date: 2007-08-25 01:11:36 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Workaround for threading issues.
Modified Paths:
--------------
trunk/core/src/classpath/java/java/lang/Runtime.java
Modified: trunk/core/src/classpath/java/java/lang/Runtime.java
===================================================================
--- trunk/core/src/classpath/java/java/lang/Runtime.java 2007-08-25 08:08:47 UTC (rev 3403)
+++ trunk/core/src/classpath/java/java/lang/Runtime.java 2007-08-25 08:11:36 UTC (rev 3404)
@@ -345,8 +345,12 @@
SecurityManager sm = SecurityManager.current; // Be thread-safe!
if (sm != null)
sm.checkPermission(new RuntimePermission("shutdownHooks"));
- if (hook.isAlive() || hook.getThreadGroup() == null)
- throw new IllegalArgumentException("The hook thread " + hook + " must not have been already run or started");
+
+ //jnode
+ //todo investigate the reson of this chek failing
+ //if (hook.isAlive() || hook.getThreadGroup() == null)
+ // throw new IllegalArgumentException("The hook thread " + hook + " must not have been already run or started");
+
synchronized (libpath)
{
if (exitSequence != null)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-27 15:49:35
|
Revision: 3406
http://jnode.svn.sourceforge.net/jnode/?rev=3406&view=rev
Author: lsantha
Date: 2007-08-25 01:15:49 -0700 (Sat, 25 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/javax/javax/xml/parsers/
trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilder.java
trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilderFactory.java
trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryConfigurationError.java
trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryFinder.java
trunk/core/src/openjdk/javax/javax/xml/parsers/ParserConfigurationException.java
trunk/core/src/openjdk/javax/javax/xml/parsers/SAXParser.java
trunk/core/src/openjdk/javax/javax/xml/parsers/SAXParserFactory.java
trunk/core/src/openjdk/javax/javax/xml/parsers/SecuritySupport.java
trunk/core/src/openjdk/javax/javax/xml/parsers/package.html
trunk/core/src/openjdk/javax/javax/xml/transform/ErrorListener.java
trunk/core/src/openjdk/javax/javax/xml/transform/FactoryFinder.java
trunk/core/src/openjdk/javax/javax/xml/transform/OutputKeys.java
trunk/core/src/openjdk/javax/javax/xml/transform/Result.java
trunk/core/src/openjdk/javax/javax/xml/transform/SecuritySupport.java
trunk/core/src/openjdk/javax/javax/xml/transform/Source.java
trunk/core/src/openjdk/javax/javax/xml/transform/SourceLocator.java
trunk/core/src/openjdk/javax/javax/xml/transform/Templates.java
trunk/core/src/openjdk/javax/javax/xml/transform/Transformer.java
trunk/core/src/openjdk/javax/javax/xml/transform/TransformerConfigurationException.java
trunk/core/src/openjdk/javax/javax/xml/transform/TransformerException.java
trunk/core/src/openjdk/javax/javax/xml/transform/TransformerFactory.java
trunk/core/src/openjdk/javax/javax/xml/transform/TransformerFactoryConfigurationError.java
trunk/core/src/openjdk/javax/javax/xml/transform/URIResolver.java
trunk/core/src/openjdk/javax/javax/xml/transform/dom/
trunk/core/src/openjdk/javax/javax/xml/transform/dom/DOMLocator.java
trunk/core/src/openjdk/javax/javax/xml/transform/dom/DOMResult.java
trunk/core/src/openjdk/javax/javax/xml/transform/dom/DOMSource.java
trunk/core/src/openjdk/javax/javax/xml/transform/dom/package.html
trunk/core/src/openjdk/javax/javax/xml/transform/overview.html
trunk/core/src/openjdk/javax/javax/xml/transform/package.html
trunk/core/src/openjdk/javax/javax/xml/transform/sax/
trunk/core/src/openjdk/javax/javax/xml/transform/sax/SAXResult.java
trunk/core/src/openjdk/javax/javax/xml/transform/sax/SAXSource.java
trunk/core/src/openjdk/javax/javax/xml/transform/sax/SAXTransformerFactory.java
trunk/core/src/openjdk/javax/javax/xml/transform/sax/TemplatesHandler.java
trunk/core/src/openjdk/javax/javax/xml/transform/sax/TransformerHandler.java
trunk/core/src/openjdk/javax/javax/xml/transform/sax/package.html
trunk/core/src/openjdk/javax/javax/xml/transform/stream/
trunk/core/src/openjdk/javax/javax/xml/transform/stream/StreamResult.java
trunk/core/src/openjdk/javax/javax/xml/transform/stream/StreamSource.java
trunk/core/src/openjdk/javax/javax/xml/transform/stream/package.html
Added: trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilder.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilder.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilder.java 2007-08-25 08:15:49 UTC (rev 3406)
@@ -0,0 +1,349 @@
+/*
+ * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.validation.Schema;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMImplementation;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Defines the API to obtain DOM Document instances from an XML
+ * document. Using this class, an application programmer can obtain a
+ * {@link Document} from XML.<p>
+ *
+ * An instance of this class can be obtained from the
+ * {@link DocumentBuilderFactory#newDocumentBuilder()} method. Once
+ * an instance of this class is obtained, XML can be parsed from a
+ * variety of input sources. These input sources are InputStreams,
+ * Files, URLs, and SAX InputSources.<p>
+ *
+ * Note that this class reuses several classes from the SAX API. This
+ * does not require that the implementor of the underlying DOM
+ * implementation use a SAX parser to parse XML document into a
+ * <code>Document</code>. It merely requires that the implementation
+ * communicate with the application using these existing APIs.
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @version $Revision: 1.5 $, $Date: 2005/11/21 05:57:14 $
+ */
+
+public abstract class DocumentBuilder {
+
+
+ /** Protected constructor */
+ protected DocumentBuilder () {
+ }
+
+ /**
+ * <p>Reset this <code>DocumentBuilder</code> to its original configuration.</p>
+ *
+ * <p><code>DocumentBuilder</code> is reset to the same state as when it was created with
+ * {@link DocumentBuilderFactory#newDocumentBuilder()}.
+ * <code>reset()</code> is designed to allow the reuse of existing <code>DocumentBuilder</code>s
+ * thus saving resources associated with the creation of new <code>DocumentBuilder</code>s.</p>
+ *
+ * <p>The reset <code>DocumentBuilder</code> is not guaranteed to have the same {@link EntityResolver} or {@link ErrorHandler}
+ * <code>Object</code>s, e.g. {@link Object#equals(Object obj)}. It is guaranteed to have a functionally equal
+ * <code>EntityResolver</code> and <code>ErrorHandler</code>.</p>
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method.
+ *
+ * @since 1.5
+ */
+ public void reset() {
+
+ // implementors should override this method
+ throw new UnsupportedOperationException(
+ "This DocumentBuilder, \"" + this.getClass().getName() + "\", does not support the reset functionality."
+ + " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
+ + " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
+ );
+ }
+
+ /**
+ * Parse the content of the given <code>InputStream</code> as an XML
+ * document and return a new DOM {@link Document} object.
+ * An <code>IllegalArgumentException</code> is thrown if the
+ * <code>InputStream</code> is null.
+ *
+ * @param is InputStream containing the content to be parsed.
+ *
+ * @return <code>Document</code> result of parsing the
+ * <code>InputStream</code>
+ *
+ * @throws IOException If any IO errors occur.
+ * @throws SAXException If any parse errors occur.
+ * @throws IllegalArgumentException When <code>is</code> is <code>null</code>
+ *
+ * @see org.xml.sax.DocumentHandler
+ */
+
+ public Document parse(InputStream is)
+ throws SAXException, IOException {
+ if (is == null) {
+ throw new IllegalArgumentException("InputStream cannot be null");
+ }
+
+ InputSource in = new InputSource(is);
+ return parse(in);
+ }
+
+ /**
+ * Parse the content of the given <code>InputStream</code> as an
+ * XML document and return a new DOM {@link Document} object.
+ * An <code>IllegalArgumentException</code> is thrown if the
+ * <code>InputStream</code> is null.
+ *
+ * @param is InputStream containing the content to be parsed.
+ * @param systemId Provide a base for resolving relative URIs.
+ *
+ * @return A new DOM Document object.
+ *
+ * @throws IOException If any IO errors occur.
+ * @throws SAXException If any parse errors occur.
+ * @throws IllegalArgumentException When <code>is</code> is <code>null</code>
+ *
+ * @see org.xml.sax.DocumentHandler
+ */
+
+ public Document parse(InputStream is, String systemId)
+ throws SAXException, IOException {
+ if (is == null) {
+ throw new IllegalArgumentException("InputStream cannot be null");
+ }
+
+ InputSource in = new InputSource(is);
+ in.setSystemId(systemId);
+ return parse(in);
+ }
+
+ /**
+ * Parse the content of the given URI as an XML document
+ * and return a new DOM {@link Document} object.
+ * An <code>IllegalArgumentException</code> is thrown if the
+ * URI is <code>null</code> null.
+ *
+ * @param uri The location of the content to be parsed.
+ *
+ * @return A new DOM Document object.
+ *
+ * @throws IOException If any IO errors occur.
+ * @throws SAXException If any parse errors occur.
+ * @throws IllegalArgumentException When <code>uri</code> is <code>null</code>
+ *
+ * @see org.xml.sax.DocumentHandler
+ */
+
+ public Document parse(String uri)
+ throws SAXException, IOException {
+ if (uri == null) {
+ throw new IllegalArgumentException("URI cannot be null");
+ }
+
+ InputSource in = new InputSource(uri);
+ return parse(in);
+ }
+
+ /**
+ * Parse the content of the given file as an XML document
+ * and return a new DOM {@link Document} object.
+ * An <code>IllegalArgumentException</code> is thrown if the
+ * <code>File</code> is <code>null</code> null.
+ *
+ * @param f The file containing the XML to parse.
+ *
+ * @throws IOException If any IO errors occur.
+ * @throws SAXException If any parse errors occur.
+ * @throws IllegalArgumentException When <code>f</code> is <code>null</code>
+ *
+ * @see org.xml.sax.DocumentHandler
+ * @return A new DOM Document object.
+ */
+
+ public Document parse(File f) throws SAXException, IOException {
+ if (f == null) {
+ throw new IllegalArgumentException("File cannot be null");
+ }
+
+ //convert file to appropriate URI, f.toURI().toASCIIString()
+ //converts the URI to string as per rule specified in
+ //RFC 2396,
+ InputSource in = new InputSource(f.toURI().toASCIIString());
+ return parse(in);
+ }
+
+ /**
+ * Parse the content of the given input source as an XML document
+ * and return a new DOM {@link Document} object.
+ * An <code>IllegalArgumentException</code> is thrown if the
+ * <code>InputSource</code> is <code>null</code> null.
+ *
+ * @param is InputSource containing the content to be parsed.
+ *
+ * @return A new DOM Document object.
+ *
+ * @throws IOException If any IO errors occur.
+ * @throws SAXException If any parse errors occur.
+ * @throws IllegalArgumentException When <code>is</code> is <code>null</code>
+ *
+ * @see org.xml.sax.DocumentHandler
+ */
+
+ public abstract Document parse(InputSource is)
+ throws SAXException, IOException;
+
+
+ /**
+ * Indicates whether or not this parser is configured to
+ * understand namespaces.
+ *
+ * @return true if this parser is configured to understand
+ * namespaces; false otherwise.
+ */
+
+ public abstract boolean isNamespaceAware();
+
+ /**
+ * Indicates whether or not this parser is configured to
+ * validate XML documents.
+ *
+ * @return true if this parser is configured to validate
+ * XML documents; false otherwise.
+ */
+
+ public abstract boolean isValidating();
+
+ /**
+ * Specify the {@link EntityResolver} to be used to resolve
+ * entities present in the XML document to be parsed. Setting
+ * this to <code>null</code> will result in the underlying
+ * implementation using it's own default implementation and
+ * behavior.
+ *
+ * @param er The <code>EntityResolver</code> to be used to resolve entities
+ * present in the XML document to be parsed.
+ */
+
+ public abstract void setEntityResolver(EntityResolver er);
+
+ /**
+ * Specify the {@link ErrorHandler} to be used by the parser.
+ * Setting this to <code>null</code> will result in the underlying
+ * implementation using it's own default implementation and
+ * behavior.
+ *
+ * @param eh The <code>ErrorHandler</code> to be used by the parser.
+ */
+
+ public abstract void setErrorHandler(ErrorHandler eh);
+
+ /**
+ * Obtain a new instance of a DOM {@link Document} object
+ * to build a DOM tree with.
+ *
+ * @return A new instance of a DOM Document object.
+ */
+
+ public abstract Document newDocument();
+
+ /**
+ * Obtain an instance of a {@link DOMImplementation} object.
+ *
+ * @return A new instance of a <code>DOMImplementation</code>.
+ */
+
+ public abstract DOMImplementation getDOMImplementation();
+
+ /** <p>Get current state of canonicalization.</p>
+ *
+ * @return current state canonicalization control
+ */
+ /*
+ public boolean getCanonicalization() {
+ return canonicalState;
+ }
+ */
+
+ /** <p>Get a reference to the the {@link Schema} being used by
+ * the XML processor.</p>
+ *
+ * <p>If no schema is being used, <code>null</code> is returned.</p>
+ *
+ * @return {@link Schema} being used or <code>null</code>
+ * if none in use
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method
+ *
+ * @since 1.5
+ */
+ public Schema getSchema() {
+ throw new UnsupportedOperationException(
+ "This parser does not support specification \""
+ + this.getClass().getPackage().getSpecificationTitle()
+ + "\" version \""
+ + this.getClass().getPackage().getSpecificationVersion()
+ + "\""
+ );
+ }
+
+
+ /**
+ * <p>Get the XInclude processing mode for this parser.</p>
+ *
+ * @return
+ * the return value of
+ * the {@link DocumentBuilderFactory#isXIncludeAware()}
+ * when this parser was created from factory.
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method
+ *
+ * @since 1.5
+ *
+ * @see DocumentBuilderFactory#setXIncludeAware(boolean)
+ */
+ public boolean isXIncludeAware() {
+ throw new UnsupportedOperationException(
+ "This parser does not support specification \""
+ + this.getClass().getPackage().getSpecificationTitle()
+ + "\" version \""
+ + this.getClass().getPackage().getSpecificationVersion()
+ + "\""
+ );
+ }
+}
Added: trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilderFactory.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilderFactory.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/parsers/DocumentBuilderFactory.java 2007-08-25 08:15:49 UTC (rev 3406)
@@ -0,0 +1,616 @@
+/*
+ * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.validation.Schema;
+
+/**
+ * Defines a factory API that enables applications to obtain a
+ * parser that produces DOM object trees from XML documents.
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @author <a href="mailto:Nee...@su...">Neeraj Bajaj</a>
+ *
+ * @version $Revision: 1.5 $, $Date: 2005/11/03 19:34:14 $
+
+ */
+
+public abstract class DocumentBuilderFactory {
+
+ /** The default property name according to the JAXP spec */
+ private static final String DEFAULT_PROPERTY_NAME = "javax.xml.parsers.DocumentBuilderFactory";
+
+ private boolean validating = false;
+ private boolean namespaceAware = false;
+ private boolean whitespace = false;
+ private boolean expandEntityRef = true;
+ private boolean ignoreComments = false;
+ private boolean coalescing = false;
+
+ private boolean canonicalState = false;
+
+ /**
+ * <p>Protected constructor to prevent instantiation.
+ * Use {@link #newInstance()}.</p>
+ */
+ protected DocumentBuilderFactory () {
+ }
+
+ /**
+ * Obtain a new instance of a
+ * <code>DocumentBuilderFactory</code>. This static method creates
+ * a new factory instance.
+ * This method uses the following ordered lookup procedure to determine
+ * the <code>DocumentBuilderFactory</code> implementation class to
+ * load:
+ * <ul>
+ * <li>
+ * Use the <code>javax.xml.parsers.DocumentBuilderFactory</code> system
+ * property.
+ * </li>
+ * <li>
+ * Use the properties file "lib/jaxp.properties" in the JRE directory.
+ * This configuration file is in standard <code>java.util.Properties
+ * </code> format and contains the fully qualified name of the
+ * implementation class with the key being the system property defined
+ * above.
+ *
+ * The jaxp.properties file is read only once by the JAXP implementation
+ * and it's values are then cached for future use. If the file does not exist
+ * when the first attempt is made to read from it, no further attempts are
+ * made to check for its existence. It is not possible to change the value
+ * of any property in jaxp.properties after it has been read for the first time.
+ * </li>
+ * <li>
+ * Use the Services API (as detailed in the JAR specification), if
+ * available, to determine the classname. The Services API will look
+ * for a classname in the file
+ * <code>META-INF/services/javax.xml.parsers.DocumentBuilderFactory</code>
+ * in jars available to the runtime.
+ * </li>
+ * <li>
+ * Platform default <code>DocumentBuilderFactory</code> instance.
+ * </li>
+ * </ul>
+ *
+ * Once an application has obtained a reference to a
+ * <code>DocumentBuilderFactory</code> it can use the factory to
+ * configure and obtain parser instances.
+ *
+ *
+ * <h2>Tip for Trouble-shooting</h2>
+ * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * this method to print a lot of debug messages
+ * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ *
+ * <p> If you have problems loading {@link DocumentBuilder}s, try:</p>
+ * <pre>
+ * java -Djaxp.debug=1 YourProgram ....
+ * </pre>
+ *
+ * @return New instance of a <code>DocumentBuilderFactory</code>
+ *
+ * @throws FactoryConfigurationError if the implementation is not
+ * available or cannot be instantiated.
+ */
+ public static DocumentBuilderFactory newInstance() {
+ try {
+ return (DocumentBuilderFactory) FactoryFinder.find(
+ /* The default property name according to the JAXP spec */
+ "javax.xml.parsers.DocumentBuilderFactory",
+ /* The fallback implementation class name */
+ "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
+ } catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(),
+ e.getMessage());
+ }
+
+ }
+
+ /**
+ * <p>Obtain a new instance of a <code>DocumentBuilderFactory</code> from class name.
+ * This function is useful when there are multiple providers in the classpath.
+ * It gives more control to the application as it can specify which provider
+ * should be loaded.</p>
+ *
+ * <p>Once an application has obtained a reference to a <code>DocumentBuilderFactory</code>
+ * it can use the factory to configure and obtain parser instances.</p>
+ *
+ *
+ * <h2>Tip for Trouble-shooting</h2>
+ * <p>Setting the <code>jaxp.debug</code> system property will cause
+ * this method to print a lot of debug messages
+ * to <code>System.err</code> about what it is doing and where it is looking at.</p>
+ *
+ * <p> If you have problems try:</p>
+ * <pre>
+ * java -Djaxp.debug=1 YourProgram ....
+ * </pre>
+ *
+ * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.parsers.DocumentBuilderFactory</code>.
+ *
+ * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
+ * current <code>Thread</code>'s context classLoader is used to load the factory class.
+ *
+ * @return New instance of a <code>DocumentBuilderFactory</code>
+ *
+ * @throws FactoryConfigurationError if <code>factoryClassName</code> is <code>null</code>, or
+ * the factory class cannot be loaded, instantiated.
+ *
+ * @see #newInstance()
+ *
+ * @since 1.6
+ */
+ public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader){
+ try {
+ //do not fallback if given classloader can't find the class, throw exception
+ return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
+ } catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(),
+ e.getMessage());
+ }
+ }
+
+ /**
+ * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
+ * using the currently configured parameters.
+ *
+ * @return A new instance of a DocumentBuilder.
+ *
+ * @throws ParserConfigurationException if a DocumentBuilder
+ * cannot be created which satisfies the configuration requested.
+ */
+
+ public abstract DocumentBuilder newDocumentBuilder()
+ throws ParserConfigurationException;
+
+
+ /**
+ * Specifies that the parser produced by this code will
+ * provide support for XML namespaces. By default the value of this is set
+ * to <code>false</code>
+ *
+ * @param awareness true if the parser produced will provide support
+ * for XML namespaces; false otherwise.
+ */
+
+ public void setNamespaceAware(boolean awareness) {
+ this.namespaceAware = awareness;
+ }
+
+ /**
+ * Specifies that the parser produced by this code will
+ * validate documents as they are parsed. By default the value of this
+ * is set to <code>false</code>.
+ *
+ * <p>
+ * Note that "the validation" here means
+ * <a href="http://www.w3.org/TR/REC-xml#proc-types">a validating
+ * parser</a> as defined in the XML recommendation.
+ * In other words, it essentially just controls the DTD validation.
+ * (except the legacy two properties defined in JAXP 1.2.)
+ * </p>
+ *
+ * <p>
+ * To use modern schema languages such as W3C XML Schema or
+ * RELAX NG instead of DTD, you can configure your parser to be
+ * a non-validating parser by leaving the {@link #setValidating(boolean)}
+ * method <code>false</code>, then use the {@link #setSchema(Schema)}
+ * method to associate a schema to a parser.
+ * </p>
+ *
+ * @param validating true if the parser produced will validate documents
+ * as they are parsed; false otherwise.
+ */
+
+ public void setValidating(boolean validating) {
+ this.validating = validating;
+ }
+
+ /**
+ * Specifies that the parsers created by this factory must eliminate
+ * whitespace in element content (sometimes known loosely as
+ * 'ignorable whitespace') when parsing XML documents (see XML Rec
+ * 2.10). Note that only whitespace which is directly contained within
+ * element content that has an element only content model (see XML
+ * Rec 3.2.1) will be eliminated. Due to reliance on the content model
+ * this setting requires the parser to be in validating mode. By default
+ * the value of this is set to <code>false</code>.
+ *
+ * @param whitespace true if the parser created must eliminate whitespace
+ * in the element content when parsing XML documents;
+ * false otherwise.
+ */
+
+ public void setIgnoringElementContentWhitespace(boolean whitespace) {
+ this.whitespace = whitespace;
+ }
+
+ /**
+ * Specifies that the parser produced by this code will
+ * expand entity reference nodes. By default the value of this is set to
+ * <code>true</code>
+ *
+ * @param expandEntityRef true if the parser produced will expand entity
+ * reference nodes; false otherwise.
+ */
+
+ public void setExpandEntityReferences(boolean expandEntityRef) {
+ this.expandEntityRef = expandEntityRef;
+ }
+
+ /**
+ * <p>Specifies that the parser produced by this code will
+ * ignore comments. By default the value of this is set to <code>false
+ * </code>.</p>
+ *
+ * @param ignoreComments <code>boolean</code> value to ignore comments during processing
+ */
+
+ public void setIgnoringComments(boolean ignoreComments) {
+ this.ignoreComments = ignoreComments;
+ }
+
+ /**
+ * Specifies that the parser produced by this code will
+ * convert CDATA nodes to Text nodes and append it to the
+ * adjacent (if any) text node. By default the value of this is set to
+ * <code>false</code>
+ *
+ * @param coalescing true if the parser produced will convert CDATA nodes
+ * to Text nodes and append it to the adjacent (if any)
+ * text node; false otherwise.
+ */
+
+ public void setCoalescing(boolean coalescing) {
+ this.coalescing = coalescing;
+ }
+
+ /**
+ * Indicates whether or not the factory is configured to produce
+ * parsers which are namespace aware.
+ *
+ * @return true if the factory is configured to produce parsers which
+ * are namespace aware; false otherwise.
+ */
+
+ public boolean isNamespaceAware() {
+ return namespaceAware;
+ }
+
+ /**
+ * Indicates whether or not the factory is configured to produce
+ * parsers which validate the XML content during parse.
+ *
+ * @return true if the factory is configured to produce parsers
+ * which validate the XML content during parse; false otherwise.
+ */
+
+ public boolean isValidating() {
+ return validating;
+ }
+
+ /**
+ * Indicates whether or not the factory is configured to produce
+ * parsers which ignore ignorable whitespace in element content.
+ *
+ * @return true if the factory is configured to produce parsers
+ * which ignore ignorable whitespace in element content;
+ * false otherwise.
+ */
+
+ public boolean isIgnoringElementContentWhitespace() {
+ return whitespace;
+ }
+
+ /**
+ * Indicates whether or not the factory is configured to produce
+ * parsers which expand entity reference nodes.
+ *
+ * @return true if the factory is configured to produce parsers
+ * which expand entity reference nodes; false otherwise.
+ */
+
+ public boolean isExpandEntityReferences() {
+ return expandEntityRef;
+ }
+
+ /**
+ * Indicates whether or not the factory is configured to produce
+ * parsers which ignores comments.
+ *
+ * @return true if the factory is configured to produce parsers
+ * which ignores comments; false otherwise.
+ */
+
+ public boolean isIgnoringComments() {
+ return ignoreComments;
+ }
+
+ /**
+ * Indicates whether or not the factory is configured to produce
+ * parsers which converts CDATA nodes to Text nodes and appends it to
+ * the adjacent (if any) Text node.
+ *
+ * @return true if the factory is configured to produce parsers
+ * which converts CDATA nodes to Text nodes and appends it to
+ * the adjacent (if any) Text node; false otherwise.
+ */
+
+ public boolean isCoalescing() {
+ return coalescing;
+ }
+
+ /**
+ * Allows the user to set specific attributes on the underlying
+ * implementation.
+ *
+ * @param name The name of the attribute.
+ * @param value The value of the attribute.
+ *
+ * @throws IllegalArgumentException thrown if the underlying
+ * implementation doesn't recognize the attribute.
+ */
+ public abstract void setAttribute(String name, Object value)
+ throws IllegalArgumentException;
+
+ /**
+ * Allows the user to retrieve specific attributes on the underlying
+ * implementation.
+ *
+ * @param name The name of the attribute.
+ *
+ * @return value The value of the attribute.
+ *
+ * @throws IllegalArgumentException thrown if the underlying
+ * implementation doesn't recognize the attribute.
+ */
+ public abstract Object getAttribute(String name)
+ throws IllegalArgumentException;
+
+ /**
+ * <p>Set a feature for this <code>DocumentBuilderFactory</code> and <code>DocumentBuilder</code>s created by this factory.</p>
+ *
+ * <p>
+ * Feature names are fully qualified {@link java.net.URI}s.
+ * Implementations may define their own features.
+ * A {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
+ * <code>DocumentBuilder</code>s it creates cannot support the feature.
+ * It is possible for a <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
+ * </p>
+ *
+ * <p>
+ * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
+ * When the feature is:</p>
+ * <ul>
+ * <li>
+ * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
+ * Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
+ * If XML processing is limited for security reasons, it will be reported via a call to the registered
+ * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
+ * See {@link DocumentBuilder#setErrorHandler(org.xml.sax.ErrorHandler errorHandler)}.
+ * </li>
+ * <li>
+ * <code>false</code>: the implementation will processing XML according to the XML specifications without
+ * regard to possible implementation limits.
+ * </li>
+ * </ul>
+ *
+ * @param name Feature name.
+ * @param value Is feature state <code>true</code> or <code>false</code>.
+ *
+ * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code> or the <code>DocumentBuilder</code>s
+ * it creates cannot support this feature.
+ * @throws NullPointerException If the <code>name</code> parameter is null.
+ */
+ public abstract void setFeature(String name, boolean value)
+ throws ParserConfigurationException;
+
+ /**
+ * <p>Get the state of the named feature.</p>
+ *
+ * <p>
+ * Feature names are fully qualified {@link java.net.URI}s.
+ * Implementations may define their own features.
+ * An {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
+ * <code>DocumentBuilder</code>s it creates cannot support the feature.
+ * It is possible for an <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
+ * </p>
+ *
+ * @param name Feature name.
+ *
+ * @return State of the named feature.
+ *
+ * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code>
+ * or the <code>DocumentBuilder</code>s it creates cannot support this feature.
+ */
+ public abstract boolean getFeature(String name)
+ throws ParserConfigurationException;
+
+
+ /** <p>Get current state of canonicalization.</p>
+ *
+ * @return current state canonicalization control
+ */
+ /*
+ public boolean getCanonicalization() {
+ return canonicalState;
+ }
+ */
+
+
+ /**
+ * Gets the {@link Schema} object specified through
+ * the {@link #setSchema(Schema schema)} method.
+ *
+ * @return
+ * the {@link Schema} object that was last set through
+ * the {@link #setSchema(Schema)} method, or null
+ * if the method was not invoked since a {@link DocumentBuilderFactory}
+ * is created.
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method.
+ *
+ * @since 1.5
+ */
+ public Schema getSchema() {
+ throw new UnsupportedOperationException(
+ "This parser does not support specification \""
+ + this.getClass().getPackage().getSpecificationTitle()
+ + "\" version \""
+ + this.getClass().getPackage().getSpecificationVersion()
+ + "\""
+ );
+
+ }
+
+ /* <p>Set canonicalization control to <code>true</code> or
+ * </code>false</code>.</p>
+ *
+ * @param state of canonicalization
+ */
+ /*
+ public void setCanonicalization(boolean state) {
+ canonicalState = state;
+ }
+ */
+
+ /**
+ * <p>Set the {@link Schema} to be used by parsers created
+ * from this factory.
+ *
+ * <p>
+ * When a {@link Schema} is non-null, a parser will use a validator
+ * created from it to validate documents before it passes information
+ * down to the application.
+ *
+ * <p>When errors are found by the validator, the parser is responsible
+ * to report them to the user-specified {@link org.xml.sax.ErrorHandler}
+ * (or if the error handler is not set, ignore them or throw them), just
+ * like any other errors found by the parser itself.
+ * In other words, if the user-specified {@link org.xml.sax.ErrorHandler}
+ * is set, it must receive those errors, and if not, they must be
+ * treated according to the implementation specific
+ * default error handling rules.
+ *
+ * <p>
+ * A validator may modify the outcome of a parse (for example by
+ * adding default values that were missing in documents), and a parser
+ * is responsible to make sure that the application will receive
+ * modified DOM trees.
+ *
+ * <p>
+ * Initialy, null is set as the {@link Schema}.
+ *
+ * <p>
+ * This processing will take effect even if
+ * the {@link #isValidating()} method returns <code>false</code>.
+ *
+ * <p>It is an error to use
+ * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
+ * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
+ * property in conjunction with a {@link Schema} object.
+ * Such configuration will cause a {@link ParserConfigurationException}
+ * exception when the {@link #newDocumentBuilder()} is invoked.</p>
+ *
+ *
+ * <h4>Note for implmentors</h4>
+ *
+ * <p>
+ * A parser must be able to work with any {@link Schema}
+ * implementation. However, parsers and schemas are allowed
+ * to use implementation-specific custom mechanisms
+ * as long as they yield the result described in the specification.
+ * </p>
+ *
+ * @param schema <code>Schema</code> to use or <code>null</code>
+ * to remove a schema.
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method.
+ *
+ * @since 1.5
+ */
+ public void setSchema(Schema schema) {
+ throw new UnsupportedOperationException(
+ "This parser does not support specification \""
+ + this.getClass().getPackage().getSpecificationTitle()
+ + "\" version \""
+ + this.getClass().getPackage().getSpecificationVersion()
+ + "\""
+ );
+ }
+
+
+
+ /**
+ * <p>Set state of XInclude processing.</p>
+ *
+ * <p>If XInclude markup is found in the document instance, should it be
+ * processed as specified in <a href="http://www.w3.org/TR/xinclude/">
+ * XML Inclusions (XInclude) Version 1.0</a>.</p>
+ *
+ * <p>XInclude processing defaults to <code>false</code>.</p>
+ *
+ * @param state Set XInclude processing to <code>true</code> or
+ * <code>false</code>
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method.
+ *
+ * @since 1.5
+ */
+ public void setXIncludeAware(final boolean state) {
+ throw new UnsupportedOperationException(
+ "This parser does not support specification \""
+ + this.getClass().getPackage().getSpecificationTitle()
+ + "\" version \""
+ + this.getClass().getPackage().getSpecificationVersion()
+ + "\""
+ );
+ }
+
+ /**
+ * <p>Get state of XInclude processing.</p>
+ *
+ * @return current state of XInclude processing
+ *
+ * @throws UnsupportedOperationException When implementation does not
+ * override this method.
+ *
+ * @since 1.5
+ */
+ public boolean isXIncludeAware() {
+ throw new UnsupportedOperationException(
+ "This parser does not support specification \""
+ + this.getClass().getPackage().getSpecificationTitle()
+ + "\" version \""
+ + this.getClass().getPackage().getSpecificationVersion()
+ + "\""
+ );
+ }
+}
Added: trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryConfigurationError.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryConfigurationError.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryConfigurationError.java 2007-08-25 08:15:49 UTC (rev 3406)
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.parsers;
+
+/**
+ * Thrown when a problem with configuration with the Parser Factories
+ * exists. This error will typically be thrown when the class of a
+ * parser factory specified in the system properties cannot be found
+ * or instantiated.
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @version $Revision: 1.2 $, $Date: 2005/06/10 03:50:29 $
+ */
+
+public class FactoryConfigurationError extends Error {
+
+ /**
+ *<code>Exception</code> that represents the error.
+ */
+ private Exception exception;
+
+ /**
+ * Create a new <code>FactoryConfigurationError</code> with no
+ * detail mesage.
+ */
+
+ public FactoryConfigurationError() {
+ super();
+ this.exception = null;
+ }
+
+ /**
+ * Create a new <code>FactoryConfigurationError</code> with
+ * the <code>String </code> specified as an error message.
+ *
+ * @param msg The error message for the exception.
+ */
+
+ public FactoryConfigurationError(String msg) {
+ super(msg);
+ this.exception = null;
+ }
+
+
+ /**
+ * Create a new <code>FactoryConfigurationError</code> with a
+ * given <code>Exception</code> base cause of the error.
+ *
+ * @param e The exception to be encapsulated in a
+ * FactoryConfigurationError.
+ */
+
+ public FactoryConfigurationError(Exception e) {
+ super(e.toString());
+ this.exception = e;
+ }
+
+ /**
+ * Create a new <code>FactoryConfigurationError</code> with the
+ * given <code>Exception</code> base cause and detail message.
+ *
+ * @param e The exception to be encapsulated in a
+ * FactoryConfigurationError
+ * @param msg The detail message.
+ */
+
+ public FactoryConfigurationError(Exception e, String msg) {
+ super(msg);
+ this.exception = e;
+ }
+
+
+ /**
+ * Return the message (if any) for this error . If there is no
+ * message for the exception and there is an encapsulated
+ * exception then the message of that exception, if it exists will be
+ * returned. Else the name of the encapsulated exception will be
+ * returned.
+ *
+ * @return The error message.
+ */
+
+ public String getMessage () {
+ String message = super.getMessage ();
+
+ if (message == null && exception != null) {
+ return exception.getMessage();
+ }
+
+ return message;
+ }
+
+ /**
+ * Return the actual exception (if any) that caused this exception to
+ * be raised.
+ *
+ * @return The encapsulated exception, or null if there is none.
+ */
+
+ public Exception getException () {
+ return exception;
+ }
+}
Added: trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryFinder.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryFinder.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/parsers/FactoryFinder.java 2007-08-25 08:15:49 UTC (rev 3406)
@@ -0,0 +1,316 @@
+/*
+ * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import java.util.Properties;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+/**
+ * <p>Implements pluggable Datatypes.</p>
+ *
+ * <p>This class is duplicated for each JAXP subpackage so keep it in
+ * sync. It is package private for secure class loading.</p>
+ *
+ * @author San...@su...
+ */
+class FactoryFinder {
+
+ /**
+ * Internal debug flag.
+ */
+ private static boolean debug = false;
+
+ /**
+ * Cache for properties in java.home/lib/jaxp.properties
+ */
+ static Properties cacheProps = new Properties();
+
+ /**
+ * Flag indicating if properties from java.home/lib/jaxp.properties
+ * have been cached.
+ */
+ static boolean firstTime = true;
+
+ /**
+ * Security support class use to check access control before
+ * getting certain system resources.
+ */
+ static SecuritySupport ss = new SecuritySupport();
+
+ // Define system property "jaxp.debug" to get output
+ static {
+ // Use try/catch block to support applets, which throws
+ // SecurityException out of this code.
+ try {
+ String val = ss.getSystemProperty("jaxp.debug");
+ // Allow simply setting the prop to turn on debug
+ debug = val != null && !"false".equals(val);
+ }
+ catch (SecurityException se) {
+ debug = false;
+ }
+ }
+
+ private static void dPrint(String msg) {
+ if (debug) {
+ System.err.println("JAXP: " + msg);
+ }
+ }
+
+ /**
+ * Attempt to load a class using the class loader supplied. If that fails
+ * and fall back is enabled, the current (i.e. bootstrap) class loader is
+ * tried.
+ *
+ * If the class loader supplied is <code>null</code>, first try using the
+ * context class loader followed by the current (i.e. bootstrap) class
+ * loader.
+ */
+ static private Class getProviderClass(String className, ClassLoader cl,
+ boolean doFallback) throws ClassNotFoundException
+ {
+ try {
+ if (cl == null) {
+ cl = ss.getContextClassLoader();
+ if (cl == null) {
+ throw new ClassNotFoundException();
+ }
+ else {
+ return cl.loadClass(className);
+ }
+ }
+ else {
+ return cl.loadClass(className);
+ }
+ }
+ catch (ClassNotFoundException e1) {
+ if (doFallback) {
+ // Use current class loader - should always be bootstrap CL
+ return Class.forName(className, true, FactoryFinder.class.getClassLoader());
+ }
+ else {
+ throw e1;
+ }
+ }
+ }
+
+ /**
+ * Create an instance of a class. Delegates to method
+ * <code>getProviderClass()</code> in order to load the class.
+ *
+ * @param className Name of the concrete class corresponding to the
+ * service provider
+ *
+ * @param cl ClassLoader to use to load the class, null means to use
+ * the bootstrap ClassLoader
+ *
+ * @param doFallback True if the current ClassLoader should be tried as
+ * a fallback if the class is not found using cl
+ */
+ static Object newInstance(String className, ClassLoader cl, boolean doFallback)
+ throws ConfigurationError
+ {
+ try {
+ Class providerClass = getProviderClass(className, cl, doFallback);
+ Object instance = providerClass.newInstance();
+ dPrint("created new instance of " + providerClass +
+ " using ClassLoader: " + cl);
+ return instance;
+ }
+ catch (ClassNotFoundException x) {
+ throw new ConfigurationError(
+ "Provider " + className + " not found", x);
+ }
+ catch (Exception x) {
+ throw new ConfigurationError(
+ "Provider " + className + " could not be instantiated: " + x,
+ x);
+ }
+ }
+
+ /**
+ * Finds the implementation Class object in the specified order. Main
+ * entry point.
+ * @return Class object of factory, never null
+ *
+ * @param factoryId Name of the factory to find, same as
+ * a property name
+ * @param fallbackClassName Implementation class name, if nothing else
+ * is found. Use null to mean no fallback.
+ *
+ * Package private so this code can be shared.
+ */
+ static Object find(String factoryId, String fallbackClassName)
+ throws ConfigurationError
+ {
+ dPrint("find factoryId =" + factoryId);
+
+ // Use the system property first
+ try {
+ String systemProp = ss.getSystemProperty(factoryId);
+ if (systemProp != null) {
+ dPrint("found system property, value=" + systemProp);
+ return newInstance(systemProp, null, true);
+ }
+ }
+ catch (SecurityException se) {
+ if (debug) se.printStackTrace();
+ }
+
+ // try to read from $java.home/lib/jaxp.properties
+ try {
+ String factoryClassName = null;
+ if (firstTime) {
+ synchronized (cacheProps) {
+ if (firstTime) {
+ String configFile = ss.getSystemProperty("java.home") + File.separator +
+ "lib" + File.separator + "jaxp.properties";
+ File f = new File(configFile);
+ firstTime = false;
+ if (ss.doesFileExist(f)) {
+ dPrint("Read properties file "+f);
+ cacheProps.load(ss.getFileInputStream(f));
+ }
+ }
+ }
+ }
+ factoryClassName = cacheProps.getProperty(factoryId);
+
+ if (factoryClassName != null) {
+ dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
+ return newInstance(factoryClassName, null, true);
+ }
+ }
+ catch (Exception ex) {
+ if (debug) ex.printStackTrace();
+ }
+
+ // Try Jar Service Provider Mechanism
+ Object provider = findJarServiceProvider(factoryId);
+ if (provider != null) {
+ return provider;
+ }
+ if (fallbackClassName == null) {
+ throw new ConfigurationError(
+ "Provider for " + factoryId + " cannot be found", null);
+ }
+
+ dPrint("loaded from fallback value: " + fallbackClassName);
+ return newInstance(fallbackClassName, null, true);
+ }
+
+ /*
+ * Try to find provider using Jar Service Provider Mechanism
+ *
+ * @return instance of provider class if found or null
+ */
+ private static Object findJarServiceProvider(String factoryId)
+ throws ConfigurationError
+ {
+ String serviceId = "META-INF/services/" + factoryId;
+ InputStream is = null;
+
+ // First try the Context ClassLoader
+ ClassLoader cl = ss.getContextClassLoader();
+ if (cl != null) {
+ is = ss.getResourceAsStream(cl, serviceId);
+
+ // If no provider found then try the current ClassLoader
+ if (is == null) {
+ cl = FactoryFinder.class.getClassLoader();
+ is = ss.getResourceAsStream(cl, serviceId);
+ }
+ } else {
+ // No Context ClassLoader, try the current ClassLoader
+ cl = FactoryFinder.class.getClassLoader();
+ is = ss.getResourceAsStream(cl, serviceId);
+ }
+
+ if (is == null) {
+ // No provider found
+ return null;
+ }
+
+ dPrint("found jar resource=" + serviceId + " using ClassLoader: " + cl);
+
+ BufferedReader rd;
+ try {
+ rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+ }
+ catch (java.io.UnsupportedEncodingException e) {
+ rd = new BufferedReader(new InputStreamReader(is));
+ }
+
+ String factoryClassName = null;
+ try {
+ // XXX Does not handle all possible input as specified by the
+ // Jar Service Provider specification
+ factoryClassName = rd.readLine();
+ rd.close();
+ } catch (IOException x) {
+ // No provider found
+ return null;
+ }
+
+ if (factoryClassName != null && !"".equals(factoryClassName)) {
+ dPrint("found in resource, value=" + factoryClassName);
+
+ // Note: here we do not want to fall back to the current
+ // ClassLoader because we want to avoid the case where the
+ // resource file was found using one ClassLoader and the
+ // provider class was instantiated using a different one.
+ return newInstance(factoryClassName, cl, false);
+ }
+
+ // No provider found
+ return null;
+ }
+
+ static class ConfigurationError extends Error {
+ private Exception exception;
+
+ /**
+ * Construct a new instance with the specified detail string and
+ * exception.
+ */
+ ConfigurationError(String msg, Exception x) {
+ super(msg);
+ this.exception = x;
+ }
+
+ Exception getException() {
+ return exception;
+ }
+ }
+
+}
Added: trunk/core/src/openjdk/javax/javax/xml/parsers/ParserConfigurationException.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/parsers/ParserConfigurationException.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/parsers/ParserConfigurationException.java 2007-08-25 08:15:49 UTC (rev 3406)
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.parsers;
+
+/**
+ * Indicates a serious configuration error.
+ *
+ * @author <a href="mailto:Jef...@Su...">Jeff Suttor</a>
+ * @version $Revision: 1.2 $, $Date: 2005/06/10 03:50:29 $
+ */
+
+public class ParserConfigurationException extends Exception {
+
+ /**
+ * Create a new <code>ParserConfigurationException</code> with no
+ * detail mesage.
+ */
+
+ public ParserConfigurationException() {
+ super();
+ }
+
+ /**
+ * Create a new <code>ParserConfigurationException</code> with
+ * the <code>String</code> specified as an error message.
+ *
+ * @param msg The error message for the exception.
+ */
+
+ public ParserConfigurationException(String msg) {
+ super(msg);
+ }
+
+}
+
Added: trunk/core/src/openjdk/javax/javax/xml/parsers/SAXParser.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/xml/parsers/SAXParser.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/xml/parsers/SAXParser.java 2007-08-25 08:15:49 UTC (rev 3406)
@@ -0,0 +1,533 @@
+/*
+ * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+...
[truncated message content] |