8025054: Update JAX-WS RI integration to 2.2.9-b130926.1035

Reviewed-by: chegar
This commit is contained in:
Miroslav Kos 2013-10-04 16:21:34 +01:00
parent 0290019388
commit 69e3b11c83
136 changed files with 5246 additions and 3674 deletions

View File

@ -88,9 +88,9 @@ public class ExternalMetadataFeature extends WebServiceFeature {
return ID; return ID;
} }
public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableSecureXmlProcessing) { public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableXmlSecurity) {
if (reader != null && enabled) return reader; if (reader != null && enabled) return reader;
return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableSecureXmlProcessing) : null; return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableXmlSecurity) : null;
} }
@Override @Override

View File

@ -30,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \
Non-existent directory: {0} Non-existent directory: {0}
VERSION = \ VERSION = \
schemagen 2.2.8-b20130806.1801 schemagen 2.2.8-b130911.1802
FULLVERSION = \ FULLVERSION = \
schemagen full version "2.2.8-b20130806.1801" schemagen full version "2.2.8-b130911.1802"
USAGE = \ USAGE = \
Usage: schemagen [-options ...] <java files> \n\ Usage: schemagen [-options ...] <java files> \n\

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2}
BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0} BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.8-b20130806.1801" FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.8-b130911.1802"
USAGE = Verwendung: schemagen [-options ...] <java files> \nOptionen: \n\\ \\ \\ \\ -d <path> : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp <path> : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath <path> : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding <encoding> : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode <file> : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an USAGE = Verwendung: schemagen [-options ...] <java files> \nOptionen: \n\\ \\ \\ \\ -d <path> : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp <path> : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath <path> : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding <encoding> : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode <file> : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu
BASEDIR_DOESNT_EXIST = Directorio no existente: {0} BASEDIR_DOESNT_EXIST = Directorio no existente: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = versi\u00F3n completa de schemagen "2.2.8-b20130806.1801" FULLVERSION = versi\u00F3n completa de schemagen "2.2.8-b130911.1802"
USAGE = Sintaxis: schemagen [-options ...] <archivos java> \nOpciones: \n\\ \\ \\ \\ -d <ruta de acceso> : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp <ruta de acceso> : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding <codificaci\u00F3n> : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode <archivo> : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis USAGE = Sintaxis: schemagen [-options ...] <archivos java> \nOpciones: \n\\ \\ \\ \\ -d <ruta de acceso> : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp <ruta de acceso> : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding <codificaci\u00F3n> : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode <archivo> : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0
BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = version compl\u00E8te de schemagen "2.2.8-b20130806.1801" FULLVERSION = version compl\u00E8te de schemagen "2.2.8-b130911.1802"
USAGE = Syntaxe : schemagen [-options ...] <java files> \nOptions : \n\ \ \ \ -d <path> : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding <encoding> : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode <file> : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe USAGE = Syntaxe : schemagen [-options ...] <java files> \nOptions : \n\ \ \ \ -d <path> : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding <encoding> : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode <file> : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2}
BASEDIR_DOESNT_EXIST = Directory non esistente: {0} BASEDIR_DOESNT_EXIST = Directory non esistente: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = versione completa schemagen "2.2.8-b20130806.1801" FULLVERSION = versione completa schemagen "2.2.8-b130911.1802"
USAGE = Uso: schemagen [-options ...] <java files> \nOpzioni: \n\ \ \ \ -d <path> : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp <path> : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath <path> : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding <encoding> : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode <file> : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso USAGE = Uso: schemagen [-options ...] <java files> \nOpzioni: \n\ \ \ \ -d <path> : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp <path> : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath <path> : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding <encoding> : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode <file> : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u
BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b20130806.1801" FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b130911.1802"
USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] <java files> \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d <path> : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp <path> : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath <path> : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding <encoding> : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode <file> : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059 USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] <java files> \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d <path> : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp <path> : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath <path> : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding <encoding> : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode <file> : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD
BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0} BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.8-b20130806.1801" FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.8-b130911.1802"
USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] <java files> \n\uC635\uC158: \n\ \ \ \ -d <path> : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp <path> : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath <path> : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding <encoding> : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode <file> : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4. USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] <java files> \n\uC635\uC158: \n\ \ \ \ -d <path> : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp <path> : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath <path> : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding <encoding> : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode <file> : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2}
BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0} BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0}
VERSION = gera\u00E7\u00E3o do esquema 2.2.8-b20130806.1801 VERSION = gera\u00E7\u00E3o do esquema 2.2.8-b130911.1802
FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.8-b20130806.1801" FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.8-b130911.1802"
USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] <java files> \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d <path> : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp <path> : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath <path> : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding <encoding> : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode <file> : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] <java files> \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d <path> : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp <path> : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath <path> : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding <encoding> : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode <file> : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0} BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802"
USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9009\u9879: \n\ \ \ \ -d <path> : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp <path> : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath <path> : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding <encoding> : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode <file> : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9009\u9879: \n\ \ \ \ -d <path> : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp <path> : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath <path> : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding <encoding> : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode <file> : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F

View File

@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0} BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0}
VERSION = schemagen 2.2.8-b20130806.1801 VERSION = schemagen 2.2.8-b130911.1802
FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802"
USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9078\u9805: \n\\ \\ \\ \\ -d <path> : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp <path> : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath <path> : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding <encoding> : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode <file> : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9078\u9805: \n\\ \\ \\ \\ -d <path> : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp <path> : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath <path> : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding <encoding> : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode <file> : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F

View File

@ -269,6 +269,20 @@ public final class WscompileMessages {
return localizer.localize(localizableWSIMPORT_USAGE(arg0)); return localizer.localize(localizableWSIMPORT_USAGE(arg0));
} }
public static Localizable localizableWSGEN_USAGE_EXTENSIONS() {
return messageFactory.getMessage("wsgen.usage.extensions");
}
/**
*
* Extensions:
* -Xnocompile do not compile generated Java files
*
*/
public static String WSGEN_USAGE_EXTENSIONS() {
return localizer.localize(localizableWSGEN_USAGE_EXTENSIONS());
}
public static Localizable localizablePLEASE() { public static Localizable localizablePLEASE() {
return messageFactory.getMessage("Please"); return messageFactory.getMessage("Please");
} }
@ -283,6 +297,19 @@ public final class WscompileMessages {
return localizer.localize(localizablePLEASE()); return localizer.localize(localizablePLEASE());
} }
public static Localizable localizableWSCOMPILE_EXISTING_OPTION(Object arg0) {
return messageFactory.getMessage("wscompile.existingOption", arg0);
}
/**
* Ignoring already defined option {0}
*
*
*/
public static String WSCOMPILE_EXISTING_OPTION(Object arg0) {
return localizer.localize(localizableWSCOMPILE_EXISTING_OPTION(arg0));
}
public static Localizable localizableWSIMPORT_PARSING_WSDL() { public static Localizable localizableWSIMPORT_PARSING_WSDL() {
return messageFactory.getMessage("wsimport.ParsingWSDL"); return messageFactory.getMessage("wsimport.ParsingWSDL");
} }
@ -323,6 +350,8 @@ public final class WscompileMessages {
* -B<jaxbOption> Pass this option to JAXB schema compiler * -B<jaxbOption> Pass this option to JAXB schema compiler
* -catalog <file> specify catalog file to resolve external entity references * -catalog <file> specify catalog file to resolve external entity references
* supports TR9401, XCatalog, and OASIS XML Catalog format. * supports TR9401, XCatalog, and OASIS XML Catalog format.
* -classpath <path> specify where to find user class files and wsimport extensions
* -cp <path> specify where to find user class files and wsimport extensions
* -d <directory> specify where to place generated output files * -d <directory> specify where to place generated output files
* -encoding <encoding> specify character encoding used by source files * -encoding <encoding> specify character encoding used by source files
* -extension allow vendor extensions - functionality not specified * -extension allow vendor extensions - functionality not specified
@ -332,6 +361,7 @@ public final class WscompileMessages {
* -help display help * -help display help
* -httpproxy:<proxy> set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort * -httpproxy:<proxy> set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort
* (port defaults to 8080) * (port defaults to 8080)
* -J<javacOption> pass this option to javac
* -keep keep generated files * -keep keep generated files
* -p <pkg> specifies the target package * -p <pkg> specifies the target package
* -quiet suppress wsimport output * -quiet suppress wsimport output
@ -343,7 +373,7 @@ public final class WscompileMessages {
* -version print version information * -version print version information
* -fullversion print full version information * -fullversion print full version information
* -wsdllocation <location> @WebServiceClient.wsdlLocation value * -wsdllocation <location> @WebServiceClient.wsdlLocation value
* -clientjar <jarfile> Creates the jar file of the generated artifacts along with the * -clientjar <jarfile> creates the jar file of the generated artifacts along with the
* WSDL metadata required for invoking the web service. * WSDL metadata required for invoking the web service.
* -generateJWS generate stubbed JWS implementation file * -generateJWS generate stubbed JWS implementation file
* -implDestDir <directory> specify where to generate JWS implementation file * -implDestDir <directory> specify where to generate JWS implementation file
@ -656,8 +686,8 @@ public final class WscompileMessages {
* Usage: {0} [options] <SEI> * Usage: {0} [options] <SEI>
* *
* where [options] include: * where [options] include:
* -classpath <path> specify where to find input class files * -classpath <path> specify where to find input class files and wsgen extensions
* -cp <path> same as -classpath <path> * -cp <path> specify where to find input class files and wsgen extensions
* -d <directory> specify where to place generated output files * -d <directory> specify where to place generated output files
* -encoding <encoding> specify character encoding used by source files * -encoding <encoding> specify character encoding used by source files
* -extension allow vendor extensions - functionality not specified * -extension allow vendor extensions - functionality not specified
@ -665,6 +695,7 @@ public final class WscompileMessages {
* result in applications that are not portable or * result in applications that are not portable or
* may not interoperate with other implementations * may not interoperate with other implementations
* -help display help * -help display help
* -J<javacOption> pass this option to javac
* -keep keep generated files * -keep keep generated files
* -r <directory> resource destination directory, specify where to * -r <directory> resource destination directory, specify where to
* place resouce files such as WSDLs * place resouce files such as WSDLs
@ -675,7 +706,7 @@ public final class WscompileMessages {
* -wsdl[:protocol] generate a WSDL file. The protocol is optional. * -wsdl[:protocol] generate a WSDL file. The protocol is optional.
* Valid protocols are {1}, * Valid protocols are {1},
* the default is soap1.1. * the default is soap1.1.
* The non stanadard protocols {2} * The non standard protocols {2}
* can only be used in conjunction with the * can only be used in conjunction with the
* -extension option. * -extension option.
* -inlineSchemas inline schemas in the generated wsdl. Must be * -inlineSchemas inline schemas in the generated wsdl. Must be
@ -684,6 +715,7 @@ public final class WscompileMessages {
* Used in conjunction with the -wsdl option. * Used in conjunction with the -wsdl option.
* -portname <name> specify the Port name to use in the generated WSDL * -portname <name> specify the Port name to use in the generated WSDL
* Used in conjunction with the -wsdl option. * Used in conjunction with the -wsdl option.
* -x <file> specify External Web Service Metadata xml descriptor
* *
*/ */
public static String WSGEN_HELP(Object arg0, Object arg1, Object arg2) { public static String WSGEN_HELP(Object arg0, Object arg1, Object arg2) {
@ -835,6 +867,18 @@ public final class WscompileMessages {
return localizer.localize(localizableWSIMPORT_AUTH_INFO_LINENO(arg0, arg1)); return localizer.localize(localizableWSIMPORT_AUTH_INFO_LINENO(arg0, arg1));
} }
public static Localizable localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
return messageFactory.getMessage("wsgen.servicename.missing.localname", arg0);
}
/**
* The service name "{0}" is missing a localname.
*
*/
public static String WSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(arg0));
}
public static Localizable localizableWSGEN_USAGE(Object arg0) { public static Localizable localizableWSGEN_USAGE(Object arg0) {
return messageFactory.getMessage("wsgen.usage", arg0); return messageFactory.getMessage("wsgen.usage", arg0);
} }
@ -849,18 +893,6 @@ public final class WscompileMessages {
return localizer.localize(localizableWSGEN_USAGE(arg0)); return localizer.localize(localizableWSGEN_USAGE(arg0));
} }
public static Localizable localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
return messageFactory.getMessage("wsgen.servicename.missing.localname", arg0);
}
/**
* The service name "{0}" is missing a localname.
*
*/
public static String WSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(arg0));
}
public static Localizable localizableWSGEN_SERVICENAME_MISSING_NAMESPACE(Object arg0) { public static Localizable localizableWSGEN_SERVICENAME_MISSING_NAMESPACE(Object arg0) {
return messageFactory.getMessage("wsgen.servicename.missing.namespace", arg0); return messageFactory.getMessage("wsgen.servicename.missing.namespace", arg0);
} }

View File

@ -33,6 +33,8 @@ wsimport.help=\nUsage: {0} [options] <WSDL_URI>\n\n\
\ -B<jaxbOption> Pass this option to JAXB schema compiler\n\ \ -B<jaxbOption> Pass this option to JAXB schema compiler\n\
\ -catalog <file> specify catalog file to resolve external entity references\n\ \ -catalog <file> specify catalog file to resolve external entity references\n\
\ supports TR9401, XCatalog, and OASIS XML Catalog format.\n\ \ supports TR9401, XCatalog, and OASIS XML Catalog format.\n\
\ -classpath <path> specify where to find user class files and wsimport extensions\n\
\ -cp <path> specify where to find user class files and wsimport extensions\n\
\ -d <directory> specify where to place generated output files\n\ \ -d <directory> specify where to place generated output files\n\
\ -encoding <encoding> specify character encoding used by source files\n\ \ -encoding <encoding> specify character encoding used by source files\n\
\ -extension allow vendor extensions - functionality not specified\n\ \ -extension allow vendor extensions - functionality not specified\n\
@ -42,6 +44,7 @@ wsimport.help=\nUsage: {0} [options] <WSDL_URI>\n\n\
\ -help display help\n\ \ -help display help\n\
\ -httpproxy:<proxy> set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort\n\ \ -httpproxy:<proxy> set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort\n\
\ (port defaults to 8080)\n\ \ (port defaults to 8080)\n\
\ -J<javacOption> pass this option to javac\n\
\ -keep keep generated files\n\ \ -keep keep generated files\n\
\ -p <pkg> specifies the target package\n\ \ -p <pkg> specifies the target package\n\
\ -quiet suppress wsimport output\n\ \ -quiet suppress wsimport output\n\
@ -53,7 +56,7 @@ wsimport.help=\nUsage: {0} [options] <WSDL_URI>\n\n\
\ -version print version information\n\ \ -version print version information\n\
\ -fullversion print full version information\n\ \ -fullversion print full version information\n\
\ -wsdllocation <location> @WebServiceClient.wsdlLocation value\n\ \ -wsdllocation <location> @WebServiceClient.wsdlLocation value\n\
\ -clientjar <jarfile> Creates the jar file of the generated artifacts along with the\n\ \ -clientjar <jarfile> creates the jar file of the generated artifacts along with the\n\
\ WSDL metadata required for invoking the web service.\n\ \ WSDL metadata required for invoking the web service.\n\
\ -generateJWS generate stubbed JWS implementation file\n\ \ -generateJWS generate stubbed JWS implementation file\n\
\ -implDestDir <directory> specify where to generate JWS implementation file\n\ \ -implDestDir <directory> specify where to generate JWS implementation file\n\
@ -91,8 +94,8 @@ Use "wsgen -help" for a detailed description of options.
wsgen.help=\nUsage: {0} [options] <SEI>\n\n\ wsgen.help=\nUsage: {0} [options] <SEI>\n\n\
\where [options] include:\n\ \where [options] include:\n\
\ -classpath <path> specify where to find input class files\n\ \ -classpath <path> specify where to find input class files and wsgen extensions\n\
\ -cp <path> same as -classpath <path>\n\ \ -cp <path> specify where to find input class files and wsgen extensions\n\
\ -d <directory> specify where to place generated output files\n\ \ -d <directory> specify where to place generated output files\n\
\ -encoding <encoding> specify character encoding used by source files\n\ \ -encoding <encoding> specify character encoding used by source files\n\
\ -extension allow vendor extensions - functionality not specified\n\ \ -extension allow vendor extensions - functionality not specified\n\
@ -100,6 +103,7 @@ wsgen.help=\nUsage: {0} [options] <SEI>\n\n\
\ result in applications that are not portable or\n\ \ result in applications that are not portable or\n\
\ may not interoperate with other implementations\n\ \ may not interoperate with other implementations\n\
\ -help display help\n\ \ -help display help\n\
\ -J<javacOption> pass this option to javac\n\
\ -keep keep generated files\n\ \ -keep keep generated files\n\
\ -r <directory> resource destination directory, specify where to\n\ \ -r <directory> resource destination directory, specify where to\n\
\ place resouce files such as WSDLs\n\ \ place resouce files such as WSDLs\n\
@ -110,7 +114,7 @@ wsgen.help=\nUsage: {0} [options] <SEI>\n\n\
\ -wsdl[:protocol] generate a WSDL file. The protocol is optional.\n\ \ -wsdl[:protocol] generate a WSDL file. The protocol is optional.\n\
\ Valid protocols are {1},\n\ \ Valid protocols are {1},\n\
\ the default is soap1.1.\n\ \ the default is soap1.1.\n\
\ The non stanadard protocols {2}\n\ \ The non standard protocols {2}\n\
\ can only be used in conjunction with the\n\ \ can only be used in conjunction with the\n\
\ -extension option.\n\ \ -extension option.\n\
\ -inlineSchemas inline schemas in the generated wsdl. Must be\n\ \ -inlineSchemas inline schemas in the generated wsdl. Must be\n\
@ -118,8 +122,12 @@ wsgen.help=\nUsage: {0} [options] <SEI>\n\n\
\ -servicename <name> specify the Service name to use in the generated WSDL\n\ \ -servicename <name> specify the Service name to use in the generated WSDL\n\
\ Used in conjunction with the -wsdl option.\n\ \ Used in conjunction with the -wsdl option.\n\
\ -portname <name> specify the Port name to use in the generated WSDL\n\ \ -portname <name> specify the Port name to use in the generated WSDL\n\
\ Used in conjunction with the -wsdl option. \ Used in conjunction with the -wsdl option.\n\
\ -x <file> specify External Web Service Metadata xml descriptor
wsgen.usage.extensions=\n\
\Extensions:\n\
\ -Xnocompile do not compile generated Java files
wsgen.usage.examples=\n\ wsgen.usage.examples=\n\
\Examples:\n\ \Examples:\n\
@ -151,6 +159,7 @@ or use -Xendorsed option.
# Generic Messages # Generic Messages
# #
wscompile.invalidOption=unrecognized parameter {0} wscompile.invalidOption=unrecognized parameter {0}
wscompile.existingOption=Ignoring already defined option {0}\n
wsimport.noSuchJaxbOption=no such JAXB option: {0} wsimport.noSuchJaxbOption=no such JAXB option: {0}
wscompile.error=error: {0} wscompile.error=error: {0}

View File

@ -23,7 +23,7 @@
# questions. # questions.
# #
build-id=2.2.9-b14140 build-id=2.2.9-b130926.1035
build-version=JAX-WS RI 2.2.9-b14140 build-version=JAX-WS RI 2.2.9-b130926.1035
major-version=2.2.9 major-version=2.2.9
svn-revision=14140 svn-revision=8c29a9a53251ff741fca1664a8221dc876b2eac8

View File

@ -87,6 +87,13 @@ public class Options {
public String classpath = System.getProperty("java.class.path"); public String classpath = System.getProperty("java.class.path");
/**
* -javacOptions
*
* @since 2.2.9
*/
public List<String> javacOptions;
/** /**
* -Xnocompile * -Xnocompile
@ -94,10 +101,13 @@ public class Options {
public boolean nocompile; public boolean nocompile;
/** /**
* Disable secure xml processing. * If true XML security features when parsing XML documents will be disabled.
* -XdisableSecureXmlProcessing * The default value is false.
*
* Boolean
* @since 2.2.9
*/ */
public boolean disableSecureXmlProcessing = false; public boolean disableXmlSecurity;
public enum Target { public enum Target {
V2_0, V2_1, V2_2; V2_0, V2_1, V2_2;
@ -354,13 +364,24 @@ public class Options {
throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding));
} }
return 2; return 2;
} else if (args[i].equals("-XdisableSecureXmlProcessing")) { } else if (args[i].equals("-disableXmlSecurity")) {
disableSecureXmlProcessing= true; disableXmlSecurity();
return 1;
} else if (args[i].startsWith("-J")) {
if (javacOptions == null) {
javacOptions = new ArrayList<String>();
}
javacOptions.add(args[i].substring(2));
return 1; return 1;
} }
return 0; return 0;
} }
// protected method to allow overriding
protected void disableXmlSecurity() {
disableXmlSecurity= true;
}
/** /**
* Obtains an operand and reports an error if it's not there. * Obtains an operand and reports an error if it's not there.
*/ */
@ -372,7 +393,28 @@ public class Options {
return args[i]; return args[i];
} }
List<String> getJavacOptions(List<String> existingOptions, WsimportListener listener) {
List<String> result = new ArrayList<String>();
for (String o: javacOptions) {
if (o.contains("=") && !o.startsWith("A")) {
int i = o.indexOf('=');
String key = o.substring(0, i);
if (existingOptions.contains(key)) {
listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(key));
} else {
result.add(key);
result.add(o.substring(i + 1));
}
} else {
if (existingOptions.contains(o)) {
listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(o));
} else {
result.add(o);
}
}
}
return result;
}
/** /**
* Used to signal that we've finished processing. * Used to signal that we've finished processing.

View File

@ -161,7 +161,7 @@ public class WsgenTool {
final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener); final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class); boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class);
Collection<String> args = new ArrayList<String>(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0) List<String> args = new ArrayList<String>(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0)
+ (options.encoding != null ? 2 : 0)); + (options.encoding != null ? 2 : 0));
args.add("-d"); args.add("-d");
args.add(options.destDir.getAbsolutePath()); args.add(options.destDir.getAbsolutePath());
@ -183,6 +183,9 @@ public class WsgenTool {
.append(File.pathSeparator) .append(File.pathSeparator)
.append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString()); .append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString());
} }
if (options.javacOptions != null) {
args.addAll(options.getJavacOptions(args, listener));
}
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create();
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>(); DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();
@ -205,9 +208,9 @@ public class WsgenTool {
DatabindingConfig config = new DatabindingConfig(); DatabindingConfig config = new DatabindingConfig();
List<String> externalMetadataFileNames = options.externalMetadataFiles; List<String> externalMetadataFileNames = options.externalMetadataFiles;
boolean disableSecureXmlProcessing = options.disableSecureXmlProcessing; boolean disableXmlSecurity = options.disableXmlSecurity;
if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) { if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) {
config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableSecureXmlProcessing)); config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableXmlSecurity));
} }
String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath; String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath;
@ -243,7 +246,7 @@ public class WsgenTool {
final Map<String, File> schemaFiles = new HashMap<String, File>(); final Map<String, File> schemaFiles = new HashMap<String, File>();
WSDLGenInfo wsdlGenInfo = new WSDLGenInfo(); WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
wsdlGenInfo.setSecureXmlProcessingDisabled(disableSecureXmlProcessing); wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity);
wsdlGenInfo.setWsdlResolver( wsdlGenInfo.setWsdlResolver(
new WSDLResolver() { new WSDLResolver() {
@ -404,6 +407,7 @@ public class WsgenTool {
System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", System.out.println(WscompileMessages.WSGEN_HELP("WSGEN",
((WsgenOptions)options).protocols, ((WsgenOptions)options).protocols,
((WsgenOptions)options).nonstdProtocols.keySet())); ((WsgenOptions)options).nonstdProtocols.keySet()));
System.out.println(WscompileMessages.WSGEN_USAGE_EXTENSIONS());
System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES()); System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES());
} }
} }

View File

@ -774,4 +774,10 @@ public class WsimportOptions extends Options {
is.setSystemId(systemId); is.setSystemId(systemId);
} }
} }
@Override
protected void disableXmlSecurity() {
super.disableXmlSecurity();
schemaCompiler.getOptions().disableXmlSecurity = true;
}
} }

View File

@ -524,29 +524,34 @@ public class WsimportTool {
String classDir = options.destDir.getAbsolutePath(); String classDir = options.destDir.getAbsolutePath();
String classpathString = createClasspathString(); String classpathString = createClasspathString();
boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class); boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class);
String[] args = new String[4 + (bootCP ? 1 : 0) + (options.debug ? 1 : 0) List<String> args = new ArrayList<String>();
+ (options.encoding != null ? 2 : 0) + sourceFiles.size()]; args.add("-d");
args[0] = "-d"; args.add(classDir);
args[1] = classDir; args.add("-classpath");
args[2] = "-classpath"; args.add(classpathString);
args[3] = classpathString;
int baseIndex = 4;
//javac is not working in osgi as the url starts with a bundle //javac is not working in osgi as the url starts with a bundle
if (bootCP) { if (bootCP) {
args[baseIndex++] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointContext.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(JAXBPermission.class); args.add("-Xbootclasspath/p:"
+ JavaCompilerHelper.getJarFile(EndpointContext.class)
+ File.pathSeparator
+ JavaCompilerHelper.getJarFile(JAXBPermission.class));
} }
if (options.debug) { if (options.debug) {
args[baseIndex++] = "-g"; args.add("-g");
} }
if (options.encoding != null) { if (options.encoding != null) {
args[baseIndex++] = "-encoding"; args.add("-encoding");
args[baseIndex++] = options.encoding; args.add(options.encoding);
}
if (options.javacOptions != null) {
args.addAll(options.getJavacOptions(args, listener));
} }
for (int i = 0; i < sourceFiles.size(); ++i) { for (int i = 0; i < sourceFiles.size(); ++i) {
args[baseIndex + i] = sourceFiles.get(i); args.add(sourceFiles.get(i));
} }
listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE()); listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE());
@ -558,7 +563,7 @@ public class WsimportTool {
listener.message("javac "+ argstr.toString()); listener.message("javac "+ argstr.toString());
} }
return JavaCompilerHelper.compile(args, out, receiver); return JavaCompilerHelper.compile(args.toArray(new String[args.size()]), out, receiver);
} }
//there are no files to compile, so return true? //there are no files to compile, so return true?
return true; return true;

View File

@ -114,7 +114,7 @@ public class DOMForest {
this.logic = logic; this.logic = logic;
try { try {
// secure xml processing can be switched off if input requires it // secure xml processing can be switched off if input requires it
boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity;
DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled); DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled);
dbf.setNamespaceAware(true); dbf.setNamespaceAware(true);
this.documentBuilder = dbf.newDocumentBuilder(); this.documentBuilder = dbf.newDocumentBuilder();
@ -365,7 +365,7 @@ public class DOMForest {
try { try {
// create identity transformer // create identity transformer
// secure xml processing can be switched off if input requires it // secure xml processing can be switched off if input requires it
boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity;
TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled);
Transformer it = tf.newTransformer(); Transformer it = tf.newTransformer();

View File

@ -171,20 +171,20 @@ Driver.CompilingSchema = \
Driver.FailedToGenerateCode = \ Driver.FailedToGenerateCode = \
Failed to produce code. Failed to produce code.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = \ Driver.FilePrologComment = \
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b20130806.1801 \n\ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 \n\
See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\ See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\
Any modifications to this file will be lost upon recompilation of the source schema. \n\ Any modifications to this file will be lost upon recompilation of the source schema. \n\
Generated on: {0} \n Generated on: {0} \n
Driver.Version = \ Driver.Version = \
xjc 2.2.8-b20130806.1801 xjc 2.2.8-b130911.1802
Driver.FullVersion = \ Driver.FullVersion = \
xjc full version "2.2.8-b20130806.1801" xjc full version "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ...
Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden. Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b20130806.1801 generiert \nSiehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert \nSiehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.8-b20130806.1801" Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = Compilando un esquema...
Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo. Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.8-b20130806.1801 \nVisite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.8-b130911.1802 \nVisite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = versi\u00F3n completa de xjc "2.2.8-b20130806.1801" Driver.FullVersion = versi\u00F3n completa de xjc "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma...
Driver.FailedToGenerateCode = Echec de la production du code. Driver.FailedToGenerateCode = Echec de la production du code.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b20130806.1801 \nVoir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b130911.1802 \nVoir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = version compl\u00E8te xjc "2.2.8-b20130806.1801" Driver.FullVersion = version compl\u00E8te xjc "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = compilazione di uno schema in corso...
Driver.FailedToGenerateCode = Produzione del codice non riuscita. Driver.FailedToGenerateCode = Produzione del codice non riuscita.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.8-b20130806.1801 \nVedere <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.8-b130911.1802 \nVedere <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = versione completa xjc "2.2.8-b20130806.1801" Driver.FullVersion = versione completa xjc "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\
Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.8-b20130806.1801\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.8-b130911.1802\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b20130806.1801" Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294
Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.8-b20130806.1801 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.8-b130911.1802 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \n<a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
Driver.Version = XJC 2.2.8-b20130806.1801 Driver.Version = XJC 2.2.8-b130911.1802
Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.8-b20130806.1801" Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = compilando um esquema...
Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo. Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.8-b20130806.1801 \nConsulte <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.8-b130911.1802 \nConsulte <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = vers\u00E3o completa de xjc "2.2.8-b20130806.1801" Driver.FullVersion = vers\u00E3o completa de xjc "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f...
Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002 Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.8-b20130806.1801 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.8-b130911.1802 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981...
Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc. Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc.
# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant <replaceFilter> # DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn <properties filter>
Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b20130806.1801 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
Driver.Version = xjc 2.2.8-b20130806.1801 Driver.Version = xjc 2.2.8-b130911.1802
Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802"
Driver.BuildID = 2.2.8-b20130806.1801 Driver.BuildID = 2.2.8-b130911.1802
# for JDK integration - include version in source zip # for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@ jaxb.jdk.version=@@JAXB_JDK_VERSION@@

View File

@ -35,7 +35,7 @@ import com.sun.xml.internal.bind.v2.util.XmlFactory;
import javax.xml.XMLConstants; import javax.xml.XMLConstants;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowFileAccess; import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowExternalAccess;
/** /**
* Wraps a JAXP {@link Schema} object and lazily instantiate it. * Wraps a JAXP {@link Schema} object and lazily instantiate it.
@ -61,7 +61,7 @@ public final class SchemaCache {
try { try {
// do not disable secure processing - these are well-known schemas // do not disable secure processing - these are well-known schemas
SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, false); SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, false);
schema = allowFileAccess(sf, false).newSchema(source); schema = allowExternalAccess(sf, "file", false).newSchema(source);
} catch (SAXException e) { } catch (SAXException e) {
// we make sure that the schema is correct before we ship. // we make sure that the schema is correct before we ship.
throw new AssertionError(e); throw new AssertionError(e);

View File

@ -59,7 +59,7 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.util.*; import java.util.*;
import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowFileAccess; import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowExternalAccess;
import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI;
@ -460,7 +460,7 @@ public final class DOMForest {
} }
try { try {
allowFileAccess(sf, options.disableXmlSecurity).newSchema(sources.toArray(new SAXSource[0])); allowExternalAccess(sf, "file,http", options.disableXmlSecurity).newSchema(sources.toArray(new SAXSource[0]));
} catch (SAXException e) { } catch (SAXException e) {
// error should have been reported. // error should have been reported.
} catch (RuntimeException re) { } catch (RuntimeException re) {

View File

@ -41,6 +41,7 @@ import com.sun.xml.internal.xsom.XSParticle;
import com.sun.xml.internal.xsom.XSType; import com.sun.xml.internal.xsom.XSType;
import com.sun.xml.internal.xsom.XSWildcard; import com.sun.xml.internal.xsom.XSWildcard;
import com.sun.xml.internal.xsom.visitor.XSTermFunction; import com.sun.xml.internal.xsom.visitor.XSTermFunction;
import javax.xml.namespace.QName;
import com.sun.xml.internal.rngom.nc.ChoiceNameClass; import com.sun.xml.internal.rngom.nc.ChoiceNameClass;
import com.sun.xml.internal.rngom.nc.NameClass; import com.sun.xml.internal.rngom.nc.NameClass;
@ -65,14 +66,17 @@ abstract class AbstractExtendedComplexTypeBuilder extends CTBuilder {
* Computes a name class that represents everything in a given content model. * Computes a name class that represents everything in a given content model.
*/ */
protected final XSTermFunction<NameClass> contentModelNameClassBuilder = new XSTermFunction<NameClass>() { protected final XSTermFunction<NameClass> contentModelNameClassBuilder = new XSTermFunction<NameClass>() {
@Override
public NameClass wildcard(XSWildcard wc) { public NameClass wildcard(XSWildcard wc) {
return WildcardNameClassBuilder.build(wc); return WildcardNameClassBuilder.build(wc);
} }
@Override
public NameClass modelGroupDecl(XSModelGroupDecl decl) { public NameClass modelGroupDecl(XSModelGroupDecl decl) {
return modelGroup(decl.getModelGroup()); return modelGroup(decl.getModelGroup());
} }
@Override
public NameClass modelGroup(XSModelGroup group) { public NameClass modelGroup(XSModelGroup group) {
NameClass nc = NameClass.NULL; NameClass nc = NameClass.NULL;
for( int i=0; i<group.getSize(); i++ ) for( int i=0; i<group.getSize(); i++ )
@ -216,7 +220,7 @@ abstract class AbstractExtendedComplexTypeBuilder extends CTBuilder {
* Gets a {@link SimpleNameClass} from the name of a {@link XSDeclaration}. * Gets a {@link SimpleNameClass} from the name of a {@link XSDeclaration}.
*/ */
private NameClass getNameClass(XSDeclaration decl) { private NameClass getNameClass(XSDeclaration decl) {
return new SimpleNameClass(decl.getTargetNamespace(), decl.getName()); return new SimpleNameClass(new QName(decl.getTargetNamespace(), decl.getName()));
} }
} }

View File

@ -69,6 +69,7 @@ public class SchemaConstraintChecker {
boolean hadErrors = false; boolean hadErrors = false;
SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity); SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity);
XmlFactory.allowExternalAccess(sf, "all", disableXmlSecurity);
sf.setErrorHandler(errorFilter); sf.setErrorHandler(errorFilter);
if( entityResolver != null ) { if( entityResolver != null ) {
sf.setResourceResolver(new LSResourceResolver() { sf.setResourceResolver(new LSResourceResolver() {
@ -91,6 +92,7 @@ public class SchemaConstraintChecker {
} }
try { try {
XmlFactory.allowExternalDTDAccess(sf, "all", disableXmlSecurity);
sf.newSchema(getSchemaSource(schemas, entityResolver)); sf.newSchema(getSchemaSource(schemas, entityResolver));
} catch (SAXException e) { } catch (SAXException e) {
// TODO: we haven't thrown exceptions from here before. should we just trap them and return false? // TODO: we haven't thrown exceptions from here before. should we just trap them and return false?

View File

@ -42,6 +42,8 @@ public enum Messages {
INVALID_JAXP_IMPLEMENTATION, // 1 arg INVALID_JAXP_IMPLEMENTATION, // 1 arg
JAXP_SUPPORTED_PROPERTY, // 1 arg JAXP_SUPPORTED_PROPERTY, // 1 arg
JAXP_UNSUPPORTED_PROPERTY, // 1 arg JAXP_UNSUPPORTED_PROPERTY, // 1 arg
JAXP_XML_SECURITY_DISABLED, // no arg
JAXP_EXTERNAL_ACCESS_CONFIGURED, // no arg
; ;
private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName()); private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());

View File

@ -56,3 +56,9 @@ JAXP_SUPPORTED_PROPERTY =\
JAXP_UNSUPPORTED_PROPERTY =\ JAXP_UNSUPPORTED_PROPERTY =\
Property "{0}" is not supported by used JAXP implementation. Property "{0}" is not supported by used JAXP implementation.
JAXP_XML_SECURITY_DISABLED=\
"Xml Security disabled, no JAXP xsd external access configuration necessary."
JAXP_EXTERNAL_ACCESS_CONFIGURED=\
"Detected explicitly JAXP configuration, no JAXP xsd external access configuration necessary."

View File

@ -140,22 +140,23 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
*/ */
private final Loader itemsLoader = new Loader(false) { private final Loader itemsLoader = new Loader(false) {
private ThreadLocal<BeanT> target = new ThreadLocal<BeanT>(); private ThreadLocal<Stack<BeanT>> target = new ThreadLocal<Stack<BeanT>>();
private ThreadLocal<ValueT> map = new ThreadLocal<ValueT>(); private ThreadLocal<Stack<ValueT>> map = new ThreadLocal<Stack<ValueT>>();
private int depthCounter = 0; // needed to clean ThreadLocals
@Override @Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
// create or obtain the Map object // create or obtain the Map object
try { try {
target.set((BeanT)state.prev.target); BeanT target = (BeanT) state.prev.target;
map.set(acc.get(target.get())); ValueT mapValue = acc.get(target);
depthCounter++; if(mapValue == null)
if(map.get() == null) { mapValue = ClassFactory.create(mapImplClass);
map.set(ClassFactory.create(mapImplClass)); else
} mapValue.clear();
map.get().clear();
state.target = map.get(); Stack.push(this.target, target);
Stack.push(map, mapValue);
state.target = mapValue;
} catch (AccessorException e) { } catch (AccessorException e) {
// recover from error by setting a dummy Map that receives and discards the values // recover from error by setting a dummy Map that receives and discards the values
handleGenericException(e,true); handleGenericException(e,true);
@ -167,11 +168,7 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
public void leaveElement(State state, TagName ea) throws SAXException { public void leaveElement(State state, TagName ea) throws SAXException {
super.leaveElement(state, ea); super.leaveElement(state, ea);
try { try {
acc.set(target.get(), map.get()); acc.set(Stack.pop(target), Stack.pop(map));
if (--depthCounter == 0) {
target.remove();
map.remove();
}
} catch (AccessorException ex) { } catch (AccessorException ex) {
handleGenericException(ex,true); handleGenericException(ex,true);
} }
@ -289,4 +286,36 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
return acc; return acc;
return null; return null;
} }
private static final class Stack<T> {
private Stack<T> parent;
private T value;
private Stack(Stack<T> parent, T value) {
this.parent = parent;
this.value = value;
}
private Stack(T value) {
this.value = value;
}
private static <T> void push(ThreadLocal<Stack<T>> holder, T value) {
Stack<T> parent = holder.get();
if (parent == null)
holder.set(new Stack<T>(value));
else
holder.set(new Stack<T>(parent, value));
}
private static <T> T pop(ThreadLocal<Stack<T>> holder) {
Stack<T> current = holder.get();
if (current.parent == null)
holder.remove();
else
holder.set(current.parent);
return current.value;
}
}
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -63,19 +63,15 @@ class AccessorInjector {
ClassLoader cl = SecureLoader.getClassClassLoader(beanClass); ClassLoader cl = SecureLoader.getClassClassLoader(beanClass);
if(cl==null) return null; // how do I inject classes to this "null" class loader? for now, back off. if(cl==null) return null; // how do I inject classes to this "null" class loader? for now, back off.
Class c = null; Class c = Injector.find(cl,newClassName);
synchronized (AccessorInjector.class) {
c = Injector.find(cl,newClassName);
if (c==null) { if (c==null) {
byte[] image = tailor(templateClassName,newClassName,replacements); byte[] image = tailor(templateClassName,newClassName,replacements);
// try { if (image==null) {
// new FileOutputStream("debug.class").write(image);
// } catch (IOException e) {
// e.printStackTrace();
// }
if(image==null)
return null; return null;
}
c = Injector.inject(cl,newClassName,image); c = Injector.inject(cl,newClassName,image);
if (c == null) {
Injector.find(cl, newClassName);
} }
} }
return c; return c;
@ -112,4 +108,5 @@ class AccessorInjector {
} }
private static final ClassLoader CLASS_LOADER = SecureLoader.getClassClassLoader(AccessorInjector.class); private static final ClassLoader CLASS_LOADER = SecureLoader.getClassClassLoader(AccessorInjector.class);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -156,6 +156,7 @@ final class Injector {
} }
AccessController.doPrivileged(new PrivilegedAction<Void>() { AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() { public Void run() {
// TODO: check security implication // TODO: check security implication
// do these setAccessible allow anyone to call these methods freely?s // do these setAccessible allow anyone to call these methods freely?s

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -127,8 +127,11 @@ public abstract class OptimizedAccessorFactory {
return null; return null;
Accessor<B,V> acc = instanciate(opt); Accessor<B,V> acc = instanciate(opt);
if(acc!=null) if (acc!=null) {
logger.log(Level.FINE,"Using optimized Accessor for "+getter+" and "+setter); if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "Using optimized Accessor for {0} and {1}", new Object[]{getter, setter});
}
}
return acc; return acc;
} }
@ -174,8 +177,11 @@ public abstract class OptimizedAccessorFactory {
return null; return null;
Accessor<B,V> acc = instanciate(opt); Accessor<B,V> acc = instanciate(opt);
if(acc!=null) if (acc!=null) {
logger.log(Level.FINE,"Using optimized Accessor for "+field); if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "Using optimized Accessor for {0}", field);
}
}
return acc; return acc;
} }

View File

@ -43,6 +43,8 @@ import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXNotSupportedException;
import static com.sun.xml.internal.bind.Util.getSystemProperty;
/** /**
* Provides helper methods for creating properly configured XML parser * Provides helper methods for creating properly configured XML parser
* factory instances with namespace support turned on and configured for * factory instances with namespace support turned on and configured for
@ -53,6 +55,7 @@ public class XmlFactory {
// not in older JDK, so must be duplicated here, otherwise javax.xml.XMLConstants should be used // not in older JDK, so must be duplicated here, otherwise javax.xml.XMLConstants should be used
public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema"; public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema";
public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD";
private static final Logger LOGGER = Logger.getLogger(XmlFactory.class.getName()); private static final Logger LOGGER = Logger.getLogger(XmlFactory.class.getName());
@ -65,11 +68,10 @@ public class XmlFactory {
*/ */
private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity";
public static final boolean DISABLE_SECURE_PROCESSING = public static final boolean XML_SECURITY_DISABLED = Boolean.parseBoolean(getSystemProperty(DISABLE_XML_SECURITY));
Boolean.parseBoolean(Util.getSystemProperty(DISABLE_XML_SECURITY));
private static boolean xmlFeatureValue(boolean runtimeSetting) { private static boolean isXMLSecurityDisabled(boolean runtimeSetting) {
return !(DISABLE_SECURE_PROCESSING || runtimeSetting); return XML_SECURITY_DISABLED || runtimeSetting;
} }
/** /**
@ -83,7 +85,7 @@ public class XmlFactory {
if (LOGGER.isLoggable(Level.FINE)) { if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "SchemaFactory instance: {0}", factory); LOGGER.log(Level.FINE, "SchemaFactory instance: {0}", factory);
} }
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing));
return factory; return factory;
} catch (SAXNotRecognizedException ex) { } catch (SAXNotRecognizedException ex) {
LOGGER.log(Level.SEVERE, null, ex); LOGGER.log(Level.SEVERE, null, ex);
@ -109,7 +111,7 @@ public class XmlFactory {
LOGGER.log(Level.FINE, "SAXParserFactory instance: {0}", factory); LOGGER.log(Level.FINE, "SAXParserFactory instance: {0}", factory);
} }
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing));
return factory; return factory;
} catch (ParserConfigurationException ex) { } catch (ParserConfigurationException ex) {
LOGGER.log(Level.SEVERE, null, ex); LOGGER.log(Level.SEVERE, null, ex);
@ -136,7 +138,7 @@ public class XmlFactory {
if (LOGGER.isLoggable(Level.FINE)) { if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "XPathFactory instance: {0}", factory); LOGGER.log(Level.FINE, "XPathFactory instance: {0}", factory);
} }
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing));
return factory; return factory;
} catch (XPathFactoryConfigurationException ex) { } catch (XPathFactoryConfigurationException ex) {
LOGGER.log(Level.SEVERE, null, ex); LOGGER.log(Level.SEVERE, null, ex);
@ -157,7 +159,7 @@ public class XmlFactory {
if (LOGGER.isLoggable(Level.FINE)) { if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "TransformerFactory instance: {0}", factory); LOGGER.log(Level.FINE, "TransformerFactory instance: {0}", factory);
} }
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing));
return factory; return factory;
} catch (TransformerConfigurationException ex) { } catch (TransformerConfigurationException ex) {
LOGGER.log(Level.SEVERE, null, ex); LOGGER.log(Level.SEVERE, null, ex);
@ -180,7 +182,7 @@ public class XmlFactory {
LOGGER.log(Level.FINE, "DocumentBuilderFactory instance: {0}", factory); LOGGER.log(Level.FINE, "DocumentBuilderFactory instance: {0}", factory);
} }
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing));
return factory; return factory;
} catch (ParserConfigurationException ex) { } catch (ParserConfigurationException ex) {
LOGGER.log(Level.SEVERE, null, ex); LOGGER.log(Level.SEVERE, null, ex);
@ -191,21 +193,65 @@ public class XmlFactory {
} }
} }
public static SchemaFactory allowFileAccess(SchemaFactory sf, boolean disableSecureProcessing) { public static SchemaFactory allowExternalAccess(SchemaFactory sf, String value, boolean disableSecureProcessing) {
// if feature secure processing enabled, nothing to do, file is allowed, // if xml security (feature secure processing) disabled, nothing to do, no restrictions applied
// or user is able to control access by standard JAXP mechanisms if (isXMLSecurityDisabled(disableSecureProcessing)) {
if (disableSecureProcessing) { if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, Messages.JAXP_XML_SECURITY_DISABLED.format());
}
return sf;
}
if (System.getProperty("javax.xml.accessExternalSchema") != null) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, Messages.JAXP_EXTERNAL_ACCESS_CONFIGURED.format());
}
return sf; return sf;
} }
try { try {
sf.setProperty(ACCESS_EXTERNAL_SCHEMA, "file"); sf.setProperty(ACCESS_EXTERNAL_SCHEMA, value);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, Messages.JAXP_SUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA)); LOGGER.log(Level.FINE, Messages.JAXP_SUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA));
}
} catch (SAXException ignored) { } catch (SAXException ignored) {
// nothing to do; support depends on version JDK or SAX implementation // nothing to do; support depends on version JDK or SAX implementation
if (LOGGER.isLoggable(Level.CONFIG)) {
LOGGER.log(Level.CONFIG, Messages.JAXP_UNSUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA), ignored); LOGGER.log(Level.CONFIG, Messages.JAXP_UNSUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA), ignored);
} }
}
return sf;
}
public static SchemaFactory allowExternalDTDAccess(SchemaFactory sf, String value, boolean disableSecureProcessing) {
// if xml security (feature secure processing) disabled, nothing to do, no restrictions applied
if (isXMLSecurityDisabled(disableSecureProcessing)) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, Messages.JAXP_XML_SECURITY_DISABLED.format());
}
return sf;
}
if (System.getProperty("javax.xml.accessExternalDTD") != null) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, Messages.JAXP_EXTERNAL_ACCESS_CONFIGURED.format());
}
return sf;
}
try {
sf.setProperty(ACCESS_EXTERNAL_DTD, value);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, Messages.JAXP_SUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_DTD));
}
} catch (SAXException ignored) {
// nothing to do; support depends on version JDK or SAX implementation
if (LOGGER.isLoggable(Level.CONFIG)) {
LOGGER.log(Level.CONFIG, Messages.JAXP_UNSUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_DTD), ignored);
}
}
return sf; return sf;
} }

View File

@ -287,11 +287,12 @@ public class Base64Data implements CharSequence, Cloneable {
* @throws IOException if i/o error occurs * @throws IOException if i/o error occurs
*/ */
public InputStream getInputStream() throws IOException { public InputStream getInputStream() throws IOException {
if(dataHandler!=null) if(dataHandler!=null) {
return dataHandler.getInputStream(); return dataHandler.getInputStream();
else } else {
return new ByteArrayInputStream(data,0,dataLen); return new ByteArrayInputStream(data,0,dataLen);
} }
}
/** /**
* Returns false if this object only has {@link DataHandler} and therefore * Returns false if this object only has {@link DataHandler} and therefore
@ -342,8 +343,9 @@ public class Base64Data implements CharSequence, Cloneable {
} }
public String getMimeType() { public String getMimeType() {
if(mimeType==null) if (mimeType==null) {
return "application/octet-stream"; return "application/octet-stream";
}
return mimeType; return mimeType;
} }
@ -376,32 +378,36 @@ public class Base64Data implements CharSequence, Cloneable {
case 0: case 0:
return Base64Encoder.encode(data[base]>>2); return Base64Encoder.encode(data[base]>>2);
case 1: case 1:
if(base+1<dataLen) if (base+1<dataLen) {
b1 = data[base+1]; b1 = data[base+1];
else } else {
b1 = 0; b1 = 0;
}
return Base64Encoder.encode( return Base64Encoder.encode(
((data[base]&0x3)<<4) | ((data[base]&0x3)<<4) |
((b1>>4)&0xF)); ((b1>>4)&0xF));
case 2: case 2:
if (base+1<dataLen) { if (base+1<dataLen) {
b1 = data[base+1]; b1 = data[base+1];
if(base+2<dataLen) if (base+2<dataLen) {
b2 = data[base+2]; b2 = data[base+2];
else } else {
b2 = 0; b2 = 0;
}
return Base64Encoder.encode( return Base64Encoder.encode(
((b1&0xF)<<2)| ((b1&0xF)<<2)|
((b2>>6)&0x3)); ((b2>>6)&0x3));
} else } else {
return '='; return '=';
}
case 3: case 3:
if(base+2<dataLen) if(base+2<dataLen) {
return Base64Encoder.encode(data[base+2]&0x3F); return Base64Encoder.encode(data[base+2]&0x3F);
else } else {
return '='; return '=';
} }
}
throw new IllegalStateException(); throw new IllegalStateException();
} }
@ -414,8 +420,9 @@ public class Base64Data implements CharSequence, Cloneable {
public CharSequence subSequence(int start, int end) { public CharSequence subSequence(int start, int end) {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
get(); // fill in the buffer if we haven't done so get(); // fill in the buffer if we haven't done so
for( int i=start; i<end; i++ ) for (int i=start; i<end; i++ ) {
buf.append(charAt(i)); buf.append(charAt(i));
}
return buf; return buf;
} }
@ -473,7 +480,25 @@ public class Base64Data implements CharSequence, Cloneable {
@Override @Override
public Base64Data clone() { public Base64Data clone() {
return new Base64Data(this); try {
Base64Data clone = (Base64Data) super.clone();
clone.get();
if (clone.dataCloneByRef) {
this.data = clone.data;
} else {
this.data = new byte[clone.dataLen];
System.arraycopy(clone.data, 0, this.data, 0, clone.dataLen);
}
this.dataCloneByRef = true;
this.dataLen = clone.dataLen;
this.dataHandler = null;
this.mimeType = clone.mimeType;
return clone;
} catch (CloneNotSupportedException ex) {
Logger.getLogger(Base64Data.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
} }
static String getProperty(final String propName) { static String getProperty(final String propName) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -88,6 +88,7 @@ import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException; import org.xml.sax.SAXParseException;
public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilder, CommentList { public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilder, CommentList {
private final SchemaBuilderImpl parent; private final SchemaBuilderImpl parent;
private boolean hadError = false; private boolean hadError = false;
private final SchemaPatternBuilder pb; private final SchemaPatternBuilder pb;
@ -99,6 +100,7 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
static final Localizer localizer = new Localizer(SchemaBuilderImpl.class); static final Localizer localizer = new Localizer(SchemaBuilderImpl.class);
static class OpenIncludes { static class OpenIncludes {
final String uri; final String uri;
final OpenIncludes parent; final OpenIncludes parent;
@ -116,26 +118,28 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
pattern.checkRecursion(0); pattern.checkRecursion(0);
pattern = pattern.expand(pb); pattern = pattern.expand(pb);
pattern.checkRestrictions(Pattern.START_CONTEXT, null, null); pattern.checkRestrictions(Pattern.START_CONTEXT, null, null);
if (!hadError) return pattern; if (!hadError) {
return pattern;
}
} catch (SAXParseException e) { } catch (SAXParseException e) {
error(e); error(e);
} catch (SAXException e) { } catch (SAXException e) {
throw new BuildException(e); throw new BuildException(e);
} catch (RestrictionViolationException e) { } catch (RestrictionViolationException e) {
if (e.getName() != null) if (e.getName() != null) {
error(e.getMessageId(), e.getName().toString(), e error(e.getMessageId(), e.getName().toString(), e
.getLocator()); .getLocator());
else } else {
error(e.getMessageId(), e.getLocator()); error(e.getMessageId(), e.getLocator());
} }
} }
}
throw new IllegalSchemaException(); throw new IllegalSchemaException();
} }
/** /**
* *
* @param eh * @param eh Error handler to receive errors while building the schema.
* Error handler to receive errors while building the schema.
*/ */
public SchemaBuilderImpl(ErrorHandler eh) { public SchemaBuilderImpl(ErrorHandler eh) {
this(eh, this(eh,
@ -146,12 +150,10 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
/** /**
* *
* @param eh * @param eh Error handler to receive errors while building the schema.
* Error handler to receive errors while building the schema. * @param datatypeLibraryFactory This is consulted to locate datatype
* @param datatypeLibraryFactory * libraries.
* This is consulted to locate datatype libraries. * @param pb Used to build patterns.
* @param pb
* Used to build patterns.
*/ */
public SchemaBuilderImpl(ErrorHandler eh, public SchemaBuilderImpl(ErrorHandler eh,
DatatypeLibraryFactory datatypeLibraryFactory, DatatypeLibraryFactory datatypeLibraryFactory,
@ -181,31 +183,37 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
public ParsedPattern makeChoice(List patterns, Location loc, Annotations anno) public ParsedPattern makeChoice(List patterns, Location loc, Annotations anno)
throws BuildException { throws BuildException {
if (patterns.isEmpty()) if (patterns.isEmpty()) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
Pattern result = (Pattern) patterns.get(0); Pattern result = (Pattern) patterns.get(0);
for (int i = 1; i < patterns.size(); i++) for (int i = 1; i < patterns.size(); i++) {
result = pb.makeChoice(result, (Pattern) patterns.get(i)); result = pb.makeChoice(result, (Pattern) patterns.get(i));
}
return result; return result;
} }
public ParsedPattern makeInterleave(List patterns, Location loc, Annotations anno) public ParsedPattern makeInterleave(List patterns, Location loc, Annotations anno)
throws BuildException { throws BuildException {
if (patterns.isEmpty()) if (patterns.isEmpty()) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
Pattern result = (Pattern) patterns.get(0); Pattern result = (Pattern) patterns.get(0);
for (int i = 1; i < patterns.size(); i++) for (int i = 1; i < patterns.size(); i++) {
result = pb.makeInterleave(result, (Pattern) patterns.get(i)); result = pb.makeInterleave(result, (Pattern) patterns.get(i));
}
return result; return result;
} }
public ParsedPattern makeGroup(List patterns, Location loc, Annotations anno) public ParsedPattern makeGroup(List patterns, Location loc, Annotations anno)
throws BuildException { throws BuildException {
if (patterns.isEmpty()) if (patterns.isEmpty()) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
Pattern result = (Pattern) patterns.get(0); Pattern result = (Pattern) patterns.get(0);
for (int i = 1; i < patterns.size(); i++) for (int i = 1; i < patterns.size(); i++) {
result = pb.makeGroup(result, (Pattern) patterns.get(i)); result = pb.makeGroup(result, (Pattern) patterns.get(i));
}
return result; return result;
} }
@ -253,7 +261,6 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
// public ParsedNameClass makeErrorNameClass() { // public ParsedNameClass makeErrorNameClass() {
// return new ErrorNameClass(); // return new ErrorNameClass();
// } // }
public ParsedPattern makeAttribute(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno) public ParsedPattern makeAttribute(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno)
throws BuildException { throws BuildException {
return pb.makeAttribute((NameClass) nc, (Pattern) p, (Locator) loc); return pb.makeAttribute((NameClass) nc, (Pattern) p, (Locator) loc);
@ -265,6 +272,7 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
} }
private class DummyDataPatternBuilder implements DataPatternBuilder { private class DummyDataPatternBuilder implements DataPatternBuilder {
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno) public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
throws BuildException { throws BuildException {
} }
@ -283,7 +291,8 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
} }
} }
private class ValidationContextImpl implements ValidationContext { private static class ValidationContextImpl implements ValidationContext {
private ValidationContext vc; private ValidationContext vc;
private String ns; private String ns;
@ -310,7 +319,9 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
} }
private class DataPatternBuilderImpl implements DataPatternBuilder { private class DataPatternBuilderImpl implements DataPatternBuilder {
private DatatypeBuilder dtb; private DatatypeBuilder dtb;
DataPatternBuilderImpl(DatatypeBuilder dtb) { DataPatternBuilderImpl(DatatypeBuilder dtb) {
this.dtb = dtb; this.dtb = dtb;
} }
@ -319,33 +330,35 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
throws BuildException { throws BuildException {
try { try {
dtb.addParameter(name, value, new ValidationContextImpl(context, ns)); dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
} } catch (DatatypeException e) {
catch (DatatypeException e) {
String detail = e.getMessage(); String detail = e.getMessage();
int pos = e.getIndex(); int pos = e.getIndex();
String displayedParam; String displayedParam;
if (pos == DatatypeException.UNKNOWN) if (pos == DatatypeException.UNKNOWN) {
displayedParam = null; displayedParam = null;
else } else {
displayedParam = displayParam(value, pos); displayedParam = displayParam(value, pos);
}
if (displayedParam != null) { if (displayedParam != null) {
if (detail != null) if (detail != null) {
error("invalid_param_detail_display", detail, displayedParam, (Locator) loc); error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
else } else {
error("invalid_param_display", displayedParam, (Locator) loc); error("invalid_param_display", displayedParam, (Locator) loc);
} }
else if (detail != null) } else if (detail != null) {
error("invalid_param_detail", detail, (Locator) loc); error("invalid_param_detail", detail, (Locator) loc);
else } else {
error("invalid_param", (Locator) loc); error("invalid_param", (Locator) loc);
} }
} }
}
String displayParam(String value, int pos) { String displayParam(String value, int pos) {
if (pos < 0) if (pos < 0) {
pos = 0; pos = 0;
else if (pos > value.length()) } else if (pos > value.length()) {
pos = value.length(); pos = value.length();
}
return localizer.message("display_param", value.substring(0, pos), value.substring(pos)); return localizer.message("display_param", value.substring(0, pos), value.substring(pos));
} }
@ -353,13 +366,13 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
throws BuildException { throws BuildException {
try { try {
return pb.makeData(dtb.createDatatype()); return pb.makeData(dtb.createDatatype());
} } catch (DatatypeException e) {
catch (DatatypeException e) {
String detail = e.getMessage(); String detail = e.getMessage();
if (detail != null) if (detail != null) {
error("invalid_params_detail", detail, (Locator) loc); error("invalid_params_detail", detail, (Locator) loc);
else } else {
error("invalid_params", (Locator) loc); error("invalid_params", (Locator) loc);
}
return pb.makeError(); return pb.makeError();
} }
} }
@ -368,13 +381,13 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
throws BuildException { throws BuildException {
try { try {
return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc); return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
} } catch (DatatypeException e) {
catch (DatatypeException e) {
String detail = e.getMessage(); String detail = e.getMessage();
if (detail != null) if (detail != null) {
error("invalid_params_detail", detail, (Locator) loc); error("invalid_params_detail", detail, (Locator) loc);
else } else {
error("invalid_params", (Locator) loc); error("invalid_params", (Locator) loc);
}
return pb.makeError(); return pb.makeError();
} }
} }
@ -386,47 +399,47 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc) public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
throws BuildException { throws BuildException {
DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary); DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null) if (dl == null) {
error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc); error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
else { } else {
try { try {
return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type)); return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
} } catch (DatatypeException e) {
catch (DatatypeException e) {
String detail = e.getMessage(); String detail = e.getMessage();
if (detail != null) if (detail != null) {
error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc); error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
else } else {
error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc); error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
} }
} }
}
return new DummyDataPatternBuilder(); return new DummyDataPatternBuilder();
} }
public ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context context, String ns, public ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context context, String ns,
Location loc, Annotations anno) throws BuildException { Location loc, Annotations anno) throws BuildException {
DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary); DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null) if (dl == null) {
error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc); error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
else { } else {
try { try {
DatatypeBuilder dtb = dl.createDatatypeBuilder(type); DatatypeBuilder dtb = dl.createDatatypeBuilder(type);
try { try {
Datatype dt = dtb.createDatatype(); Datatype dt = dtb.createDatatype();
Object obj = dt.createValue(value, new ValidationContextImpl(context, ns)); Object obj = dt.createValue(value, new ValidationContextImpl(context, ns));
if (obj != null) if (obj != null) {
return pb.makeValue(dt, obj); return pb.makeValue(dt, obj);
error("invalid_value", value, (Locator)loc);
} }
catch (DatatypeException e) { error("invalid_value", value, (Locator) loc);
} catch (DatatypeException e) {
String detail = e.getMessage(); String detail = e.getMessage();
if (detail != null) if (detail != null) {
error("datatype_requires_param_detail", detail, (Locator) loc); error("datatype_requires_param_detail", detail, (Locator) loc);
else } else {
error("datatype_requires_param", (Locator) loc); error("datatype_requires_param", (Locator) loc);
} }
} }
catch (DatatypeException e) { } catch (DatatypeException e) {
error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc); error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
} }
} }
@ -434,6 +447,7 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
} }
static class GrammarImpl implements Grammar, Div, IncludedGrammar { static class GrammarImpl implements Grammar, Div, IncludedGrammar {
private final SchemaBuilderImpl sb; private final SchemaBuilderImpl sb;
private final Hashtable defines; private final Hashtable defines;
private final RefPattern startRef; private final RefPattern startRef;
@ -490,32 +504,34 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
case RefPattern.REPLACEMENT_KEEP: case RefPattern.REPLACEMENT_KEEP:
if (combine == null) { if (combine == null) {
if (rp.isCombineImplicit()) { if (rp.isCombineImplicit()) {
if (rp.getName() == null) if (rp.getName() == null) {
sb.error("duplicate_start", (Locator) loc); sb.error("duplicate_start", (Locator) loc);
else } else {
sb.error("duplicate_define", rp.getName(), (Locator) loc); sb.error("duplicate_define", rp.getName(), (Locator) loc);
} }
else } else {
rp.setCombineImplicit(); rp.setCombineImplicit();
} }
else { } else {
byte combineType = (combine == COMBINE_CHOICE ? RefPattern.COMBINE_CHOICE : RefPattern.COMBINE_INTERLEAVE); byte combineType = (combine == COMBINE_CHOICE ? RefPattern.COMBINE_CHOICE : RefPattern.COMBINE_INTERLEAVE);
if (rp.getCombineType() != RefPattern.COMBINE_NONE if (rp.getCombineType() != RefPattern.COMBINE_NONE
&& rp.getCombineType() != combineType) { && rp.getCombineType() != combineType) {
if (rp.getName() == null) if (rp.getName() == null) {
sb.error("conflict_combine_start", (Locator) loc); sb.error("conflict_combine_start", (Locator) loc);
else } else {
sb.error("conflict_combine_define", rp.getName(), (Locator) loc); sb.error("conflict_combine_define", rp.getName(), (Locator) loc);
} }
}
rp.setCombineType(combineType); rp.setCombineType(combineType);
} }
Pattern p = (Pattern) pattern; Pattern p = (Pattern) pattern;
if (rp.getPattern() == null) if (rp.getPattern() == null) {
rp.setPattern(p); rp.setPattern(p);
else if (rp.getCombineType() == RefPattern.COMBINE_INTERLEAVE) } else if (rp.getCombineType() == RefPattern.COMBINE_INTERLEAVE) {
rp.setPattern(sb.pb.makeInterleave(rp.getPattern(), p)); rp.setPattern(sb.pb.makeInterleave(rp.getPattern(), p));
else } else {
rp.setPattern(sb.pb.makeChoice(rp.getPattern(), p)); rp.setPattern(sb.pb.makeChoice(rp.getPattern(), p));
}
break; break;
case RefPattern.REPLACEMENT_REQUIRE: case RefPattern.REPLACEMENT_REQUIRE:
rp.setReplacementStatus(RefPattern.REPLACEMENT_IGNORE); rp.setReplacementStatus(RefPattern.REPLACEMENT_IGNORE);
@ -532,8 +548,9 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
} }
private RefPattern lookup(String name) { private RefPattern lookup(String name) {
if (name == START) if (name == START) {
return startRef; return startRef;
}
return lookup1(name); return lookup1(name);
} }
@ -548,8 +565,9 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
public ParsedPattern makeRef(String name, Location loc, Annotations anno) throws BuildException { public ParsedPattern makeRef(String name, Location loc, Annotations anno) throws BuildException {
RefPattern p = lookup1(name); RefPattern p = lookup1(name);
if (p.getRefLocator() == null && loc != null) if (p.getRefLocator() == null && loc != null) {
p.setRefLocator((Locator) loc); p.setRefLocator((Locator) loc);
}
return p; return p;
} }
@ -569,23 +587,21 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
public Include makeInclude() { public Include makeInclude() {
return new IncludeImpl(sb, this); return new IncludeImpl(sb, this);
} }
} }
static class Override { static class Override {
Override(RefPattern prp, Override next) { Override(RefPattern prp, Override next) {
this.prp = prp; this.prp = prp;
this.next = next; this.next = next;
} }
RefPattern prp; RefPattern prp;
Override next; Override next;
byte replacementStatus; byte replacementStatus;
} }
private static class IncludeImpl implements Include, Div { private static class IncludeImpl implements Include, Div {
private SchemaBuilderImpl sb; private SchemaBuilderImpl sb;
private Override overrides; private Override overrides;
private GrammarImpl grammar; private GrammarImpl grammar;
@ -637,21 +653,21 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns); current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns);
for (Override o = overrides; o != null; o = o.next) { for (Override o = overrides; o != null; o = o.next) {
if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) { if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) {
if (o.prp.getName() == null) if (o.prp.getName() == null) {
sb.error("missing_start_replacement", (Locator) loc); sb.error("missing_start_replacement", (Locator) loc);
else } else {
sb.error("missing_define_replacement", o.prp.getName(), (Locator) loc); sb.error("missing_define_replacement", o.prp.getName(), (Locator) loc);
} }
} }
} }
catch (IllegalSchemaException e) { } catch (IllegalSchemaException e) {
sb.noteError(); sb.noteError();
} } finally {
finally { for (Override o = overrides; o != null; o = o.next) {
for (Override o = overrides; o != null; o = o.next)
o.prp.setReplacementStatus(o.replacementStatus); o.prp.setReplacementStatus(o.replacementStatus);
} }
} }
}
public Include makeInclude() { public Include makeInclude() {
return null; return null;
@ -666,7 +682,6 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
return p; return p;
} }
public ParsedPattern annotateAfter(ParsedPattern p, ParsedElementAnnotation e) throws BuildException { public ParsedPattern annotateAfter(ParsedPattern p, ParsedElementAnnotation e) throws BuildException {
return p; return p;
} }
@ -675,7 +690,6 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
return p; return p;
} }
public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope, public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope,
Location loc, Annotations anno) Location loc, Annotations anno)
throws BuildException { throws BuildException {
@ -689,15 +703,12 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
} }
try { try {
return current.parseExternal(uri, new SchemaBuilderImpl(ns, uri, this), scope, ns); return current.parseExternal(uri, new SchemaBuilderImpl(ns, uri, this), scope, ns);
} } catch (IllegalSchemaException e) {
catch (IllegalSchemaException e) {
noteError(); noteError();
return pb.makeError(); return pb.makeError();
} }
} }
public Location makeLocation(String systemId, int lineNumber, int columnNumber) { public Location makeLocation(String systemId, int lineNumber, int columnNumber) {
return new LocatorImpl(systemId, lineNumber, columnNumber); return new LocatorImpl(systemId, lineNumber, columnNumber);
} }
@ -748,20 +759,10 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
private void error(SAXParseException message) throws BuildException { private void error(SAXParseException message) throws BuildException {
noteError(); noteError();
try { try {
if (eh != null) if (eh != null) {
eh.error(message); eh.error(message);
} }
catch (SAXException e) { } catch (SAXException e) {
throw new BuildException(e);
}
}
private void warning(SAXParseException message) throws BuildException {
try {
if (eh != null)
eh.warning(message);
}
catch (SAXException e) {
throw new BuildException(e); throw new BuildException(e);
} }
} }
@ -781,10 +782,11 @@ public class SchemaBuilderImpl implements SchemaBuilder, ElementAnnotationBuilde
private void error(String key, String arg1, String arg2, String arg3, Locator loc) throws BuildException { private void error(String key, String arg1, String arg2, String arg3, Locator loc) throws BuildException {
error(new SAXParseException(localizer.message(key, new Object[]{arg1, arg2, arg3}), loc)); error(new SAXParseException(localizer.message(key, new Object[]{arg1, arg2, arg3}), loc));
} }
private void noteError() { private void noteError() {
if (!hadError && parent != null) if (!hadError && parent != null) {
parent.noteError(); parent.noteError();
}
hadError = true; hadError = true;
} }
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -55,9 +55,9 @@ import org.xml.sax.Locator;
* @author Kohsuke Kawaguchi (kk@kohsuke.org) * @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/ */
public abstract class DPattern implements ParsedPattern { public abstract class DPattern implements ParsedPattern {
Locator location; Locator location;
DAnnotation annotation; DAnnotation annotation;
/** /**
* Used to chain the child patterns in a doubly-linked list. * Used to chain the child patterns in a doubly-linked list.
*/ */
@ -74,12 +74,12 @@ public abstract class DPattern implements ParsedPattern {
/** /**
* Returns the annotation associated with it. * Returns the annotation associated with it.
* *
* @return * @return may be empty, but never be null.
* may be empty, but never be null.
*/ */
public DAnnotation getAnnotation() { public DAnnotation getAnnotation() {
if(annotation==null) if (annotation == null) {
return DAnnotation.EMPTY; return DAnnotation.EMPTY;
}
return annotation; return annotation;
} }

View File

@ -110,7 +110,11 @@ public class DXMLPrinter {
visitor.on(grammar); visitor.on(grammar);
visitor.endDocument(); visitor.endDocument();
} catch (XMLWriterException e) { } catch (XMLWriterException e) {
if (e.getCause() instanceof XMLStreamException) {
throw (XMLStreamException) e.getCause(); throw (XMLStreamException) e.getCause();
} else {
throw new XMLStreamException(e);
}
} }
} }
@ -123,7 +127,11 @@ public class DXMLPrinter {
try { try {
pattern.accept(visitor); pattern.accept(visitor);
} catch (XMLWriterException e) { } catch (XMLWriterException e) {
if (e.getCause() instanceof XMLStreamException) {
throw (XMLStreamException) e.getCause(); throw (XMLStreamException) e.getCause();
} else {
throw new XMLStreamException(e);
}
} }
} }
@ -136,7 +144,11 @@ public class DXMLPrinter {
try { try {
nc.accept(ncVisitor); nc.accept(ncVisitor);
} catch (XMLWriterException e) { } catch (XMLWriterException e) {
if (e.getCause() instanceof XMLStreamException) {
throw (XMLStreamException) e.getCause(); throw (XMLStreamException) e.getCause();
} else {
throw new XMLStreamException(e);
}
} }
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -82,8 +82,9 @@ final class DataPatternBuilderImpl implements DataPatternBuilder {
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno) throws BuildException { public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno) throws BuildException {
p.except = (DPattern)except; p.except = (DPattern)except;
if(anno!=null) if (anno!=null) {
p.annotation = ((Annotation)anno).getResult(); p.annotation = ((Annotation)anno).getResult();
}
return p; return p;
} }
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -45,6 +45,9 @@
*/ */
package com.sun.xml.internal.rngom.digested; package com.sun.xml.internal.rngom.digested;
import java.util.ArrayList;
import java.util.List;
import com.sun.xml.internal.rngom.ast.builder.Annotations; import com.sun.xml.internal.rngom.ast.builder.Annotations;
import com.sun.xml.internal.rngom.ast.builder.BuildException; import com.sun.xml.internal.rngom.ast.builder.BuildException;
import com.sun.xml.internal.rngom.ast.builder.CommentList; import com.sun.xml.internal.rngom.ast.builder.CommentList;
@ -58,9 +61,6 @@ import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
import com.sun.xml.internal.rngom.ast.util.LocatorImpl; import com.sun.xml.internal.rngom.ast.util.LocatorImpl;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author Kohsuke Kawaguchi (kk@kohsuke.org) * @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/ */
@ -85,12 +85,11 @@ class GrammarBuilderImpl implements Grammar, Div {
} }
public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException { public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException {
if(anno!=null) // Harshit : Fixed possible NPE and issue in handling of annotations
grammar.annotation = ((Annotation)anno).getResult(); if (anno != null) {
if(additionalElementAnnotations!=null) { if (grammar.annotation != null) {
if(grammar.annotation==null) grammar.annotation.contents.addAll(((Annotation) anno).getResult().contents);
grammar.annotation = new DAnnotation(); }
grammar.annotation.contents.addAll(additionalElementAnnotations);
} }
return grammar; return grammar;
} }
@ -99,21 +98,28 @@ class GrammarBuilderImpl implements Grammar, Div {
} }
public void define(String name, Combine combine, ParsedPattern pattern, Location loc, Annotations anno) throws BuildException { public void define(String name, Combine combine, ParsedPattern pattern, Location loc, Annotations anno) throws BuildException {
if(name==START) if(name==START) {
grammar.start = (DPattern)pattern; grammar.start = (DPattern)pattern;
else { } else {
// TODO: handle combine // TODO: handle combine
DDefine d = grammar.getOrAdd(name); DDefine d = grammar.getOrAdd(name);
d.setPattern( (DPattern) pattern ); d.setPattern( (DPattern) pattern );
if(anno!=null) if (anno!=null) {
d.annotation = ((Annotation)anno).getResult(); d.annotation = ((Annotation)anno).getResult();
} }
} }
}
public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException {
if(additionalElementAnnotations==null) // Harshit : Fixed issue in handling of annotations
if (additionalElementAnnotations==null) {
additionalElementAnnotations = new ArrayList<Element>(); additionalElementAnnotations = new ArrayList<Element>();
}
additionalElementAnnotations.add(((ElementWrapper)ea).element); additionalElementAnnotations.add(((ElementWrapper)ea).element);
if (grammar.annotation==null) {
grammar.annotation = new DAnnotation();
}
grammar.annotation.contents.addAll(additionalElementAnnotations);
} }
public void topLevelComment(CommentList comments) throws BuildException { public void topLevelComment(CommentList comments) throws BuildException {

View File

@ -77,7 +77,4 @@ final class AnyNameClass extends NameClass {
return true; return true;
} }
private static Object readReplace() {
return NameClass.ANY;
}
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -65,17 +65,25 @@ public class NameClassBuilderImpl<
A extends Annotations<E,L,CL>, A extends Annotations<E,L,CL>,
CL extends CommentList<L>> implements NameClassBuilder<NameClass,E,L,A,CL> { CL extends CommentList<L>> implements NameClassBuilder<NameClass,E,L,A,CL> {
@Override
public NameClass makeChoice(List<NameClass> nameClasses, L loc, A anno) { public NameClass makeChoice(List<NameClass> nameClasses, L loc, A anno) {
NameClass result = nameClasses.get(0); NameClass result = nameClasses.get(0);
for (int i = 1; i < nameClasses.size(); i++) for (int i = 1; i < nameClasses.size(); i++) {
result = new ChoiceNameClass(result, nameClasses.get(i)); result = new ChoiceNameClass(result, nameClasses.get(i));
}
return result; return result;
} }
@Override
public NameClass makeName(String ns, String localName, String prefix, L loc, A anno) { public NameClass makeName(String ns, String localName, String prefix, L loc, A anno) {
if (prefix == null) {
return new SimpleNameClass(ns, localName); return new SimpleNameClass(ns, localName);
} else {
return new SimpleNameClass(ns, localName, prefix);
}
} }
@Override
public NameClass makeNsName(String ns, L loc, A anno) { public NameClass makeNsName(String ns, L loc, A anno) {
return new NsNameClass(ns); return new NsNameClass(ns);
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -59,10 +59,16 @@ public class SimpleNameClass extends NameClass {
this(new QName(nsUri, localPart)); this(new QName(nsUri, localPart));
} }
public SimpleNameClass(String nsUri, String localPart, String prefix) {
this(new QName(nsUri, localPart, prefix));
}
@Override
public boolean contains(QName name) { public boolean contains(QName name) {
return this.name.equals(name); return this.name.equals(name);
} }
@Override
public int containsSpecificity(QName name) { public int containsSpecificity(QName name) {
return contains(name) ? SPECIFICITY_NAME : SPECIFICITY_NONE; return contains(name) ? SPECIFICITY_NAME : SPECIFICITY_NONE;
} }
@ -74,16 +80,19 @@ public class SimpleNameClass extends NameClass {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null || !(obj instanceof SimpleNameClass)) if (obj == null || !(obj instanceof SimpleNameClass)) {
return false; return false;
}
SimpleNameClass other = (SimpleNameClass) obj; SimpleNameClass other = (SimpleNameClass) obj;
return name.equals(other.name); return name.equals(other.name);
} }
@Override
public <V> V accept(NameClassVisitor<V> visitor) { public <V> V accept(NameClassVisitor<V> visitor) {
return visitor.visitName(name); return visitor.visitName(name);
} }
@Override
public boolean isOpen() { public boolean isOpen() {
return false; return false;
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -58,6 +58,7 @@ import java.io.IOException;
* contain 16-bit unicode characters. * contain 16-bit unicode characters.
*/ */
public final class UCode_UCodeESC_CharStream { public final class UCode_UCodeESC_CharStream {
public static final boolean staticFlag = false; public static final boolean staticFlag = false;
static final int hexval(char c) { static final int hexval(char c) {
@ -104,22 +105,17 @@ public final class UCode_UCodeESC_CharStream {
} }
return -1; return -1;
} }
public int bufpos = -1; public int bufpos = -1;
int bufsize; int bufsize;
int available; int available;
int tokenBegin; int tokenBegin;
private int bufline[]; private int bufline[];
private int bufcolumn[]; private int bufcolumn[];
private int column = 0; private int column = 0;
private int line = 1; private int line = 1;
private java.io.Reader inputStream; private java.io.Reader inputStream;
private boolean closed = false; private boolean closed = false;
private boolean prevCharIsLF = false; private boolean prevCharIsLF = false;
private char[] nextCharBuf; private char[] nextCharBuf;
private char[] buffer; private char[] buffer;
private int maxNextCharInd = 0; private int maxNextCharInd = 0;
@ -146,8 +142,7 @@ public final class UCode_UCodeESC_CharStream {
bufcolumn = newbufcolumn; bufcolumn = newbufcolumn;
bufpos += (bufsize - tokenBegin); bufpos += (bufsize - tokenBegin);
} } else {
else {
System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
buffer = newbuffer; buffer = newbuffer;
@ -166,28 +161,30 @@ public final class UCode_UCodeESC_CharStream {
private final void FillBuff() throws EOFException { private final void FillBuff() throws EOFException {
int i; int i;
if (maxNextCharInd == 4096) if (maxNextCharInd == 4096) {
maxNextCharInd = nextCharInd = 0; maxNextCharInd = nextCharInd = 0;
}
if (closed) if (closed) {
throw new EOFException(); throw new EOFException();
}
try { try {
if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) {
closed = true; closed = true;
inputStream.close(); inputStream.close();
throw new EOFException(); throw new EOFException();
} } else {
else
maxNextCharInd += i; maxNextCharInd += i;
} }
catch (IOException e) { } catch (IOException e) {
throw new BuildException(e); throw new BuildException(e);
} }
} }
private final char ReadChar() throws EOFException { private final char ReadChar() throws EOFException {
if (++nextCharInd >= maxNextCharInd) if (++nextCharInd >= maxNextCharInd) {
FillBuff(); FillBuff();
}
return nextCharBuf[nextCharInd]; return nextCharBuf[nextCharInd];
} }
@ -216,17 +213,17 @@ public final class UCode_UCodeESC_CharStream {
if (tokenBegin > 2048) { if (tokenBegin > 2048) {
bufpos = 0; bufpos = 0;
available = tokenBegin; available = tokenBegin;
} } else {
else
ExpandBuff(false); ExpandBuff(false);
} }
else if (available > tokenBegin) } else if (available > tokenBegin) {
available = bufsize; available = bufsize;
else if ((tokenBegin - available) < 2048) } else if ((tokenBegin - available) < 2048) {
ExpandBuff(true); ExpandBuff(true);
else } else {
available = tokenBegin; available = tokenBegin;
} }
}
private final void UpdateLineColumn(char c) { private final void UpdateLineColumn(char c) {
column++; column++;
@ -251,8 +248,7 @@ public final class UCode_UCodeESC_CharStream {
bufline[bufpos] = line; bufline[bufpos] = line;
bufcolumn[bufpos] = column; bufcolumn[bufpos] = column;
} }
private static final char NEWLINE_MARKER = '\u0000';
private final char NEWLINE_MARKER = '\u0000';
public final char readChar() throws EOFException { public final char readChar() throws EOFException {
if (inBuf > 0) { if (inBuf > 0) {
@ -267,10 +263,10 @@ public final class UCode_UCodeESC_CharStream {
case '\r': case '\r':
c = NEWLINE_MARKER; c = NEWLINE_MARKER;
try { try {
if (PeekChar() == '\n') if (PeekChar() == '\n') {
ReadChar(); ReadChar();
} }
catch (EOFException e) { } catch (EOFException e) {
} }
break; break;
case '\n': case '\n':
@ -281,21 +277,23 @@ public final class UCode_UCodeESC_CharStream {
default: default:
if (c >= 0x20) { if (c >= 0x20) {
if (Utf16.isSurrogate(c)) { if (Utf16.isSurrogate(c)) {
if (Utf16.isSurrogate2(c)) if (Utf16.isSurrogate2(c)) {
throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1); throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1);
if (++bufpos == available) }
if (++bufpos == available) {
AdjustBuffSize(); AdjustBuffSize();
}
buffer[bufpos] = c; buffer[bufpos] = c;
// UpdateLineColumn(c); // UpdateLineColumn(c);
try { try {
c = ReadChar(); c = ReadChar();
} } catch (EOFException e) {
catch (EOFException e) {
throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1); throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1);
} }
if (!Utf16.isSurrogate2(c)) if (!Utf16.isSurrogate2(c)) {
throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 2); throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 2);
} }
}
break; break;
} }
// fall through // fall through
@ -303,39 +301,40 @@ public final class UCode_UCodeESC_CharStream {
case '\uFFFF': case '\uFFFF':
throw new EscapeSyntaxException("illegal_char_code", line, column + 1); throw new EscapeSyntaxException("illegal_char_code", line, column + 1);
} }
} } catch (EOFException e) {
catch (EOFException e) {
if (bufpos == -1) { if (bufpos == -1) {
if (++bufpos == available) if (++bufpos == available) {
AdjustBuffSize(); AdjustBuffSize();
}
bufline[bufpos] = line; bufline[bufpos] = line;
bufcolumn[bufpos] = column; bufcolumn[bufpos] = column;
} }
throw e; throw e;
} }
if (++bufpos == available) if (++bufpos == available) {
AdjustBuffSize(); AdjustBuffSize();
}
buffer[bufpos] = c; buffer[bufpos] = c;
UpdateLineColumn(c); UpdateLineColumn(c);
try { try {
if (c != '\\' || PeekChar() != 'x') if (c != '\\' || PeekChar() != 'x') {
return c; return c;
} }
catch (EOFException e) { } catch (EOFException e) {
return c; return c;
} }
int xCnt = 1; int xCnt = 1;
for (;;) { for (;;) {
ReadChar(); ReadChar();
if (++bufpos == available) if (++bufpos == available) {
AdjustBuffSize(); AdjustBuffSize();
}
buffer[bufpos] = 'x'; buffer[bufpos] = 'x';
UpdateLineColumn('x'); UpdateLineColumn('x');
try { try {
c = PeekChar(); c = PeekChar();
} } catch (EOFException e) {
catch (EOFException e) {
backup(xCnt); backup(xCnt);
return '\\'; return '\\';
} }
@ -344,8 +343,9 @@ public final class UCode_UCodeESC_CharStream {
column++; column++;
// backup past the 'x's // backup past the 'x's
bufpos -= xCnt; bufpos -= xCnt;
if (bufpos < 0) if (bufpos < 0) {
bufpos += bufsize; bufpos += bufsize;
}
break; break;
} }
if (c != 'x') { if (c != 'x') {
@ -357,18 +357,21 @@ public final class UCode_UCodeESC_CharStream {
try { try {
int scalarValue = hexval(ReadChar()); int scalarValue = hexval(ReadChar());
column++; column++;
if (scalarValue < 0) if (scalarValue < 0) {
throw new EscapeSyntaxException("illegal_hex_digit", line, column); throw new EscapeSyntaxException("illegal_hex_digit", line, column);
}
while ((c = ReadChar()) != '}') { while ((c = ReadChar()) != '}') {
column++; column++;
int n = hexval(c); int n = hexval(c);
if (n < 0) if (n < 0) {
throw new EscapeSyntaxException("illegal_hex_digit", line, column); throw new EscapeSyntaxException("illegal_hex_digit", line, column);
}
scalarValue <<= 4; scalarValue <<= 4;
scalarValue |= n; scalarValue |= n;
if (scalarValue >= 0x110000) if (scalarValue >= 0x110000) {
throw new EscapeSyntaxException("char_code_too_big", line, column); throw new EscapeSyntaxException("char_code_too_big", line, column);
} }
}
column++; // for the '}' column++; // for the '}'
if (scalarValue <= 0xFFFF) { if (scalarValue <= 0xFFFF) {
c = (char) scalarValue; c = (char) scalarValue;
@ -378,8 +381,9 @@ public final class UCode_UCodeESC_CharStream {
case '\t': case '\t':
break; break;
default: default:
if (c >= 0x20 && !Utf16.isSurrogate(c)) if (c >= 0x20 && !Utf16.isSurrogate(c)) {
break; break;
}
// fall through // fall through
case '\uFFFE': case '\uFFFE':
case '\uFFFF': case '\uFFFF':
@ -391,33 +395,29 @@ public final class UCode_UCodeESC_CharStream {
c = Utf16.surrogate1(scalarValue); c = Utf16.surrogate1(scalarValue);
buffer[bufpos] = c; buffer[bufpos] = c;
int bufpos1 = bufpos; int bufpos1 = bufpos;
if (++bufpos == bufsize) if (++bufpos == bufsize) {
bufpos = 0; bufpos = 0;
}
buffer[bufpos] = Utf16.surrogate2(scalarValue); buffer[bufpos] = Utf16.surrogate2(scalarValue);
bufline[bufpos] = bufline[bufpos1]; bufline[bufpos] = bufline[bufpos1];
bufcolumn[bufpos] = bufcolumn[bufpos1]; bufcolumn[bufpos] = bufcolumn[bufpos1];
backup(1); backup(1);
return c; return c;
} } catch (EOFException e) {
catch (EOFException e) {
throw new EscapeSyntaxException("incomplete_escape", line, column); throw new EscapeSyntaxException("incomplete_escape", line, column);
} }
} }
/** /**
* @deprecated * @deprecated @see #getEndColumn
* @see #getEndColumn
*/ */
public final int getColumn() { public final int getColumn() {
return bufcolumn[bufpos]; return bufcolumn[bufpos];
} }
/** /**
* @deprecated * @deprecated @see #getEndLine
* @see #getEndLine
*/ */
public final int getLine() { public final int getLine() {
return bufline[bufpos]; return bufline[bufpos];
} }
@ -441,9 +441,10 @@ public final class UCode_UCodeESC_CharStream {
public final void backup(int amount) { public final void backup(int amount) {
inBuf += amount; inBuf += amount;
if ((bufpos -= amount) < 0) if ((bufpos -= amount) < 0) {
bufpos += bufsize; bufpos += bufsize;
} }
}
public UCode_UCodeESC_CharStream(java.io.Reader dstream, public UCode_UCodeESC_CharStream(java.io.Reader dstream,
int startline, int startcolumn, int buffersize) { int startline, int startcolumn, int buffersize) {
@ -508,32 +509,32 @@ public final class UCode_UCodeESC_CharStream {
int startcolumn) { int startcolumn) {
ReInit(dstream, startline, startcolumn, 4096); ReInit(dstream, startline, startcolumn, 4096);
} }
static private final char BOM = '\ufeff'; static private final char BOM = '\ufeff';
private void skipBOM() { private void skipBOM() {
try { try {
if (PeekChar() == BOM) if (PeekChar() == BOM) {
ReadChar(); ReadChar();
} }
catch (EOFException e) { } catch (EOFException e) {
} }
} }
public final String GetImage() { public final String GetImage() {
if (bufpos >= tokenBegin) if (bufpos >= tokenBegin) {
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
else } else {
return new String(buffer, tokenBegin, bufsize - tokenBegin) + return new String(buffer, tokenBegin, bufsize - tokenBegin)
new String(buffer, 0, bufpos + 1); + new String(buffer, 0, bufpos + 1);
}
} }
public final char[] GetSuffix(int len) { public final char[] GetSuffix(int len) {
char[] ret = new char[len]; char[] ret = new char[len];
if ((bufpos + 1) >= len) if ((bufpos + 1) >= len) {
System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
else { } else {
System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
len - bufpos - 1); len - bufpos - 1);
System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
@ -558,16 +559,15 @@ public final class UCode_UCodeESC_CharStream {
if (bufpos >= tokenBegin) { if (bufpos >= tokenBegin) {
len = bufpos - tokenBegin + inBuf + 1; len = bufpos - tokenBegin + inBuf + 1;
} } else {
else {
len = bufsize - tokenBegin + bufpos + 1 + inBuf; len = bufsize - tokenBegin + bufpos + 1 + inBuf;
} }
int i = 0, j = 0, k = 0; int i = 0, j = 0, k = 0;
int nextColDiff = 0, columnDiff = 0; int nextColDiff, columnDiff = 0;
while (i < len && while (i < len
bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) {
bufline[j] = newLine; bufline[j] = newLine;
nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
bufcolumn[j] = newCol + columnDiff; bufcolumn[j] = newCol + columnDiff;
@ -580,15 +580,15 @@ public final class UCode_UCodeESC_CharStream {
bufcolumn[j] = newCol + columnDiff; bufcolumn[j] = newCol + columnDiff;
while (i++ < len) { while (i++ < len) {
if (bufline[j = start % bufsize] != bufline[++start % bufsize]) if (bufline[j = start % bufsize] != bufline[++start % bufsize]) {
bufline[j] = newLine++; bufline[j] = newLine++;
else } else {
bufline[j] = newLine; bufline[j] = newLine;
} }
} }
}
line = bufline[j]; line = bufline[j];
column = bufcolumn[j]; column = bufcolumn[j];
} }
} }

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
/* /*
* Copyright (C) 2004-2011 * Copyright (C) 2004-2012
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -45,10 +45,15 @@
*/ */
package com.sun.xml.internal.rngom.xml.sax; package com.sun.xml.internal.rngom.xml.sax;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.XMLConstants;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
import org.xml.sax.XMLReader; import org.xml.sax.XMLReader;
/** /**
@ -72,7 +77,16 @@ public class JAXPXMLReaderCreator implements XMLReaderCreator {
*/ */
public JAXPXMLReaderCreator() { public JAXPXMLReaderCreator() {
spf = SAXParserFactory.newInstance(); spf = SAXParserFactory.newInstance();
try {
spf.setNamespaceAware(true); spf.setNamespaceAware(true);
spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (ParserConfigurationException ex) {
Logger.getLogger(JAXPXMLReaderCreator.class.getName()).log(Level.SEVERE, null, ex);
} catch (SAXNotRecognizedException ex) {
Logger.getLogger(JAXPXMLReaderCreator.class.getName()).log(Level.SEVERE, null, ex);
} catch (SAXNotSupportedException ex) {
Logger.getLogger(JAXPXMLReaderCreator.class.getName()).log(Level.SEVERE, null, ex);
}
} }
/** /**

View File

@ -40,7 +40,6 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.SEIModel;
import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.JavaMethod;
import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; import com.sun.xml.internal.ws.api.model.WSDLOperationMapping;
import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl;
import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.JavaMethodImpl;
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
import com.sun.istack.internal.Nullable; import com.sun.istack.internal.Nullable;
@ -236,7 +235,7 @@ public abstract class WsaTubeHelper {
} }
WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
WSDLOperation op = wbo.getOperation(); WSDLOperation op = wbo.getOperation();
return ((WSDLOperationImpl) op).getInput().isDefaultAction(); return op.getInput().isDefaultAction();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,9 +27,11 @@ package com.sun.xml.internal.ws.api.model.wsdl;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable; import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.model.ParameterBinding;
import javax.jws.WebParam.Mode; import javax.jws.WebParam.Mode;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import java.util.Map; import java.util.Map;
/** /**
@ -78,21 +80,90 @@ public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible {
*/ */
@Nullable WSDLPart getPart(@NotNull String partName, @NotNull Mode mode); @Nullable WSDLPart getPart(@NotNull String partName, @NotNull Mode mode);
/**
* Gets {@link ParameterBinding} for a given wsdl part in wsdl:input
*
* @param part Name of wsdl:part, must be non-null
* @return null if the part is not found.
*/
public ParameterBinding getInputBinding(String part);
/**
* Gets {@link ParameterBinding} for a given wsdl part in wsdl:output
*
* @param part Name of wsdl:part, must be non-null
* @return null if the part is not found.
*/
public ParameterBinding getOutputBinding(String part);
/**
* Gets {@link ParameterBinding} for a given wsdl part in wsdl:fault
*
* @param part Name of wsdl:part, must be non-null
* @return null if the part is not found.
*/
public ParameterBinding getFaultBinding(String part);
/**
* Gets the MIME type for a given wsdl part in wsdl:input
*
* @param part Name of wsdl:part, must be non-null
* @return null if the part is not found.
*/
public String getMimeTypeForInputPart(String part);
/**
* Gets the MIME type for a given wsdl part in wsdl:output
*
* @param part Name of wsdl:part, must be non-null
* @return null if the part is not found.
*/
public String getMimeTypeForOutputPart(String part);
/**
* Gets the MIME type for a given wsdl part in wsdl:fault
*
* @param part Name of wsdl:part, must be non-null
* @return null if the part is not found.
*/
public String getMimeTypeForFaultPart(String part);
/** /**
* Gets all inbound {@link WSDLPart} by its {@link WSDLPart#getName() name}. * Gets all inbound {@link WSDLPart} by its {@link WSDLPart#getName() name}.
*/ */
@NotNull Map<String,WSDLPart> getInParts(); @NotNull Map<String,? extends WSDLPart> getInParts();
/** /**
* Gets all outbound {@link WSDLPart} by its {@link WSDLPart#getName() name}. * Gets all outbound {@link WSDLPart} by its {@link WSDLPart#getName() name}.
*/ */
@NotNull Map<String,WSDLPart> getOutParts(); @NotNull Map<String,? extends WSDLPart> getOutParts();
/** /**
* Gets all the {@link WSDLFault} bound to this operation. * Gets all the {@link WSDLFault} bound to this operation.
*/ */
@NotNull Iterable<? extends WSDLBoundFault> getFaults(); @NotNull Iterable<? extends WSDLBoundFault> getFaults();
/**
* Map of wsdl:input part name and the binding as {@link ParameterBinding}
*
* @return empty Map if there is no parts
*/
public Map<String, ParameterBinding> getInputParts();
/**
* Map of wsdl:output part name and the binding as {@link ParameterBinding}
*
* @return empty Map if there is no parts
*/
public Map<String, ParameterBinding> getOutputParts();
/**
* Map of wsdl:fault part name and the binding as {@link ParameterBinding}
*
* @return empty Map if there is no parts
*/
public Map<String, ParameterBinding> getFaultParts();
/** /**
* Gets the payload QName of the request message. * Gets the payload QName of the request message.
* *
@ -100,7 +171,7 @@ public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible {
* It's possible for an operation to define no body part, in which case * It's possible for an operation to define no body part, in which case
* this method returns null. * this method returns null.
*/ */
@Nullable QName getReqPayloadName(); @Nullable QName getRequestPayloadName();
/** /**
* Gets the payload QName of the response message. * Gets the payload QName of the response message.
@ -109,7 +180,7 @@ public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible {
* It's possible for an operation to define no body part, in which case * It's possible for an operation to define no body part, in which case
* this method returns null. * this method returns null.
*/ */
@Nullable QName getResPayloadName(); @Nullable QName getResponsePayloadName();
/** /**
* Gets the namespace of request payload. * Gets the namespace of request payload.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,12 @@
package com.sun.xml.internal.ws.api.model.wsdl; package com.sun.xml.internal.ws.api.model.wsdl;
import java.util.List;
import javax.xml.namespace.QName;
import org.xml.sax.Locator;
/** /**
* Interface that represents WSDL concepts that * Interface that represents WSDL concepts that
* can have extensions. * can have extensions.
@ -82,4 +88,23 @@ public interface WSDLExtensible extends WSDLObject {
* must not be null. * must not be null.
*/ */
void addExtension(WSDLExtension extension); void addExtension(WSDLExtension extension);
/**
* True if all required WSDL extensions on Port and Binding are understood
* @return true if all wsdl required extensions on Port and Binding are understood
*/
public boolean areRequiredExtensionsUnderstood();
/**
* Marks extension as not understood
* @param extnEl QName of extension
* @param locator Locator
*/
public void addNotUnderstoodExtension(QName extnEl, Locator locator);
/**
* Lists extensions marked as not understood
* @return List of not understood extensions
*/
public List<? extends WSDLExtension> getNotUnderstoodExtensions();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,4 +76,10 @@ public interface WSDLFault extends WSDLObject, WSDLExtensible {
* @return Action * @return Action
*/ */
String getAction(); String getAction();
/**
* True if this is the default action
* @return
*/
public boolean isDefaultAction();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -34,10 +34,12 @@ import com.sun.xml.internal.ws.api.policy.PolicyResolver;
import com.sun.xml.internal.ws.api.policy.PolicyResolverFactory; import com.sun.xml.internal.ws.api.policy.PolicyResolverFactory;
import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
import com.sun.xml.internal.ws.policy.PolicyMap; import com.sun.xml.internal.ws.policy.PolicyMap;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamException;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@ -96,7 +98,7 @@ public interface WSDLModel extends WSDLExtensible {
* *
* @return an empty Map if the wsdl document has no wsdl:binding * @return an empty Map if the wsdl document has no wsdl:binding
*/ */
@NotNull Map<QName, WSDLBoundPortType> getBindings(); @NotNull Map<QName, ? extends WSDLBoundPortType> getBindings();
/** /**
* Gives a {@link Map} of wsdl:service qualified name and {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLService} * Gives a {@link Map} of wsdl:service qualified name and {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLService}
@ -105,6 +107,25 @@ public interface WSDLModel extends WSDLExtensible {
*/ */
@NotNull Map<QName, ? extends WSDLService> getServices(); @NotNull Map<QName, ? extends WSDLService> getServices();
/**
* Returns the first service QName from insertion order
*/
public QName getFirstServiceName();
/**
* Returns the message with the given QName
* @param name Message name
* @return Message
*/
public WSDLMessage getMessage(QName name);
/**
* Gives a {@link Map} of wsdl:message qualified name and {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLMesage}
*
* @return an empty Map if the wsdl document has no wsdl:message
*/
@NotNull Map<QName, ? extends WSDLMessage> getMessages();
/** /**
* Gives the PolicyMap associated with the WSDLModel * Gives the PolicyMap associated with the WSDLModel
* *
@ -115,7 +136,6 @@ public interface WSDLModel extends WSDLExtensible {
*/ */
public PolicyMap getPolicyMap(); public PolicyMap getPolicyMap();
/** /**
* Main purpose of this class is to parsing of a WSDL and get the {@link WSDLModel} from it. * Main purpose of this class is to parsing of a WSDL and get the {@link WSDLModel} from it.
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -56,8 +56,6 @@ public interface WSDLOperation extends WSDLObject, WSDLExtensible {
*/ */
@Nullable WSDLOutput getOutput(); @Nullable WSDLOutput getOutput();
/** /**
* Returns true if this operation is an one-way operation. * Returns true if this operation is an one-way operation.
*/ */
@ -112,4 +110,10 @@ public interface WSDLOperation extends WSDLObject, WSDLExtensible {
* Gives the enclosing wsdl:portType@name attribute value. * Gives the enclosing wsdl:portType@name attribute value.
*/ */
@NotNull QName getPortTypeName(); @NotNull QName getPortTypeName();
/**
* Returns parameter order
* @return Parameter order
*/
public String getParameterOrder();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -79,4 +79,11 @@ public interface WSDLOutput extends WSDLObject, WSDLExtensible {
*/ */
@NotNull @NotNull
QName getQName(); QName getQName();
/**
* Checks if the Action value is implicitly derived using the rules defined in WS-Addressing.
*
* @return true if the Action value is implicitly derived using the rules defined in WS-Addressing.
*/
public boolean isDefaultAction();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,9 @@
package com.sun.xml.internal.ws.api.model.wsdl; package com.sun.xml.internal.ws.api.model.wsdl;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.EndpointAddress;
import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
@ -64,4 +66,10 @@ public interface WSDLPort extends WSDLFeaturedObject, WSDLExtensible {
*/ */
@NotNull @NotNull
WSDLService getOwner(); WSDLService getOwner();
/**
* Returns endpoint reference
* @return Endpoint reference
*/
public @Nullable WSEndpointReference getEPR();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,6 @@ public interface WSDLPortType extends WSDLObject, WSDLExtensible {
*/ */
public WSDLOperation get(String operationName); public WSDLOperation get(String operationName);
/** /**
* Gets {@link Iterable}<{@link WSDLOperation}> * Gets {@link Iterable}<{@link WSDLOperation}>
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
package com.sun.xml.internal.ws.api.model.wsdl; package com.sun.xml.internal.ws.api.model.wsdl;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
@ -61,6 +62,12 @@ public interface WSDLService extends WSDLObject, WSDLExtensible {
*/ */
WSDLPort getFirstPort(); WSDLPort getFirstPort();
/**
* Gets the first port in this service which matches the portType
*/
@Nullable
WSDLPort getMatchingPort(QName portTypeName);
/** /**
* Gives all the {@link WSDLPort} in a wsdl:service {@link WSDLService} * Gives all the {@link WSDLPort} in a wsdl:service {@link WSDLService}
*/ */

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundFault;
public interface EditableWSDLBoundFault extends WSDLBoundFault {
@Override
@Nullable
EditableWSDLFault getFault();
@Override
@NotNull
EditableWSDLBoundOperation getBoundOperation();
/**
* Freezes WSDL model to prevent further modification
*
* @param operation Operation
*/
void freeze(EditableWSDLBoundOperation operation);
}

View File

@ -0,0 +1,124 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import java.util.Map;
import javax.jws.WebParam.Mode;
import javax.jws.soap.SOAPBinding.Style;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
public interface EditableWSDLBoundOperation extends WSDLBoundOperation {
@Override
@NotNull EditableWSDLOperation getOperation();
@Override
@NotNull EditableWSDLBoundPortType getBoundPortType();
@Override
@Nullable EditableWSDLPart getPart(@NotNull String partName, @NotNull Mode mode);
@Override
@NotNull Map<String,? extends EditableWSDLPart> getInParts();
@Override
@NotNull Map<String,? extends EditableWSDLPart> getOutParts();
@Override
@NotNull Iterable<? extends EditableWSDLBoundFault> getFaults();
/**
* Add Part
* @param part Part
* @param mode Mode
*/
public void addPart(EditableWSDLPart part, Mode mode);
/**
* Add Fault
* @param fault Fault
*/
public void addFault(@NotNull EditableWSDLBoundFault fault);
/**
* Sets the soapbinding:binding/operation/wsaw:Anonymous.
*
* @param anonymous Anonymous value of the operation
*/
public void setAnonymous(ANONYMOUS anonymous);
/**
* Sets input explicit body parts
* @param b True, if input body part is explicit
*/
public void setInputExplicitBodyParts(boolean b);
/**
* Sets output explicit body parts
* @param b True, if output body part is explicit
*/
public void setOutputExplicitBodyParts(boolean b);
/**
* Sets fault explicit body parts
* @param b True, if fault body part is explicit
*/
public void setFaultExplicitBodyParts(boolean b);
/**
* Set request namespace
* @param ns Namespace
*/
public void setRequestNamespace(String ns);
/**
* Set response namespace
* @param ns Namespace
*/
public void setResponseNamespace(String ns);
/**
* Set SOAP action
* @param soapAction SOAP action
*/
public void setSoapAction(String soapAction);
/**
* Set parameter style
* @param style Style
*/
public void setStyle(Style style);
/**
* Freezes WSDL model to prevent further modification
* @param root WSDL Model
*/
public void freeze(EditableWSDLModel root);
}

View File

@ -0,0 +1,78 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.namespace.QName;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.BindingID;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
public interface EditableWSDLBoundPortType extends WSDLBoundPortType {
@Override
@NotNull EditableWSDLModel getOwner();
@Override
public EditableWSDLBoundOperation get(QName operationName);
@Override
EditableWSDLPortType getPortType();
@Override
Iterable<? extends EditableWSDLBoundOperation> getBindingOperations();
@Override
@Nullable EditableWSDLBoundOperation getOperation(String namespaceUri, String localName);
/**
* Populates the Map that holds operation name as key and {@link WSDLBoundOperation} as the value.
*
* @param opName Must be non-null
* @param ptOp Must be non-null
* @throws NullPointerException if either opName or ptOp is null
*/
public void put(QName opName, EditableWSDLBoundOperation ptOp);
/**
* Sets the binding ID
* @param bindingId Binding ID
*/
public void setBindingId(BindingID bindingId);
/**
* sets whether the {@link WSDLBoundPortType} is rpc or lit
*/
public void setStyle(Style style);
/**
* Freezes WSDL model to prevent further modification
*/
public void freeze();
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
public interface EditableWSDLFault extends WSDLFault {
@Override
EditableWSDLMessage getMessage();
@Override
@NotNull
EditableWSDLOperation getOperation();
/**
* Sets action
*
* @param action Action
*/
public void setAction(String action);
/**
* Set to true if this is the default action
*
* @param defaultAction True, if default action
*/
public void setDefaultAction(boolean defaultAction);
/**
* Freezes WSDL model to prevent further modification
*
* @param root WSDL Model
*/
public void freeze(EditableWSDLModel root);
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
public interface EditableWSDLInput extends WSDLInput {
@Override
EditableWSDLMessage getMessage();
@Override
@NotNull
EditableWSDLOperation getOperation();
/**
* Sets action
*
* @param action Action
*/
public void setAction(String action);
/**
* Set to true if this is the default action
*
* @param defaultAction True, if default action
*/
public void setDefaultAction(boolean defaultAction);
/**
* Freezes WSDL model to prevent further modification
*
* @param root WSDL Model
*/
public void freeze(EditableWSDLModel root);
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
public interface EditableWSDLMessage extends WSDLMessage {
@Override
Iterable<? extends EditableWSDLPart> parts();
/**
* Add part
*
* @param part Part
*/
public void add(EditableWSDLPart part);
}

View File

@ -0,0 +1,115 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import java.util.Map;
import javax.xml.namespace.QName;
import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
import com.sun.xml.internal.ws.policy.PolicyMap;
public interface EditableWSDLModel extends WSDLModel {
@Override
EditableWSDLPortType getPortType(@NotNull QName name);
/**
* Add Binding
*
* @param portType Bound port type
*/
void addBinding(EditableWSDLBoundPortType portType);
@Override
EditableWSDLBoundPortType getBinding(@NotNull QName name);
@Override
EditableWSDLBoundPortType getBinding(@NotNull QName serviceName, @NotNull QName portName);
@Override
EditableWSDLService getService(@NotNull QName name);
@Override
@NotNull
Map<QName, ? extends EditableWSDLMessage> getMessages();
/**
* Add message
*
* @param msg Message
*/
public void addMessage(EditableWSDLMessage msg);
@Override
@NotNull
Map<QName, ? extends EditableWSDLPortType> getPortTypes();
/**
* Add port type
*
* @param pt Port type
*/
public void addPortType(EditableWSDLPortType pt);
@Override
@NotNull
Map<QName, ? extends EditableWSDLBoundPortType> getBindings();
@Override
@NotNull
Map<QName, ? extends EditableWSDLService> getServices();
/**
* Add service
*
* @param svc Service
*/
public void addService(EditableWSDLService svc);
@Override
public EditableWSDLMessage getMessage(QName name);
/**
* @param policyMap
* @deprecated
*/
public void setPolicyMap(PolicyMap policyMap);
/**
* Finalize rpc-lit binding
*
* @param portType Binding
*/
public void finalizeRpcLitBinding(EditableWSDLBoundPortType portType);
/**
* Freezes WSDL model to prevent further modification
*/
public void freeze();
}

View File

@ -0,0 +1,85 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import javax.xml.namespace.QName;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
public interface EditableWSDLOperation extends WSDLOperation {
@Override
@NotNull
EditableWSDLInput getInput();
/**
* Set input
*
* @param input Input
*/
public void setInput(EditableWSDLInput input);
@Override
@Nullable
EditableWSDLOutput getOutput();
/**
* Set output
*
* @param output Output
*/
public void setOutput(EditableWSDLOutput output);
@Override
Iterable<? extends EditableWSDLFault> getFaults();
/**
* Add fault
*
* @param fault Fault
*/
public void addFault(EditableWSDLFault fault);
@Override
@Nullable
EditableWSDLFault getFault(QName faultDetailName);
/**
* Set parameter order
*
* @param parameterOrder Parameter order
*/
public void setParameterOrder(String parameterOrder);
/**
* Freezes WSDL model to prevent further modification
*
* @param root WSDL Model
*/
public void freeze(EditableWSDLModel root);
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
public interface EditableWSDLOutput extends WSDLOutput {
@Override
EditableWSDLMessage getMessage();
@Override
@NotNull
EditableWSDLOperation getOperation();
/**
* Sets action
*
* @param action Action
*/
public void setAction(String action);
/**
* Set to true if this is the default action
*
* @param defaultAction True, if default action
*/
public void setDefaultAction(boolean defaultAction);
/**
* Freezes WSDL model to prevent further modification
*
* @param root WSDL Model
*/
public void freeze(EditableWSDLModel root);
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.xml.internal.ws.api.model.ParameterBinding;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart;
public interface EditableWSDLPart extends WSDLPart {
/**
* Sets binding
*
* @param binding Binding
*/
public void setBinding(ParameterBinding binding);
/**
* Sets index
*
* @param index Index
*/
public void setIndex(int index);
}

View File

@ -0,0 +1,63 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.EndpointAddress;
import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
public interface EditableWSDLPort extends WSDLPort {
@Override
@NotNull
EditableWSDLBoundPortType getBinding();
@Override
@NotNull
EditableWSDLService getOwner();
/**
* Sets endpoint address
*
* @param address Endpoint address
*/
public void setAddress(EndpointAddress address);
/**
* Sets endpoint reference
*
* @param epr Endpoint reference
*/
public void setEPR(@NotNull WSEndpointReference epr);
/**
* Freezes WSDL model to prevent further modification
*
* @param root WSDL Model
*/
void freeze(EditableWSDLModel root);
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
public interface EditableWSDLPortType extends WSDLPortType {
@Override
public EditableWSDLOperation get(String operationName);
@Override
public Iterable<? extends EditableWSDLOperation> getOperations();
/**
* Associate WSDL operation with operation name
*
* @param opName Operation name
* @param ptOp Operation
*/
public void put(String opName, EditableWSDLOperation ptOp);
/**
* Freezes WSDL model to prevent further modification
*/
public void freeze();
}

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.ws.api.model.wsdl.editable;
import javax.xml.namespace.QName;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
public interface EditableWSDLService extends WSDLService {
@Override
@NotNull
EditableWSDLModel getParent();
@Override
EditableWSDLPort get(QName portName);
@Override
EditableWSDLPort getFirstPort();
@Override
@Nullable
EditableWSDLPort getMatchingPort(QName portTypeName);
@Override
Iterable<? extends EditableWSDLPort> getPorts();
/**
* Associate WSDL port with port QName
*
* @param portName Port QName
* @param port Port
*/
public void put(QName portName, EditableWSDLPort port);
/**
* Freezes WSDL model to prevent further modification
*
* @param root WSDL Model
*/
void freeze(EditableWSDLModel root);
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,17 @@
package com.sun.xml.internal.ws.api.wsdl.parser; package com.sun.xml.internal.ws.api.wsdl.parser;
import com.sun.xml.internal.ws.api.WSService; import com.sun.xml.internal.ws.api.WSService;
import com.sun.xml.internal.ws.api.model.wsdl.*; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLInput;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOutput;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService;
import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.Tube;
import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
@ -138,34 +148,36 @@ import javax.xml.ws.WebServiceException;
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public abstract class WSDLParserExtension { public abstract class WSDLParserExtension {
public void start(WSDLParserExtensionContext context){ public void start(WSDLParserExtensionContext context){
// noop // noop
} }
public void serviceAttributes(WSDLService service, XMLStreamReader reader) {
public void serviceAttributes(EditableWSDLService service, XMLStreamReader reader) {
// noop // noop
} }
public boolean serviceElements(WSDLService service, XMLStreamReader reader) { public boolean serviceElements(EditableWSDLService service, XMLStreamReader reader) {
return false; return false;
} }
public void portAttributes(WSDLPort port, XMLStreamReader reader) { public void portAttributes(EditableWSDLPort port, XMLStreamReader reader) {
// noop // noop
} }
public boolean portElements(WSDLPort port, XMLStreamReader reader) { public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) {
return false; return false;
} }
public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) { public boolean portTypeOperationInput(EditableWSDLOperation op, XMLStreamReader reader) {
return false; return false;
} }
public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) { public boolean portTypeOperationOutput(EditableWSDLOperation op, XMLStreamReader reader) {
return false; return false;
} }
public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) { public boolean portTypeOperationFault(EditableWSDLOperation op, XMLStreamReader reader) {
return false; return false;
} }
@ -173,81 +185,81 @@ public abstract class WSDLParserExtension {
return false; return false;
} }
public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) {
return false; return false;
} }
public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader) { public void bindingAttributes(EditableWSDLBoundPortType binding, XMLStreamReader reader) {
} }
public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) { public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) {
return false; return false;
} }
public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) { public void portTypeAttributes(EditableWSDLPortType portType, XMLStreamReader reader) {
} }
public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) { public boolean portTypeOperationElements(EditableWSDLOperation operation, XMLStreamReader reader) {
return false; return false;
} }
public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) { public void portTypeOperationAttributes(EditableWSDLOperation operation, XMLStreamReader reader) {
} }
public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
return false; return false;
} }
public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { public void bindingOperationAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
} }
public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) { public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) {
return false; return false;
} }
public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) { public void messageAttributes(EditableWSDLMessage msg, XMLStreamReader reader) {
} }
public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) { public boolean portTypeOperationInputElements(EditableWSDLInput input, XMLStreamReader reader) {
return false; return false;
} }
public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) { public void portTypeOperationInputAttributes(EditableWSDLInput input, XMLStreamReader reader) {
} }
public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) { public boolean portTypeOperationOutputElements(EditableWSDLOutput output, XMLStreamReader reader) {
return false; return false;
} }
public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) { public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) {
} }
public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) { public boolean portTypeOperationFaultElements(EditableWSDLFault fault, XMLStreamReader reader) {
return false; return false;
} }
public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) { public void portTypeOperationFaultAttributes(EditableWSDLFault fault, XMLStreamReader reader) {
} }
public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) { public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
return false; return false;
} }
public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { public void bindingOperationInputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
} }
public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) { public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
return false; return false;
} }
public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { public void bindingOperationOutputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) {
} }
public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) { public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) {
return false; return false;
} }
public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) { public void bindingOperationFaultAttributes(EditableWSDLBoundFault fault, XMLStreamReader reader) {
} }
// TODO: complete the rest of the callback // TODO: complete the rest of the callback

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,7 @@
package com.sun.xml.internal.ws.api.wsdl.parser; package com.sun.xml.internal.ws.api.wsdl.parser;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel;
import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.Container;
import com.sun.xml.internal.ws.api.policy.PolicyResolver; import com.sun.xml.internal.ws.api.policy.PolicyResolver;
@ -44,10 +44,10 @@ public interface WSDLParserExtensionContext {
boolean isClientSide(); boolean isClientSide();
/** /**
* Gives the {@link WSDLModel}. The WSDLModel may not be complete until * Gives the {@link EditableWSDLModel}. The WSDLModel may not be complete until
* {@link WSDLParserExtension#finished(WSDLParserExtensionContext)} is called. * {@link WSDLParserExtension#finished(WSDLParserExtensionContext)} is called.
*/ */
WSDLModel getWSDLModel(); EditableWSDLModel getWSDLModel();
/** /**
* Provides the {@link Container} in which this service or client is running. * Provides the {@link Container} in which this service or client is running.

View File

@ -38,7 +38,6 @@ import com.sun.xml.internal.ws.api.FeatureConstructor;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject; import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject;
import com.sun.xml.internal.ws.model.RuntimeModelerException; import com.sun.xml.internal.ws.model.RuntimeModelerException;
import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
import com.sun.xml.internal.ws.resources.ModelerMessages; import com.sun.xml.internal.ws.resources.ModelerMessages;
import com.sun.xml.internal.bind.util.Which; import com.sun.xml.internal.bind.util.Which;
@ -440,9 +439,9 @@ public final class WebServiceFeatureList extends AbstractMap<Class<? extends Web
} }
/** /**
* Extracts features from {@link WSDLPortImpl#getFeatures()}. Extra features * Extracts features from {@link WSDLPort#getFeatures()}. Extra features
* that are not already set on binding. i.e, if a feature is set already on * that are not already set on binding. i.e, if a feature is set already on
* binding through someother API the coresponding wsdlFeature is not set. * binding through some other API the corresponding wsdlFeature is not set.
* *
* @param wsdlPort * @param wsdlPort
* WSDLPort model * WSDLPort model
@ -452,7 +451,7 @@ public final class WebServiceFeatureList extends AbstractMap<Class<? extends Web
* true * true
* @param reportConflicts * @param reportConflicts
* If true, checks if the feature setting in WSDL (wsdl extension * If true, checks if the feature setting in WSDL (wsdl extension
* or policy configuration) colflicts with feature setting in * or policy configuration) conflicts with feature setting in
* Deployed Service and logs warning if there are any conflicts. * Deployed Service and logs warning if there are any conflicts.
*/ */
public void mergeFeatures(@NotNull WSDLPort wsdlPort, public void mergeFeatures(@NotNull WSDLPort wsdlPort,

View File

@ -25,14 +25,18 @@
package com.sun.xml.internal.ws.client; package com.sun.xml.internal.ws.client;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.Container;
import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl;
import java.util.Map; import java.util.Map;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import com.sun.org.glassfish.gmbal.AMXMetadata; import com.sun.org.glassfish.gmbal.AMXMetadata;
import com.sun.org.glassfish.gmbal.Description; import com.sun.org.glassfish.gmbal.Description;
import com.sun.org.glassfish.gmbal.ManagedAttribute; import com.sun.org.glassfish.gmbal.ManagedAttribute;
import com.sun.org.glassfish.gmbal.ManagedObject; import com.sun.org.glassfish.gmbal.ManagedObject;
import java.net.URL; import java.net.URL;
/** /**
@ -74,7 +78,7 @@ public final class MonitorRootClient extends com.sun.xml.internal.ws.server.Moni
private URL wsdlDocumentLocation() { return stub.owner.getWSDLDocumentLocation(); } private URL wsdlDocumentLocation() { return stub.owner.getWSDLDocumentLocation(); }
@ManagedAttribute @ManagedAttribute
private WSDLServiceImpl wsdlService() { return stub.owner.getWsdlService(); } private WSDLService wsdlService() { return stub.owner.getWsdlService(); }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -36,8 +36,6 @@ import com.sun.xml.internal.ws.api.client.WSPortInfo;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.binding.BindingImpl;
import com.sun.xml.internal.ws.binding.WebServiceFeatureList; import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl;
import com.sun.xml.internal.ws.policy.PolicyMap; import com.sun.xml.internal.ws.policy.PolicyMap;
import com.sun.xml.internal.ws.policy.jaxws.PolicyUtil; import com.sun.xml.internal.ws.policy.jaxws.PolicyUtil;
@ -96,7 +94,7 @@ public class PortInfo implements WSPortInfo {
public PolicyMap createPolicyMap() { public PolicyMap createPolicyMap() {
PolicyMap map; PolicyMap map;
if(portModel != null) { if(portModel != null) {
map = ((WSDLModelImpl) portModel.getOwner().getParent()).getPolicyMap(); map = portModel.getOwner().getParent().getPolicyMap();
} else { } else {
map = PolicyResolverFactory.create().resolve(new PolicyResolver.ClientContext(null,owner.getContainer())); map = PolicyResolverFactory.create().resolve(new PolicyResolver.ClientContext(null,owner.getContainer()));
} }
@ -154,8 +152,8 @@ public class PortInfo implements WSPortInfo {
private WSDLPort getPortModel(WSServiceDelegate owner, QName portName) { private WSDLPort getPortModel(WSServiceDelegate owner, QName portName) {
if (owner.getWsdlService() != null){ if (owner.getWsdlService() != null){
Iterable<WSDLPortImpl> ports = owner.getWsdlService().getPorts(); Iterable<? extends WSDLPort> ports = owner.getWsdlService().getPorts();
for (WSDLPortImpl port : ports){ for (WSDLPort port : ports){
if (port.getName().equals(portName)) if (port.getName().equals(portName))
return port; return port;
} }

View File

@ -62,7 +62,6 @@ import com.sun.xml.internal.ws.binding.BindingImpl;
import com.sun.xml.internal.ws.developer.JAXWSProperties; import com.sun.xml.internal.ws.developer.JAXWSProperties;
import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.developer.WSBindingProvider;
import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties; import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties;
import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
import com.sun.xml.internal.ws.model.wsdl.WSDLPortProperties; import com.sun.xml.internal.ws.model.wsdl.WSDLPortProperties;
import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; import com.sun.xml.internal.ws.model.wsdl.WSDLProperties;
import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.resources.ClientMessages;
@ -354,7 +353,7 @@ public abstract class Stub implements WSBindingProvider, ResponseContextReceiver
*/ */
private static void checkAllWSDLExtensionsUnderstood(WSPortInfo port, WSBinding binding) { private static void checkAllWSDLExtensionsUnderstood(WSPortInfo port, WSBinding binding) {
if (port.getPort() != null && binding.isFeatureEnabled(RespectBindingFeature.class)) { if (port.getPort() != null && binding.isFeatureEnabled(RespectBindingFeature.class)) {
((WSDLPortImpl) port.getPort()).areRequiredExtensionsUnderstood(); port.getPort().areRequiredExtensionsUnderstood();
} }
} }
@ -649,7 +648,7 @@ public abstract class Stub implements WSBindingProvider, ResponseContextReceiver
//gather EPRExtensions specified in WSDL. //gather EPRExtensions specified in WSDL.
try { try {
WSEndpointReference wsdlEpr = ((WSDLPortImpl) wsdlPort).getEPR(); WSEndpointReference wsdlEpr = wsdlPort.getEPR();
if (wsdlEpr != null) { if (wsdlEpr != null) {
for (WSEndpointReference.EPRExtension extnEl : wsdlEpr.getEPRExtensions()) { for (WSEndpointReference.EPRExtension extnEl : wsdlEpr.getEPRExtensions()) {
wsdlEPRExtensions.add(new WSEPRExtension( wsdlEPRExtensions.add(new WSEPRExtension(

View File

@ -41,7 +41,9 @@ import com.sun.xml.internal.ws.api.databinding.DatabindingConfig;
import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; import com.sun.xml.internal.ws.api.databinding.DatabindingFactory;
import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.databinding.MetadataReader;
import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.SEIModel;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
import com.sun.xml.internal.ws.api.pipe.Stubs; import com.sun.xml.internal.ws.api.pipe.Stubs;
import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.Container;
import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.api.server.ContainerResolver;
@ -51,15 +53,11 @@ import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
import com.sun.xml.internal.ws.client.HandlerConfigurator.AnnotationConfigurator; import com.sun.xml.internal.ws.client.HandlerConfigurator.AnnotationConfigurator;
import com.sun.xml.internal.ws.client.HandlerConfigurator.HandlerResolverImpl; import com.sun.xml.internal.ws.client.HandlerConfigurator.HandlerResolverImpl;
import com.sun.xml.internal.ws.client.sei.SEIStub; import com.sun.xml.internal.ws.client.sei.SEIStub;
import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature; import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature;
import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.developer.WSBindingProvider;
import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.model.RuntimeModeler;
import com.sun.xml.internal.ws.model.SOAPSEIModel; import com.sun.xml.internal.ws.model.SOAPSEIModel;
import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl;
import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl;
import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.resources.ClientMessages;
import com.sun.xml.internal.ws.resources.DispatchMessages; import com.sun.xml.internal.ws.resources.DispatchMessages;
import com.sun.xml.internal.ws.resources.ProviderApiMessages; import com.sun.xml.internal.ws.resources.ProviderApiMessages;
@ -67,6 +65,7 @@ import com.sun.xml.internal.ws.util.JAXWSUtils;
import com.sun.xml.internal.ws.util.ServiceConfigurationError; import com.sun.xml.internal.ws.util.ServiceConfigurationError;
import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.ServiceFinder;
import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
import org.xml.sax.EntityResolver; import org.xml.sax.EntityResolver;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
@ -86,6 +85,7 @@ import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature; import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.HandlerResolver; import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.soap.AddressingFeature; import javax.xml.ws.soap.AddressingFeature;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
@ -179,7 +179,7 @@ public class WSServiceDelegate extends WSService {
* This fiels can be be null if the service is created without wsdl but later * This fiels can be be null if the service is created without wsdl but later
* the epr supplies a wsdl that can be parsed. * the epr supplies a wsdl that can be parsed.
*/ */
private @Nullable WSDLServiceImpl wsdlService; private @Nullable WSDLService wsdlService;
private final Container container; private final Container container;
/** /**
@ -219,7 +219,7 @@ public class WSServiceDelegate extends WSService {
* @param serviceClass * @param serviceClass
* Either {@link Service}.class or other generated service-derived classes. * Either {@link Service}.class or other generated service-derived classes.
*/ */
public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLServiceImpl service, @NotNull QName serviceName, @NotNull final Class<? extends Service> serviceClass, WebServiceFeature... features) { public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLService service, @NotNull QName serviceName, @NotNull final Class<? extends Service> serviceClass, WebServiceFeature... features) {
this(wsdl, service, serviceName, serviceClass, new WebServiceFeatureList(features)); this(wsdl, service, serviceName, serviceClass, new WebServiceFeatureList(features));
} }
@ -227,7 +227,7 @@ public class WSServiceDelegate extends WSService {
* @param serviceClass * @param serviceClass
* Either {@link Service}.class or other generated service-derived classes. * Either {@link Service}.class or other generated service-derived classes.
*/ */
public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLServiceImpl service, @NotNull QName serviceName, @NotNull final Class<? extends Service> serviceClass, WebServiceFeatureList features) { public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLService service, @NotNull QName serviceName, @NotNull final Class<? extends Service> serviceClass, WebServiceFeatureList features) {
//we cant create a Service without serviceName //we cant create a Service without serviceName
if (serviceName == null) { if (serviceName == null) {
throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(null)); throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(null));
@ -303,7 +303,7 @@ public class WSServiceDelegate extends WSService {
if (wsdl != null) { if (wsdl != null) {
try { try {
URL url = wsdl.getSystemId()==null ? null : JAXWSUtils.getEncodedURL(wsdl.getSystemId()); URL url = wsdl.getSystemId()==null ? null : JAXWSUtils.getEncodedURL(wsdl.getSystemId());
WSDLModelImpl model = parseWSDL(url, wsdl, serviceClass); WSDLModel model = parseWSDL(url, wsdl, serviceClass);
service = model.getService(this.serviceName); service = model.getService(this.serviceName);
if (service == null) if (service == null)
throw new WebServiceException( throw new WebServiceException(
@ -316,6 +316,10 @@ public class WSServiceDelegate extends WSService {
throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId())); throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId()));
} }
} }
} else {
// fill in statically known ports
for (WSDLPort port : service.getPorts())
ports.put(port.getName(), new PortInfo(this, port));
} }
this.wsdlService = service; this.wsdlService = service;
@ -339,7 +343,7 @@ public class WSServiceDelegate extends WSService {
* Either this or <tt>wsdl</tt> parameter must be given. * Either this or <tt>wsdl</tt> parameter must be given.
* Null location means the system won't be able to resolve relative references in the WSDL, * Null location means the system won't be able to resolve relative references in the WSDL,
*/ */
private WSDLModelImpl parseWSDL(URL wsdlDocumentLocation, Source wsdlSource, Class serviceClass) { private WSDLModel parseWSDL(URL wsdlDocumentLocation, Source wsdlSource, Class serviceClass) {
try { try {
return RuntimeWSDLParser.parse(wsdlDocumentLocation, wsdlSource, createCatalogResolver(), return RuntimeWSDLParser.parse(wsdlDocumentLocation, wsdlSource, createCatalogResolver(),
true, getContainer(), serviceClass, ServiceFinder.find(WSDLParserExtension.class).toArray()); true, getContainer(), serviceClass, ServiceFinder.find(WSDLParserExtension.class).toArray());
@ -385,7 +389,7 @@ public class WSServiceDelegate extends WSService {
public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) { public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
if (portName == null || portInterface == null) if (portName == null || portInterface == null)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
WSDLServiceImpl tWsdlService = this.wsdlService; WSDLService tWsdlService = this.wsdlService;
if (tWsdlService == null) { if (tWsdlService == null) {
// assigning it to local variable and not setting it back to this.wsdlService intentionally // assigning it to local variable and not setting it back to this.wsdlService intentionally
// as we don't want to include the service instance with information gathered from sei // as we don't want to include the service instance with information gathered from sei
@ -396,7 +400,7 @@ public class WSServiceDelegate extends WSService {
} }
} }
WSDLPortImpl portModel = getPortModel(tWsdlService, portName); WSDLPort portModel = getPortModel(tWsdlService, portName);
return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features)); return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features));
} }
@ -436,7 +440,7 @@ public class WSServiceDelegate extends WSService {
public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) { public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
//get the portType from SEI //get the portType from SEI
QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader())); QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader()));
WSDLServiceImpl tmpWsdlService = this.wsdlService; WSDLService tmpWsdlService = this.wsdlService;
if (tmpWsdlService == null) { if (tmpWsdlService == null) {
// assigning it to local variable and not setting it back to this.wsdlService intentionally // assigning it to local variable and not setting it back to this.wsdlService intentionally
// as we don't want to include the service instance with information gathered from sei // as we don't want to include the service instance with information gathered from sei
@ -447,7 +451,7 @@ public class WSServiceDelegate extends WSService {
} }
} }
//get the first port corresponding to the SEI //get the first port corresponding to the SEI
WSDLPortImpl port = tmpWsdlService.getMatchingPort(portTypeName); WSDLPort port = tmpWsdlService.getMatchingPort(portTypeName);
if (port == null) { if (port == null) {
throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName)); throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
} }
@ -672,7 +676,7 @@ public class WSServiceDelegate extends WSService {
throw new WebServiceException(ProviderApiMessages.NULL_WSDL()); throw new WebServiceException(ProviderApiMessages.NULL_WSDL());
} }
try { try {
WSDLModelImpl eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource, null); WSDLModel eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource, null);
wsdlService = eprWsdlMdl.getService(serviceName); wsdlService = eprWsdlMdl.getService(serviceName);
if (wsdlService == null) if (wsdlService == null)
throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME(serviceName, throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME(serviceName,
@ -685,7 +689,7 @@ public class WSServiceDelegate extends WSService {
if (portName == null && portTypeName != null) { if (portName == null && portTypeName != null) {
//get the first port corresponding to the SEI //get the first port corresponding to the SEI
WSDLPortImpl port = wsdlService.getMatchingPort(portTypeName); WSDLPort port = wsdlService.getMatchingPort(portTypeName);
if (port == null) if (port == null)
throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName)); throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
portName = port.getName(); portName = port.getName();
@ -732,7 +736,7 @@ public class WSServiceDelegate extends WSService {
); );
} }
private WSDLServiceImpl getWSDLModelfromSEI(final Class sei) { private WSDLService getWSDLModelfromSEI(final Class sei) {
WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() { WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() {
public WebService run() { public WebService run() {
return (WebService) sei.getAnnotation(WebService.class); return (WebService) sei.getAnnotation(WebService.class);
@ -743,11 +747,11 @@ public class WSServiceDelegate extends WSService {
String wsdlLocation = ws.wsdlLocation(); String wsdlLocation = ws.wsdlLocation();
wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
Source wsdl = new StreamSource(wsdlLocation); Source wsdl = new StreamSource(wsdlLocation);
WSDLServiceImpl service = null; WSDLService service = null;
try { try {
URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId()); URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId());
WSDLModelImpl model = parseWSDL(url, wsdl, sei); WSDLModel model = parseWSDL(url, wsdl, sei);
service = model.getService(this.serviceName); service = model.getService(this.serviceName);
if (service == null) if (service == null)
throw new WebServiceException( throw new WebServiceException(
@ -815,7 +819,7 @@ public class WSServiceDelegate extends WSService {
*/ */
private StringBuilder buildWsdlPortNames() { private StringBuilder buildWsdlPortNames() {
Set<QName> wsdlPortNames = new HashSet<QName>(); Set<QName> wsdlPortNames = new HashSet<QName>();
for (WSDLPortImpl port : wsdlService.getPorts()) { for (WSDLPort port : wsdlService.getPorts()) {
wsdlPortNames.add(port.getName()); wsdlPortNames.add(port.getName());
} }
return buildNameList(wsdlPortNames); return buildNameList(wsdlPortNames);
@ -826,8 +830,8 @@ public class WSServiceDelegate extends WSService {
* *
* @return guaranteed to be non-null. * @return guaranteed to be non-null.
*/ */
public @NotNull WSDLPortImpl getPortModel(WSDLServiceImpl wsdlService, QName portName) { public @NotNull WSDLPort getPortModel(WSDLService wsdlService, QName portName) {
WSDLPortImpl port = wsdlService.get(portName); WSDLPort port = wsdlService.get(portName);
if (port == null) if (port == null)
throw new WebServiceException( throw new WebServiceException(
ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames())); ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
@ -884,7 +888,7 @@ public class WSServiceDelegate extends WSService {
} }
private SEIPortInfo createSEIPortInfo(QName portName, Class portInterface, WebServiceFeatureList features) { private SEIPortInfo createSEIPortInfo(QName portName, Class portInterface, WebServiceFeatureList features) {
WSDLPortImpl wsdlPort = getPortModel(wsdlService, portName); WSDLPort wsdlPort = getPortModel(wsdlService, portName);
SEIModel model = buildRuntimeModel(serviceName, portName, portInterface, wsdlPort, features); SEIModel model = buildRuntimeModel(serviceName, portName, portInterface, wsdlPort, features);
return new SEIPortInfo(this, portInterface, (SOAPSEIModel) model, wsdlPort); return new SEIPortInfo(this, portInterface, (SOAPSEIModel) model, wsdlPort);
@ -894,7 +898,7 @@ public class WSServiceDelegate extends WSService {
return features.contains(UsesJAXBContextFeature.class); return features.contains(UsesJAXBContextFeature.class);
} }
public WSDLServiceImpl getWsdlService() { public WSDLService getWsdlService() {
return wsdlService; return wsdlService;
} }

View File

@ -75,13 +75,13 @@ public class ExternalMetadataReader extends ReflectAnnotationReader {
private Map<String, JavaWsdlMappingType> readers = new HashMap<String, JavaWsdlMappingType>(); private Map<String, JavaWsdlMappingType> readers = new HashMap<String, JavaWsdlMappingType>();
public ExternalMetadataReader(Collection<File> files, Collection<String> resourcePaths, ClassLoader classLoader, public ExternalMetadataReader(Collection<File> files, Collection<String> resourcePaths, ClassLoader classLoader,
boolean xsdValidation, boolean disableSecureXmlProcessing) { boolean xsdValidation, boolean disableXmlSecurity) {
if (files != null) { if (files != null) {
for (File file : files) { for (File file : files) {
try { try {
String namespace = Util.documentRootNamespace(newSource(file), disableSecureXmlProcessing); String namespace = Util.documentRootNamespace(newSource(file), disableXmlSecurity);
JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(file), namespace, disableSecureXmlProcessing); JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(file), namespace, disableXmlSecurity);
readers.put(externalMapping.getJavaTypeName(), externalMapping); readers.put(externalMapping.getJavaTypeName(), externalMapping);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeModelerException("runtime.modeler.external.metadata.unable.to.read", file.getAbsolutePath()); throw new RuntimeModelerException("runtime.modeler.external.metadata.unable.to.read", file.getAbsolutePath());
@ -92,8 +92,8 @@ public class ExternalMetadataReader extends ReflectAnnotationReader {
if (resourcePaths != null) { if (resourcePaths != null) {
for (String resourcePath : resourcePaths) { for (String resourcePath : resourcePaths) {
try { try {
String namespace = Util.documentRootNamespace(newSource(resourcePath, classLoader), disableSecureXmlProcessing); String namespace = Util.documentRootNamespace(newSource(resourcePath, classLoader), disableXmlSecurity);
JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(resourcePath, classLoader), namespace, disableSecureXmlProcessing); JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(resourcePath, classLoader), namespace, disableXmlSecurity);
readers.put(externalMapping.getJavaTypeName(), externalMapping); readers.put(externalMapping.getJavaTypeName(), externalMapping);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeModelerException("runtime.modeler.external.metadata.unable.to.read", resourcePath); throw new RuntimeModelerException("runtime.modeler.external.metadata.unable.to.read", resourcePath);
@ -107,11 +107,11 @@ public class ExternalMetadataReader extends ReflectAnnotationReader {
return new StreamSource(is); return new StreamSource(is);
} }
private JavaWsdlMappingType parseMetadata(boolean xsdValidation, StreamSource source, String namespace, boolean disableSecureXmlProcessing) throws JAXBException, IOException, TransformerException { private JavaWsdlMappingType parseMetadata(boolean xsdValidation, StreamSource source, String namespace, boolean disableXmlSecurity) throws JAXBException, IOException, TransformerException {
if (NAMESPACE_WEBLOGIC_WSEE_DATABINDING.equals(namespace)) { if (NAMESPACE_WEBLOGIC_WSEE_DATABINDING.equals(namespace)) {
return Util.transformAndRead(source, disableSecureXmlProcessing); return Util.transformAndRead(source, disableXmlSecurity);
} if (NAMESPACE_JAXWS_RI_EXTERNAL_METADATA.equals(namespace)) { } if (NAMESPACE_JAXWS_RI_EXTERNAL_METADATA.equals(namespace)) {
return Util.read(source, xsdValidation, disableSecureXmlProcessing); return Util.read(source, xsdValidation, disableXmlSecurity);
} else { } else {
throw new RuntimeModelerException("runtime.modeler.external.metadata.unsupported.schema", namespace, Arrays.asList(NAMESPACE_WEBLOGIC_WSEE_DATABINDING, NAMESPACE_JAXWS_RI_EXTERNAL_METADATA).toString()); throw new RuntimeModelerException("runtime.modeler.external.metadata.unsupported.schema", namespace, Arrays.asList(NAMESPACE_WEBLOGIC_WSEE_DATABINDING, NAMESPACE_JAXWS_RI_EXTERNAL_METADATA).toString());
} }
@ -425,8 +425,8 @@ public class ExternalMetadataReader extends ReflectAnnotationReader {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static JavaWsdlMappingType read(Source src, boolean xsdValidation, boolean disableSecureXmlProcessing) throws IOException, JAXBException { public static JavaWsdlMappingType read(Source src, boolean xsdValidation, boolean disableXmlSecurity) throws IOException, JAXBException {
JAXBContext ctx = jaxbContext(disableSecureXmlProcessing); JAXBContext ctx = jaxbContext(disableXmlSecurity);
try { try {
Unmarshaller um = ctx.createUnmarshaller(); Unmarshaller um = ctx.createUnmarshaller();
if (xsdValidation) { if (xsdValidation) {
@ -455,16 +455,16 @@ public class ExternalMetadataReader extends ReflectAnnotationReader {
} }
} }
private static JAXBContext jaxbContext(boolean disableSecureXmlProcessing) { private static JAXBContext jaxbContext(boolean disableXmlSecurity) {
// as it is supposed to have security enabled in most cases, we create and don't cache // as it is supposed to have security enabled in most cases, we create and don't cache
// "insecure" JAXBContext - these should be corner cases // "insecure" JAXBContext - these should be corner cases
return disableSecureXmlProcessing ? createJaxbContext(true) : jaxbContext; return disableXmlSecurity ? createJaxbContext(true) : jaxbContext;
} }
public static JavaWsdlMappingType transformAndRead(Source src, boolean disableSecureXmlProcessing) throws TransformerException, JAXBException { public static JavaWsdlMappingType transformAndRead(Source src, boolean disableXmlSecurity) throws TransformerException, JAXBException {
Source xsl = new StreamSource(Util.class.getResourceAsStream(TRANSLATE_NAMESPACES_XSL)); Source xsl = new StreamSource(Util.class.getResourceAsStream(TRANSLATE_NAMESPACES_XSL));
JAXBResult result = new JAXBResult(jaxbContext(disableSecureXmlProcessing)); JAXBResult result = new JAXBResult(jaxbContext(disableXmlSecurity));
TransformerFactory tf = XmlUtil.newTransformerFactory(!disableSecureXmlProcessing); TransformerFactory tf = XmlUtil.newTransformerFactory(!disableXmlSecurity);
Transformer transformer = tf.newTemplates(xsl).newTransformer(); Transformer transformer = tf.newTemplates(xsl).newTransformer();
transformer.transform(src, result); transformer.transform(src, result);
return getJavaWsdlMapping(result.getResult()); return getJavaWsdlMapping(result.getResult());
@ -534,9 +534,9 @@ public class ExternalMetadataReader extends ReflectAnnotationReader {
return elems.toArray(new Element[elems.size()]); return elems.toArray(new Element[elems.size()]);
} }
static String documentRootNamespace(Source src, boolean disableSecureXmlProcessing) throws XMLStreamException { static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
XMLInputFactory factory; XMLInputFactory factory;
factory = XmlUtil.newXMLInputFactory(!disableSecureXmlProcessing); factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
XMLStreamReader streamReader = factory.createXMLStreamReader(src); XMLStreamReader streamReader = factory.createXMLStreamReader(src);
XMLStreamReaderUtil.nextElementContent(streamReader); XMLStreamReaderUtil.nextElementContent(streamReader);
String namespaceURI = streamReader.getName().getNamespaceURI(); String namespaceURI = streamReader.getName().getNamespaceURI();

View File

@ -25,7 +25,6 @@
package com.sun.xml.internal.ws.model; package com.sun.xml.internal.ws.model;
import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.bind.api.TypeReference; import com.sun.xml.internal.bind.api.TypeReference;
import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.databinding.MetadataReader;
import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.JavaMethod;
@ -216,14 +215,14 @@ public final class JavaMethodImpl implements JavaMethod {
* @return soap:Body's first child name for request message. * @return soap:Body's first child name for request message.
*/ */
public @Nullable QName getRequestPayloadName() { public @Nullable QName getRequestPayloadName() {
return (wsdlOperation != null)? wsdlOperation.getReqPayloadName(): requestPayloadName; return (wsdlOperation != null)? wsdlOperation.getRequestPayloadName(): requestPayloadName;
} }
/** /**
* @return soap:Body's first child name for response message. * @return soap:Body's first child name for response message.
*/ */
public @Nullable QName getResponsePayloadName() { public @Nullable QName getResponsePayloadName() {
return (mep == MEP.ONE_WAY) ? null : wsdlOperation.getResPayloadName(); return (mep == MEP.ONE_WAY) ? null : wsdlOperation.getResponsePayloadName();
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,11 +29,9 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension; import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject; import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject;
import com.sun.xml.internal.ws.resources.UtilMessages; import com.sun.xml.internal.ws.resources.UtilMessages;
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.Location;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceException;
import java.util.ArrayList; import java.util.ArrayList;
@ -42,7 +40,6 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import org.xml.sax.Locator; import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;
/** /**
* All the WSDL 1.1 elements that are extensible should subclass from this abstract implementation of * All the WSDL 1.1 elements that are extensible should subclass from this abstract implementation of
@ -95,6 +92,10 @@ abstract class AbstractExtensibleImpl extends AbstractObjectImpl implements WSDL
extensions.add(ex); extensions.add(ex);
} }
public List<? extends UnknownWSDLExtension> getNotUnderstoodExtensions() {
return notUnderstoodExtensions;
}
/** /**
* This can be used if a WSDL extension element that has wsdl:required=true * This can be used if a WSDL extension element that has wsdl:required=true
* is not understood * is not understood

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,10 +26,10 @@
package com.sun.xml.internal.ws.model.wsdl; package com.sun.xml.internal.ws.model.wsdl;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundFault; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
@ -37,12 +37,12 @@ import javax.xml.namespace.QName;
/** /**
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements WSDLBoundFault { public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements EditableWSDLBoundFault {
private final String name; private final String name;
private WSDLFault fault; private EditableWSDLFault fault;
private WSDLBoundOperationImpl owner; private EditableWSDLBoundOperation owner;
public WSDLBoundFaultImpl(XMLStreamReader xsr, String name, WSDLBoundOperationImpl owner) { public WSDLBoundFaultImpl(XMLStreamReader xsr, String name, EditableWSDLBoundOperation owner) {
super(xsr); super(xsr);
this.name = name; this.name = name;
this.owner = owner; this.owner = owner;
@ -61,20 +61,20 @@ public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements WSDLBo
return null; return null;
} }
public WSDLFault getFault() { public EditableWSDLFault getFault() {
return fault; return fault;
} }
@NotNull @NotNull
public WSDLBoundOperation getBoundOperation() { public EditableWSDLBoundOperation getBoundOperation() {
return owner; return owner;
} }
void freeze(WSDLBoundOperationImpl root) { public void freeze(EditableWSDLBoundOperation root) {
assert root != null; assert root != null;
WSDLOperation op = root.getOperation(); EditableWSDLOperation op = root.getOperation();
if (op != null) { if (op != null) {
for (WSDLFault f : op.getFaults()) { for (EditableWSDLFault f : op.getFaults()) {
if (f.getName().equals(name)) { if (f.getName().equals(name)) {
this.fault = f; this.fault = f;
break; break;

View File

@ -29,12 +29,20 @@ import com.sun.istack.internal.Nullable;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.ParameterBinding;
import com.sun.xml.internal.ws.api.model.wsdl.*; import com.sun.xml.internal.ws.api.model.wsdl.*;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart;
import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.model.RuntimeModeler;
import javax.jws.WebParam.Mode; import javax.jws.WebParam.Mode;
import javax.jws.soap.SOAPBinding.Style; import javax.jws.soap.SOAPBinding.Style;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import java.util.*; import java.util.*;
/** /**
@ -42,7 +50,7 @@ import java.util.*;
* *
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements WSDLBoundOperation { public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements EditableWSDLBoundOperation {
private final QName name; private final QName name;
// map of wsdl:part to the binding // map of wsdl:part to the binding
@ -61,20 +69,20 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
private Boolean emptyOutputBody; private Boolean emptyOutputBody;
private Boolean emptyFaultBody; private Boolean emptyFaultBody;
private final Map<String, WSDLPartImpl> inParts; private final Map<String, EditableWSDLPart> inParts;
private final Map<String, WSDLPartImpl> outParts; private final Map<String, EditableWSDLPart> outParts;
private final List<WSDLBoundFaultImpl> wsdlBoundFaults; private final List<EditableWSDLBoundFault> wsdlBoundFaults;
private WSDLOperationImpl operation; private EditableWSDLOperation operation;
private String soapAction; private String soapAction;
private ANONYMOUS anonymous; private ANONYMOUS anonymous;
private final WSDLBoundPortTypeImpl owner; private final EditableWSDLBoundPortType owner;
/** /**
* *
* @param name wsdl:operation name qualified value * @param name wsdl:operation name qualified value
*/ */
public WSDLBoundOperationImpl(XMLStreamReader xsr, WSDLBoundPortTypeImpl owner, QName name) { public WSDLBoundOperationImpl(XMLStreamReader xsr, EditableWSDLBoundPortType owner, QName name) {
super(xsr); super(xsr);
this.name = name; this.name = name;
inputParts = new HashMap<String, ParameterBinding>(); inputParts = new HashMap<String, ParameterBinding>();
@ -83,9 +91,9 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
inputMimeTypes = new HashMap<String, String>(); inputMimeTypes = new HashMap<String, String>();
outputMimeTypes = new HashMap<String, String>(); outputMimeTypes = new HashMap<String, String>();
faultMimeTypes = new HashMap<String, String>(); faultMimeTypes = new HashMap<String, String>();
inParts = new HashMap<String, WSDLPartImpl>(); inParts = new HashMap<String, EditableWSDLPart>();
outParts = new HashMap<String, WSDLPartImpl>(); outParts = new HashMap<String, EditableWSDLPart>();
wsdlBoundFaults = new ArrayList<WSDLBoundFaultImpl>(); wsdlBoundFaults = new ArrayList<EditableWSDLBoundFault>();
this.owner = owner; this.owner = owner;
} }
@ -104,7 +112,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
} }
@Override @Override
public WSDLPartImpl getPart(String partName, Mode mode) { public EditableWSDLPart getPart(String partName, Mode mode) {
if(mode==Mode.IN){ if(mode==Mode.IN){
return inParts.get(partName); return inParts.get(partName);
}else if(mode==Mode.OUT){ }else if(mode==Mode.OUT){
@ -113,7 +121,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
return null; return null;
} }
public void addPart(WSDLPartImpl part, Mode mode){ public void addPart(EditableWSDLPart part, Mode mode){
if(mode==Mode.IN) if(mode==Mode.IN)
inParts.put(part.getName(), part); inParts.put(part.getName(), part);
else if(mode==Mode.OUT) else if(mode==Mode.OUT)
@ -149,53 +157,26 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
// TODO: what's the difference between this and inputParts/outputParts? // TODO: what's the difference between this and inputParts/outputParts?
@Override @Override
public Map<String,WSDLPart> getInParts() { public Map<String, ? extends EditableWSDLPart> getInParts() {
return Collections.<String,WSDLPart>unmodifiableMap(inParts); return Collections.<String, EditableWSDLPart>unmodifiableMap(inParts);
} }
@Override @Override
public Map<String,WSDLPart> getOutParts() { public Map<String, ? extends EditableWSDLPart> getOutParts() {
return Collections.<String,WSDLPart>unmodifiableMap(outParts); return Collections.<String, EditableWSDLPart>unmodifiableMap(outParts);
} }
@NotNull @NotNull
@Override @Override
public List<WSDLBoundFaultImpl> getFaults() { public List<? extends EditableWSDLBoundFault> getFaults() {
return wsdlBoundFaults; return wsdlBoundFaults;
} }
public void addFault(@NotNull WSDLBoundFaultImpl fault){ public void addFault(@NotNull EditableWSDLBoundFault fault){
wsdlBoundFaults.add(fault); wsdlBoundFaults.add(fault);
} }
/**
* Map of mime:content@part and the mime type from mime:content@type for wsdl:output
*
* @return empty Map if there is no parts
*/
public Map<String, String> getInputMimeTypes() {
return inputMimeTypes;
}
/**
* Map of mime:content@part and the mime type from mime:content@type for wsdl:output
*
* @return empty Map if there is no parts
*/
public Map<String, String> getOutputMimeTypes() {
return outputMimeTypes;
}
/**
* Map of mime:content@part and the mime type from mime:content@type for wsdl:fault
*
* @return empty Map if there is no parts
*/
public Map<String, String> getFaultMimeTypes() {
return faultMimeTypes;
}
/** /**
* Gets {@link ParameterBinding} for a given wsdl part in wsdl:input * Gets {@link ParameterBinding} for a given wsdl part in wsdl:input
* *
@ -296,13 +277,13 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
} }
@Override @Override
public WSDLOperationImpl getOperation() { public EditableWSDLOperation getOperation() {
return operation; return operation;
} }
@Override @Override
public WSDLBoundPortType getBoundPortType() { public EditableWSDLBoundPortType getBoundPortType() {
return owner; return owner;
} }
@ -324,7 +305,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
} }
@Override @Override
public @Nullable QName getReqPayloadName() { public @Nullable QName getRequestPayloadName() {
if (emptyRequestPayload) if (emptyRequestPayload)
return null; return null;
@ -337,8 +318,8 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
return requestPayloadName; return requestPayloadName;
}else{ }else{
QName inMsgName = operation.getInput().getMessage().getName(); QName inMsgName = operation.getInput().getMessage().getName();
WSDLMessageImpl message = messages.get(inMsgName); EditableWSDLMessage message = messages.get(inMsgName);
for(WSDLPartImpl part:message.parts()){ for(EditableWSDLPart part:message.parts()){
ParameterBinding binding = getInputBinding(part.getName()); ParameterBinding binding = getInputBinding(part.getName());
if(binding.isBody()){ if(binding.isBody()){
requestPayloadName = part.getDescriptor().name(); requestPayloadName = part.getDescriptor().name();
@ -354,7 +335,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
} }
@Override @Override
public @Nullable QName getResPayloadName() { public @Nullable QName getResponsePayloadName() {
if (emptyResponsePayload) if (emptyResponsePayload)
return null; return null;
@ -367,8 +348,8 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
return responsePayloadName; return responsePayloadName;
}else{ }else{
QName outMsgName = operation.getOutput().getMessage().getName(); QName outMsgName = operation.getOutput().getMessage().getName();
WSDLMessageImpl message = messages.get(outMsgName); EditableWSDLMessage message = messages.get(outMsgName);
for(WSDLPartImpl part:message.parts()){ for(EditableWSDLPart part:message.parts()){
ParameterBinding binding = getOutputBinding(part.getName()); ParameterBinding binding = getOutputBinding(part.getName());
if(binding.isBody()){ if(binding.isBody()){
responsePayloadName = part.getDescriptor().name(); responsePayloadName = part.getDescriptor().name();
@ -402,7 +383,6 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
reqNamespace = ns; reqNamespace = ns;
} }
/** /**
* For rpclit gives namespace value on soapbinding:body@namespace * For rpclit gives namespace value on soapbinding:body@namespace
* *
@ -418,7 +398,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
respNamespace = ns; respNamespace = ns;
} }
WSDLBoundPortTypeImpl getOwner(){ EditableWSDLBoundPortType getOwner(){
return owner; return owner;
} }
@ -426,12 +406,12 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme
private QName responsePayloadName; private QName responsePayloadName;
private boolean emptyRequestPayload; private boolean emptyRequestPayload;
private boolean emptyResponsePayload; private boolean emptyResponsePayload;
private Map<QName, WSDLMessageImpl> messages; private Map<QName, ? extends EditableWSDLMessage> messages;
void freeze(WSDLModelImpl parent) { public void freeze(EditableWSDLModel parent) {
messages = parent.getMessages(); messages = parent.getMessages();
operation = owner.getPortType().get(name.getLocalPart()); operation = owner.getPortType().get(name.getLocalPart());
for(WSDLBoundFaultImpl bf : wsdlBoundFaults){ for(EditableWSDLBoundFault bf : wsdlBoundFaults){
bf.freeze(this); bf.freeze(this);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,10 @@ import com.sun.xml.internal.ws.api.SOAPVersion;
import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.ParameterBinding;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType;
import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.resources.ClientMessages;
import com.sun.xml.internal.ws.util.QNameMap; import com.sun.xml.internal.ws.util.QNameMap;
import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException; import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException;
@ -47,26 +51,26 @@ import javax.xml.ws.soap.MTOMFeature;
* *
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl implements WSDLBoundPortType { public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl implements EditableWSDLBoundPortType {
private final QName name; private final QName name;
private final QName portTypeName; private final QName portTypeName;
private WSDLPortTypeImpl portType; private EditableWSDLPortType portType;
private BindingID bindingId; private BindingID bindingId;
private final @NotNull WSDLModelImpl owner; private final @NotNull EditableWSDLModel owner;
private final QNameMap<WSDLBoundOperationImpl> bindingOperations = new QNameMap<WSDLBoundOperationImpl>(); private final QNameMap<EditableWSDLBoundOperation> bindingOperations = new QNameMap<EditableWSDLBoundOperation>();
/** /**
* Operations keyed by the payload tag name. * Operations keyed by the payload tag name.
*/ */
private QNameMap<WSDLBoundOperationImpl> payloadMap; private QNameMap<EditableWSDLBoundOperation> payloadMap;
/** /**
* {@link #payloadMap} doesn't allow null key, so we store the value for it here. * {@link #payloadMap} doesn't allow null key, so we store the value for it here.
*/ */
private WSDLBoundOperationImpl emptyPayloadOperation; private EditableWSDLBoundOperation emptyPayloadOperation;
public WSDLBoundPortTypeImpl(XMLStreamReader xsr,@NotNull WSDLModelImpl owner, QName name, QName portTypeName) { public WSDLBoundPortTypeImpl(XMLStreamReader xsr,@NotNull EditableWSDLModel owner, QName name, QName portTypeName) {
super(xsr); super(xsr);
this.owner = owner; this.owner = owner;
this.name = name; this.name = name;
@ -78,11 +82,11 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
return name; return name;
} }
public @NotNull WSDLModelImpl getOwner() { public @NotNull EditableWSDLModel getOwner() {
return owner; return owner;
} }
public WSDLBoundOperationImpl get(QName operationName) { public EditableWSDLBoundOperation get(QName operationName) {
return bindingOperations.get(operationName); return bindingOperations.get(operationName);
} }
@ -93,7 +97,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
* @param ptOp Must be non-null * @param ptOp Must be non-null
* @throws NullPointerException if either opName or ptOp is null * @throws NullPointerException if either opName or ptOp is null
*/ */
public void put(QName opName, WSDLBoundOperationImpl ptOp) { public void put(QName opName, EditableWSDLBoundOperation ptOp) {
bindingOperations.put(opName,ptOp); bindingOperations.put(opName,ptOp);
} }
@ -101,11 +105,11 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
return portTypeName; return portTypeName;
} }
public WSDLPortTypeImpl getPortType() { public EditableWSDLPortType getPortType() {
return portType; return portType;
} }
public Iterable<WSDLBoundOperationImpl> getBindingOperations() { public Iterable<EditableWSDLBoundOperation> getBindingOperations() {
return bindingOperations.values(); return bindingOperations.values();
} }
@ -149,7 +153,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
* @return null if the binding could not be resolved for the part. * @return null if the binding could not be resolved for the part.
*/ */
public ParameterBinding getBinding(QName operation, String part, Mode mode) { public ParameterBinding getBinding(QName operation, String part, Mode mode) {
WSDLBoundOperationImpl op = get(operation); EditableWSDLBoundOperation op = get(operation);
if (op == null) { if (op == null) {
//TODO throw exception //TODO throw exception
return null; return null;
@ -160,23 +164,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
return op.getOutputBinding(part); return op.getOutputBinding(part);
} }
/** public EditableWSDLBoundOperation getOperation(String namespaceUri, String localName) {
* Gets mime:content@part value which is the MIME type for a given operation, part and {@link Mode}.
*
* @param operation wsdl:operation@name value. Must be non-null.
* @param part wsdl:part@name such as value of soap:header@part. Must be non-null.
* @param mode {@link Mode#IN} or {@link Mode#OUT}. Must be non-null.
* @return null if the binding could not be resolved for the part.
*/
public String getMimeType(QName operation, String part, Mode mode) {
WSDLBoundOperationImpl op = get(operation);
if (Mode.IN == mode)
return op.getMimeTypeForInputPart(part);
else
return op.getMimeTypeForOutputPart(part);
}
public WSDLBoundOperationImpl getOperation(String namespaceUri, String localName) {
if(namespaceUri==null && localName == null) if(namespaceUri==null && localName == null)
return emptyPayloadOperation; return emptyPayloadOperation;
else{ else{
@ -184,19 +172,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
} }
} }
public void enableMTOM() { public void freeze() {
features.add(new MTOMFeature());
}
public boolean isMTOMEnabled() {
return features.isEnabled(MTOMFeature.class);
}
public SOAPVersion getSOAPVersion(){
return getBindingId().getSOAPVersion();
}
void freeze() {
portType = owner.getPortType(portTypeName); portType = owner.getPortType(portTypeName);
if(portType == null){ if(portType == null){
throw new LocatableWebServiceException( throw new LocatableWebServiceException(
@ -204,7 +180,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
} }
portType.freeze(); portType.freeze();
for (WSDLBoundOperationImpl op : bindingOperations.values()) { for (EditableWSDLBoundOperation op : bindingOperations.values()) {
op.freeze(owner); op.freeze(owner);
} }
@ -214,15 +190,15 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl
private void freezePayloadMap() { private void freezePayloadMap() {
if(style== Style.RPC) { if(style== Style.RPC) {
payloadMap = new QNameMap<WSDLBoundOperationImpl>(); payloadMap = new QNameMap<EditableWSDLBoundOperation>();
for(WSDLBoundOperationImpl op : bindingOperations.values()){ for(EditableWSDLBoundOperation op : bindingOperations.values()){
payloadMap.put(op.getReqPayloadName(), op); payloadMap.put(op.getRequestPayloadName(), op);
} }
} else { } else {
payloadMap = new QNameMap<WSDLBoundOperationImpl>(); payloadMap = new QNameMap<EditableWSDLBoundOperation>();
// For doclit The tag will be the operation that has the same input part descriptor value // For doclit The tag will be the operation that has the same input part descriptor value
for(WSDLBoundOperationImpl op : bindingOperations.values()){ for(EditableWSDLBoundOperation op : bindingOperations.values()){
QName name = op.getReqPayloadName(); QName name = op.getRequestPayloadName();
if(name == null){ if(name == null){
//empty payload //empty payload
emptyPayloadOperation = op; emptyPayloadOperation = op;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,8 +25,10 @@
package com.sun.xml.internal.ws.model.wsdl; package com.sun.xml.internal.ws.model.wsdl;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
@ -35,15 +37,15 @@ import javax.xml.stream.XMLStreamReader;
/** /**
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLFault { public final class WSDLFaultImpl extends AbstractExtensibleImpl implements EditableWSDLFault {
private final String name; private final String name;
private final QName messageName; private final QName messageName;
private WSDLMessageImpl message; private EditableWSDLMessage message;
private WSDLOperationImpl operation; private EditableWSDLOperation operation;
private String action = ""; private String action = "";
private boolean defaultAction = true; private boolean defaultAction = true;
public WSDLFaultImpl(XMLStreamReader xsr, String name, QName messageName, WSDLOperationImpl operation) { public WSDLFaultImpl(XMLStreamReader xsr, String name, QName messageName, EditableWSDLOperation operation) {
super(xsr); super(xsr);
this.name = name; this.name = name;
this.messageName = messageName; this.messageName = messageName;
@ -54,12 +56,12 @@ public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLF
return name; return name;
} }
public WSDLMessageImpl getMessage() { public EditableWSDLMessage getMessage() {
return message; return message;
} }
@NotNull @NotNull
public WSDLOperation getOperation() { public EditableWSDLOperation getOperation() {
return operation; return operation;
} }
@ -72,6 +74,7 @@ public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLF
public String getAction() { public String getAction() {
return action; return action;
} }
public void setAction(String action) { public void setAction(String action) {
this.action = action; this.action = action;
} }
@ -84,7 +87,7 @@ public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLF
this.defaultAction = defaultAction; this.defaultAction = defaultAction;
} }
void freeze(WSDLModelImpl root){ public void freeze(EditableWSDLModel root){
message = root.getMessage(messageName); message = root.getMessage(messageName);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,11 +25,11 @@
package com.sun.xml.internal.ws.model.wsdl; package com.sun.xml.internal.ws.model.wsdl;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLInput;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
@ -37,15 +37,15 @@ import javax.xml.stream.XMLStreamReader;
/** /**
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLInput { public final class WSDLInputImpl extends AbstractExtensibleImpl implements EditableWSDLInput {
private String name; private String name;
private QName messageName; private QName messageName;
private WSDLOperationImpl operation; private EditableWSDLOperation operation;
private WSDLMessageImpl message; private EditableWSDLMessage message;
private String action; private String action;
private boolean defaultAction = true; private boolean defaultAction = true;
public WSDLInputImpl(XMLStreamReader xsr,String name, QName messageName, WSDLOperationImpl operation) { public WSDLInputImpl(XMLStreamReader xsr,String name, QName messageName, EditableWSDLOperation operation) {
super(xsr); super(xsr);
this.name = name; this.name = name;
this.messageName = messageName; this.messageName = messageName;
@ -59,7 +59,7 @@ public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLI
return (operation.isOneWay())?operation.getName().getLocalPart():operation.getName().getLocalPart()+"Request"; return (operation.isOneWay())?operation.getName().getLocalPart():operation.getName().getLocalPart()+"Request";
} }
public WSDLMessage getMessage() { public EditableWSDLMessage getMessage() {
return message; return message;
} }
@ -68,7 +68,7 @@ public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLI
} }
@NotNull @NotNull
public WSDLOperation getOperation() { public EditableWSDLOperation getOperation() {
return operation; return operation;
} }
@ -88,7 +88,7 @@ public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLI
this.defaultAction = defaultAction; this.defaultAction = defaultAction;
} }
void freeze(WSDLModelImpl parent) { public void freeze(EditableWSDLModel parent) {
message = parent.getMessage(messageName); message = parent.getMessage(messageName);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,19 +25,21 @@
package com.sun.xml.internal.ws.model.wsdl; package com.sun.xml.internal.ws.model.wsdl;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* Provides abstraction for wsdl:message * Provides abstraction for wsdl:message
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public final class WSDLMessageImpl extends AbstractExtensibleImpl implements WSDLMessage { public final class WSDLMessageImpl extends AbstractExtensibleImpl implements EditableWSDLMessage {
private final QName name; private final QName name;
private final ArrayList<WSDLPartImpl> parts; private final ArrayList<EditableWSDLPart> parts;
/** /**
* @param name wsdl:message name attribute value * @param name wsdl:message name attribute value
@ -45,18 +47,18 @@ public final class WSDLMessageImpl extends AbstractExtensibleImpl implements WSD
public WSDLMessageImpl(XMLStreamReader xsr,QName name) { public WSDLMessageImpl(XMLStreamReader xsr,QName name) {
super(xsr); super(xsr);
this.name = name; this.name = name;
this.parts = new ArrayList<WSDLPartImpl>(); this.parts = new ArrayList<EditableWSDLPart>();
} }
public QName getName() { public QName getName() {
return name; return name;
} }
public void add(WSDLPartImpl part){ public void add(EditableWSDLPart part){
parts.add(part); parts.add(part);
} }
public Iterable<WSDLPartImpl> parts(){ public Iterable<EditableWSDLPart> parts(){
return parts; return parts;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,21 +27,25 @@ package com.sun.xml.internal.ws.model.wsdl;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.ParameterBinding;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType;
import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService;
import com.sun.xml.internal.ws.policy.PolicyMap; import com.sun.xml.internal.ws.policy.PolicyMap;
import javax.jws.WebParam.Mode; import javax.jws.WebParam.Mode;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import java.net.URL;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
@ -50,15 +54,15 @@ import java.util.Map;
* *
* @author Vivek Pandey * @author Vivek Pandey
*/ */
public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLModel { public final class WSDLModelImpl extends AbstractExtensibleImpl implements EditableWSDLModel {
private final Map<QName, WSDLMessageImpl> messages = new HashMap<QName, WSDLMessageImpl>(); private final Map<QName, EditableWSDLMessage> messages = new HashMap<QName, EditableWSDLMessage>();
private final Map<QName, WSDLPortTypeImpl> portTypes = new HashMap<QName, WSDLPortTypeImpl>(); private final Map<QName, EditableWSDLPortType> portTypes = new HashMap<QName, EditableWSDLPortType>();
private final Map<QName, WSDLBoundPortTypeImpl> bindings = new HashMap<QName, WSDLBoundPortTypeImpl>(); private final Map<QName, EditableWSDLBoundPortType> bindings = new HashMap<QName, EditableWSDLBoundPortType>();
private final Map<QName, WSDLServiceImpl> services = new LinkedHashMap<QName, WSDLServiceImpl>(); private final Map<QName, EditableWSDLService> services = new LinkedHashMap<QName, EditableWSDLService>();
private PolicyMap policyMap; private PolicyMap policyMap;
private final Map<QName,WSDLBoundPortType> unmBindings private final Map<QName, EditableWSDLBoundPortType> unmBindings
= Collections.<QName,WSDLBoundPortType>unmodifiableMap(bindings); = Collections.<QName, EditableWSDLBoundPortType>unmodifiableMap(bindings);
public WSDLModelImpl(@NotNull String systemId) { public WSDLModelImpl(@NotNull String systemId) {
@ -72,52 +76,52 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM
super(null,-1); super(null,-1);
} }
public void addMessage(WSDLMessageImpl msg){ public void addMessage(EditableWSDLMessage msg){
messages.put(msg.getName(), msg); messages.put(msg.getName(), msg);
} }
public WSDLMessageImpl getMessage(QName name){ public EditableWSDLMessage getMessage(QName name){
return messages.get(name); return messages.get(name);
} }
public void addPortType(WSDLPortTypeImpl pt){ public void addPortType(EditableWSDLPortType pt){
portTypes.put(pt.getName(), pt); portTypes.put(pt.getName(), pt);
} }
public WSDLPortTypeImpl getPortType(QName name){ public EditableWSDLPortType getPortType(QName name){
return portTypes.get(name); return portTypes.get(name);
} }
public void addBinding(WSDLBoundPortTypeImpl boundPortType){ public void addBinding(EditableWSDLBoundPortType boundPortType){
assert !bindings.containsValue(boundPortType); assert !bindings.containsValue(boundPortType);
bindings.put(boundPortType.getName(), boundPortType); bindings.put(boundPortType.getName(), boundPortType);
} }
public WSDLBoundPortTypeImpl getBinding(QName name){ public EditableWSDLBoundPortType getBinding(QName name){
return bindings.get(name); return bindings.get(name);
} }
public void addService(WSDLServiceImpl svc){ public void addService(EditableWSDLService svc){
services.put(svc.getName(), svc); services.put(svc.getName(), svc);
} }
public WSDLServiceImpl getService(QName name){ public EditableWSDLService getService(QName name){
return services.get(name); return services.get(name);
} }
public Map<QName, WSDLMessageImpl> getMessages() { public Map<QName, EditableWSDLMessage> getMessages() {
return messages; return messages;
} }
public @NotNull Map<QName, WSDLPortTypeImpl> getPortTypes() { public @NotNull Map<QName, EditableWSDLPortType> getPortTypes() {
return portTypes; return portTypes;
} }
public @NotNull Map<QName, WSDLBoundPortType> getBindings() { public @NotNull Map<QName, ? extends EditableWSDLBoundPortType> getBindings() {
return unmBindings; return unmBindings;
} }
public @NotNull Map<QName, WSDLServiceImpl> getServices(){ public @NotNull Map<QName, EditableWSDLService> getServices(){
return services; return services;
} }
@ -130,33 +134,6 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM
return services.values().iterator().next().getName(); return services.values().iterator().next().getName();
} }
/**
* Returns first port QName from first service as per the insertion order
*/
public QName getFirstPortName(){
WSDLPort fp = getFirstPort();
if(fp==null)
return null;
else
return fp.getName();
}
private WSDLPort getFirstPort(){
if(services.isEmpty())
return null;
WSDLService service = services.values().iterator().next();
Iterator<? extends WSDLPort> iter = service.getPorts().iterator();
WSDLPort port = iter.hasNext()?iter.next():null;
return port;
}
/**
* gets the first port in the wsdl which matches the serviceName and portType
*/
public WSDLPortImpl getMatchingPort(QName serviceName, QName portType){
return getService(serviceName).getMatchingPort(portType);
}
/** /**
* *
* @param serviceName non-null service QName * @param serviceName non-null service QName
@ -164,17 +141,17 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM
* @return * @return
* WSDLBoundOperation on success otherwise null. throws NPE if any of the parameters null * WSDLBoundOperation on success otherwise null. throws NPE if any of the parameters null
*/ */
public WSDLBoundPortTypeImpl getBinding(QName serviceName, QName portName){ public EditableWSDLBoundPortType getBinding(QName serviceName, QName portName){
WSDLServiceImpl service = services.get(serviceName); EditableWSDLService service = services.get(serviceName);
if(service != null){ if(service != null){
WSDLPortImpl port = service.get(portName); EditableWSDLPort port = service.get(portName);
if(port != null) if(port != null)
return port.getBinding(); return port.getBinding();
} }
return null; return null;
} }
void finalizeRpcLitBinding(WSDLBoundPortTypeImpl boundPortType){ public void finalizeRpcLitBinding(EditableWSDLBoundPortType boundPortType){
assert(boundPortType != null); assert(boundPortType != null);
QName portTypeName = boundPortType.getPortTypeName(); QName portTypeName = boundPortType.getPortTypeName();
if(portTypeName == null) if(portTypeName == null)
@ -182,15 +159,15 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM
WSDLPortType pt = portTypes.get(portTypeName); WSDLPortType pt = portTypes.get(portTypeName);
if(pt == null) if(pt == null)
return; return;
for (WSDLBoundOperationImpl bop : boundPortType.getBindingOperations()) { for (EditableWSDLBoundOperation bop : boundPortType.getBindingOperations()) {
WSDLOperation pto = pt.get(bop.getName().getLocalPart()); WSDLOperation pto = pt.get(bop.getName().getLocalPart());
WSDLMessage inMsgName = pto.getInput().getMessage(); WSDLMessage inMsgName = pto.getInput().getMessage();
if(inMsgName == null) if(inMsgName == null)
continue; continue;
WSDLMessageImpl inMsg = messages.get(inMsgName.getName()); EditableWSDLMessage inMsg = messages.get(inMsgName.getName());
int bodyindex = 0; int bodyindex = 0;
if(inMsg != null){ if(inMsg != null){
for(WSDLPartImpl part:inMsg.parts()){ for(EditableWSDLPart part:inMsg.parts()){
String name = part.getName(); String name = part.getName();
ParameterBinding pb = bop.getInputBinding(name); ParameterBinding pb = bop.getInputBinding(name);
if(pb.isBody()){ if(pb.isBody()){
@ -206,9 +183,9 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM
WSDLMessage outMsgName = pto.getOutput().getMessage(); WSDLMessage outMsgName = pto.getOutput().getMessage();
if(outMsgName == null) if(outMsgName == null)
continue; continue;
WSDLMessageImpl outMsg = messages.get(outMsgName.getName()); EditableWSDLMessage outMsg = messages.get(outMsgName.getName());
if(outMsg!= null){ if(outMsg!= null){
for(WSDLPartImpl part:outMsg.parts()){ for(EditableWSDLPart part:outMsg.parts()){
String name = part.getName(); String name = part.getName();
ParameterBinding pb = bop.getOutputBinding(name); ParameterBinding pb = bop.getOutputBinding(name);
if(pb.isBody()){ if(pb.isBody()){
@ -242,14 +219,14 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM
* Invoked at the end of the model construction to fix up references, etc. * Invoked at the end of the model construction to fix up references, etc.
*/ */
public void freeze() { public void freeze() {
for (WSDLServiceImpl service : services.values()) { for (EditableWSDLService service : services.values()) {
service.freeze(this); service.freeze(this);
} }
for (WSDLBoundPortTypeImpl bp : bindings.values()) { for (EditableWSDLBoundPortType bp : bindings.values()) {
bp.freeze(); bp.freeze();
} }
// Enforce freeze all the portTypes referenced by this endpoints, see Bug8966673 for detail // Enforce freeze all the portTypes referenced by this endpoints, see Bug8966673 for detail
for (WSDLPortTypeImpl pt : portTypes.values()) { for (EditableWSDLPortType pt : portTypes.values()) {
pt.freeze(); pt.freeze();
} }
} }

Some files were not shown because too many files have changed in this diff Show More