.
*
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java
index 40874364279..46b4270ff89 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.util;
import java.util.Comparator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java
index c4d3f07c6b6..c759b2b249e 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
+/*
+ * @(#)$Id: EncoderFactory.java,v 1.3 2005/09/10 19:07:33 kohsuke Exp $
+ */
+
package com.sun.codemodel.internal.util;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
index d8947ff2d4e..6db471edcf5 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.util;
import java.io.FilterWriter;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java
index 2dbcd787fdb..4fa997964ce 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
+/*
+ * @(#)$Id: MS1252Encoder.java,v 1.2 2005/09/10 19:07:33 kohsuke Exp $
+ */
+
package com.sun.codemodel.internal.util;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java
index 3f0d31303ad..3e025a7a5ed 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,10 @@
* have any questions.
*/
+/*
+ * @(#)SingleByteEncoder.java 1.14 03/01/23
+ */
+
package com.sun.codemodel.internal.util;
import java.nio.ByteBuffer;
@@ -47,109 +51,109 @@ abstract class SingleByteEncoder
private final Surrogate.Parser sgp = new Surrogate.Parser();
protected SingleByteEncoder(Charset cs,
- short[] index1, String index2,
- int mask1, int mask2, int shift)
+ short[] index1, String index2,
+ int mask1, int mask2, int shift)
{
- super(cs, 1.0f, 1.0f);
- this.index1 = index1;
- this.index2 = index2;
- this.mask1 = mask1;
- this.mask2 = mask2;
- this.shift = shift;
+ super(cs, 1.0f, 1.0f);
+ this.index1 = index1;
+ this.index2 = index2;
+ this.mask1 = mask1;
+ this.mask2 = mask2;
+ this.shift = shift;
}
public boolean canEncode(char c) {
- char testEncode;
- testEncode = index2.charAt(index1[(c & mask1) >> shift]
- + (c & mask2));
- if (testEncode == '\u0000')
- return false;
- else
- return true;
+ char testEncode;
+ testEncode = index2.charAt(index1[(c & mask1) >> shift]
+ + (c & mask2));
+ if (testEncode == '\u0000')
+ return false;
+ else
+ return true;
}
private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
- char[] sa = src.array();
- int sp = src.arrayOffset() + src.position();
- int sl = src.arrayOffset() + src.limit();
- sp = (sp <= sl ? sp : sl);
- byte[] da = dst.array();
- int dp = dst.arrayOffset() + dst.position();
- int dl = dst.arrayOffset() + dst.limit();
- dp = (dp <= dl ? dp : dl);
+ char[] sa = src.array();
+ int sp = src.arrayOffset() + src.position();
+ int sl = src.arrayOffset() + src.limit();
+ sp = (sp <= sl ? sp : sl);
+ byte[] da = dst.array();
+ int dp = dst.arrayOffset() + dst.position();
+ int dl = dst.arrayOffset() + dst.limit();
+ dp = (dp <= dl ? dp : dl);
- try {
- while (sp < sl) {
- char c = sa[sp];
- if (Surrogate.is(c)) {
- if (sgp.parse(c, sa, sp, sl) < 0)
- return sgp.error();
- return sgp.unmappableResult();
- }
- if (c >= '\uFFFE')
- return CoderResult.unmappableForLength(1);
- if (dl - dp < 1)
- return CoderResult.OVERFLOW;
+ try {
+ while (sp < sl) {
+ char c = sa[sp];
+ if (Surrogate.is(c)) {
+ if (sgp.parse(c, sa, sp, sl) < 0)
+ return sgp.error();
+ return sgp.unmappableResult();
+ }
+ if (c >= '\uFFFE')
+ return CoderResult.unmappableForLength(1);
+ if (dl - dp < 1)
+ return CoderResult.OVERFLOW;
- char e = index2.charAt(index1[(c & mask1) >> shift]
- + (c & mask2));
+ char e = index2.charAt(index1[(c & mask1) >> shift]
+ + (c & mask2));
- // If output byte is zero because input char is zero
- // then character is mappable, o.w. fail
- if (e == '\u0000' && c != '\u0000')
- return CoderResult.unmappableForLength(1);
+ // If output byte is zero because input char is zero
+ // then character is mappable, o.w. fail
+ if (e == '\u0000' && c != '\u0000')
+ return CoderResult.unmappableForLength(1);
- sp++;
- da[dp++] = (byte)e;
- }
- return CoderResult.UNDERFLOW;
- } finally {
- src.position(sp - src.arrayOffset());
- dst.position(dp - dst.arrayOffset());
- }
+ sp++;
+ da[dp++] = (byte)e;
+ }
+ return CoderResult.UNDERFLOW;
+ } finally {
+ src.position(sp - src.arrayOffset());
+ dst.position(dp - dst.arrayOffset());
+ }
}
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
- int mark = src.position();
- try {
- while (src.hasRemaining()) {
- char c = src.get();
- if (Surrogate.is(c)) {
- if (sgp.parse(c, src) < 0)
- return sgp.error();
- return sgp.unmappableResult();
- }
- if (c >= '\uFFFE')
- return CoderResult.unmappableForLength(1);
- if (!dst.hasRemaining())
- return CoderResult.OVERFLOW;
+ int mark = src.position();
+ try {
+ while (src.hasRemaining()) {
+ char c = src.get();
+ if (Surrogate.is(c)) {
+ if (sgp.parse(c, src) < 0)
+ return sgp.error();
+ return sgp.unmappableResult();
+ }
+ if (c >= '\uFFFE')
+ return CoderResult.unmappableForLength(1);
+ if (!dst.hasRemaining())
+ return CoderResult.OVERFLOW;
- char e = index2.charAt(index1[(c & mask1) >> shift]
- + (c & mask2));
+ char e = index2.charAt(index1[(c & mask1) >> shift]
+ + (c & mask2));
- // If output byte is zero because input char is zero
- // then character is mappable, o.w. fail
- if (e == '\u0000' && c != '\u0000')
- return CoderResult.unmappableForLength(1);
+ // If output byte is zero because input char is zero
+ // then character is mappable, o.w. fail
+ if (e == '\u0000' && c != '\u0000')
+ return CoderResult.unmappableForLength(1);
- mark++;
- dst.put((byte)e);
- }
- return CoderResult.UNDERFLOW;
- } finally {
- src.position(mark);
- }
+ mark++;
+ dst.put((byte)e);
+ }
+ return CoderResult.UNDERFLOW;
+ } finally {
+ src.position(mark);
+ }
}
protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
- if (true && src.hasArray() && dst.hasArray())
- return encodeArrayLoop(src, dst);
- else
- return encodeBufferLoop(src, dst);
+ if (true && src.hasArray() && dst.hasArray())
+ return encodeArrayLoop(src, dst);
+ else
+ return encodeBufferLoop(src, dst);
}
public byte encode(char inputChar) {
- return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
- (inputChar & mask2));
+ return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
+ (inputChar & mask2));
}
}
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java
index 0081f24bf5d..9cf6b2108f1 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@ import java.nio.charset.CoderResult;
* Utility class for dealing with surrogates.
*
* @author Mark Reinhold
+ * @version 1.11, 03/01/23
*/
class Surrogate {
@@ -111,7 +112,7 @@ class Surrogate {
public Parser() { }
- private int character; // UCS-4
+ private int character; // UCS-4
private CoderResult error = CoderResult.UNDERFLOW;
private boolean isPair;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java
index 549c89cc13b..ad09f15817a 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.util;
import java.io.FilterWriter;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java
index 58cd9d76d7f..5a55423b4c5 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.writer;
import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java
index cad99ce6155..1523d1a8d0f 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.writer;
import java.io.OutputStream;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java
index 4b923ad098b..1bf8f845c75 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.writer;
import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java
index cb785a7a76e..cbb5b203ba5 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.writer;
import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java
index 52b959739aa..10740dfa422 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.writer;
import java.io.FilterOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java
index 44975d934bb..0d345993bf5 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.codemodel.internal.writer;
import java.io.FilterOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java b/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java
index 74193498dbb..b11eb1bb3c3 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import javax.activation.DataSource;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java b/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java
index 357e6ff28bc..6cc67b466e4 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java b/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java
index 81a71bedee0..c9b77721c9a 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import org.xml.sax.helpers.XMLFilterImpl;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/Interned.java b/jaxws/src/share/classes/com/sun/istack/internal/Interned.java
index 17bf5c36892..26e6bff8648 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/Interned.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/Interned.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import java.lang.annotation.Documented;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java b/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java
index b8a103ca9f8..f31eb46f248 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import java.lang.annotation.Documented;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java b/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java
index 2a785fe6db3..269d2498193 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import java.lang.annotation.Documented;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/Pool.java b/jaxws/src/share/classes/com/sun/istack/internal/Pool.java
index 67405219be7..957a3362e3a 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/Pool.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/Pool.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import java.util.concurrent.ConcurrentLinkedQueue;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java b/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java
index 99fb6630926..558d8ce57c5 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java b/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java
index dfd68fe6cd6..0c6095f0a5a 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal;
import org.xml.sax.SAXParseException;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java
new file mode 100644
index 00000000000..c88f6aea2c4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.istack.internal;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.Location;
+
+/**
+ * {@link XMLStreamException} that properly handles exception chaining.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class XMLStreamException2 extends XMLStreamException {
+ public XMLStreamException2(String msg) {
+ super(msg);
+ }
+
+ public XMLStreamException2(Throwable th) {
+ super(th);
+ }
+
+ public XMLStreamException2(String msg, Throwable th) {
+ super(msg, th);
+ }
+
+ public XMLStreamException2(String msg, Location location) {
+ super(msg, location);
+ }
+
+ public XMLStreamException2(String msg, Location location, Throwable th) {
+ super(msg, location, th);
+ }
+
+ /**
+ * {@link XMLStreamException} doesn't return the correct cause.
+ */
+ public Throwable getCause() {
+ return getNestedException();
+ }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToContentHandler.java b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java
similarity index 93%
rename from jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToContentHandler.java
rename to jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java
index 5c544fcc02c..cf6c0d46d40 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,20 +22,19 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
+package com.sun.istack.internal;
-package com.sun.xml.internal.ws.util.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
import org.xml.sax.SAXException;
+import org.xml.sax.Locator;
+import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.namespace.QName;
+
/**
* This is a simple utility class that adapts StAX events from an
* {@link XMLStreamReader} to SAX events on a
@@ -43,6 +42,7 @@ import org.xml.sax.helpers.AttributesImpl;
* parser technologies.
*
* @author Ryan.Shoemaker@Sun.COM
+ * @version 1.0
*/
public class XMLStreamReaderToContentHandler {
@@ -56,6 +56,11 @@ public class XMLStreamReaderToContentHandler {
// event that was fired (such as end element)
private boolean eagerQuit;
+ /**
+ * If true, not start/endDocument event.
+ */
+ private boolean fragment;
+
/**
* Construct a new StAX to SAX adapter that will convert a StAX event
* stream into a SAX event stream.
@@ -65,10 +70,11 @@ public class XMLStreamReaderToContentHandler {
* @param saxCore
* SAXevent sink
*/
- public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore, boolean eagerQuit) {
+ public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore, boolean eagerQuit, boolean fragment) {
this.staxStreamReader = staxCore;
this.saxHandler = saxCore;
this.eagerQuit = eagerQuit;
+ this.fragment = fragment;
}
/*
@@ -152,15 +158,21 @@ public class XMLStreamReaderToContentHandler {
handleEndDocument();
} catch (SAXException e) {
- throw new XMLStreamException(e);
+ throw new XMLStreamException2(e);
}
}
private void handleEndDocument() throws SAXException {
+ if(fragment)
+ return;
+
saxHandler.endDocument();
}
private void handleStartDocument() throws SAXException {
+ if(fragment)
+ return;
+
saxHandler.setDocumentLocator(new Locator() {
public int getColumnNumber() {
return staxStreamReader.getLocation().getColumnNumber();
@@ -184,7 +196,7 @@ public class XMLStreamReaderToContentHandler {
staxStreamReader.getPITarget(),
staxStreamReader.getPIData());
} catch (SAXException e) {
- throw new XMLStreamException(e);
+ throw new XMLStreamException2(e);
}
}
@@ -195,7 +207,7 @@ public class XMLStreamReaderToContentHandler {
staxStreamReader.getTextStart(),
staxStreamReader.getTextLength() );
} catch (SAXException e) {
- throw new XMLStreamException(e);
+ throw new XMLStreamException2(e);
}
}
@@ -203,11 +215,15 @@ public class XMLStreamReaderToContentHandler {
QName qName = staxStreamReader.getName();
try {
+ String pfix = qName.getPrefix();
+ String rawname = (pfix == null || pfix.length() == 0)
+ ? qName.getLocalPart()
+ : pfix + ':' + qName.getLocalPart();
// fire endElement
saxHandler.endElement(
qName.getNamespaceURI(),
qName.getLocalPart(),
- qName.toString());
+ rawname);
// end namespace bindings
int nsCount = staxStreamReader.getNamespaceCount();
@@ -219,7 +235,7 @@ public class XMLStreamReaderToContentHandler {
saxHandler.endPrefixMapping(prefix);
}
} catch (SAXException e) {
- throw new XMLStreamException(e);
+ throw new XMLStreamException2(e);
}
}
@@ -249,7 +265,7 @@ public class XMLStreamReaderToContentHandler {
rawname,
attrs);
} catch (SAXException e) {
- throw new XMLStreamException(e);
+ throw new XMLStreamException2(e);
}
}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/package-info.java b/jaxws/src/share/classes/com/sun/istack/internal/package-info.java
index a9772934dfb..60a915df58d 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/package-info.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
/**
* istack-commons runtime utilities.
*/
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java
index 55dd90b60e5..2678f1437b3 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.istack.internal.tools;
import com.sun.mirror.type.TypeMirror;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/AntErrorListener.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/MaskingClassLoader.java
similarity index 51%
rename from jaxws/src/share/classes/com/sun/tools/internal/txw2/AntErrorListener.java
rename to jaxws/src/share/classes/com/sun/istack/internal/tools/MaskingClassLoader.java
index 9a666ee92d2..8159a7e677b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/AntErrorListener.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/MaskingClassLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,46 +22,47 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
+package com.sun.istack.internal.tools;
-package com.sun.tools.internal.txw2;
-
-import org.apache.tools.ant.Project;
-import org.xml.sax.SAXParseException;
-
-import java.text.MessageFormat;
+import java.util.Collection;
/**
+ * {@link ClassLoader} that masks a specified set of classes
+ * from its parent class loader.
+ *
+ *
+ * This code is used to create an isolated environment.
+ *
* @author Kohsuke Kawaguchi
*/
-public class AntErrorListener implements ErrorListener {
- private final Project project;
+public class MaskingClassLoader extends ClassLoader {
- public AntErrorListener(Project p) {
- this.project = p;
+ private final String[] masks;
+
+ public MaskingClassLoader(String... masks) {
+ this.masks = masks;
}
- public void error(SAXParseException e) {
- print(e,Project.MSG_ERR);
+ public MaskingClassLoader(Collection masks) {
+ this(masks.toArray(new String[masks.size()]));
}
- public void fatalError(SAXParseException e) {
- print(e,Project.MSG_ERR);
+ public MaskingClassLoader(ClassLoader parent, String... masks) {
+ super(parent);
+ this.masks = masks;
}
- public void warning(SAXParseException e) {
- print(e,Project.MSG_WARN);
+ public MaskingClassLoader(ClassLoader parent, Collection masks) {
+ this(parent, masks.toArray(new String[masks.size()]));
}
- private void print(SAXParseException e, int level) {
- project.log(e.getMessage(),level);
- project.log(getLocation(e),level);
- }
+ @Override
+ protected synchronized Class> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ for (String mask : masks) {
+ if(name.startsWith(mask))
+ throw new ClassNotFoundException();
+ }
- String getLocation(SAXParseException e) {
- return MessageFormat.format(" {0}:{1} of {2}",
- new Object[]{
- String.valueOf(e.getLineNumber()),
- String.valueOf(e.getColumnNumber()),
- e.getSystemId()});
+ return super.loadClass(name, resolve);
}
}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java
new file mode 100644
index 00000000000..013a0aa12ad
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.istack.internal.tools;
+
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Enumeration;
+
+/**
+ * Load classes/resources from a side folder, so that
+ * classes of the same package can live in a single jar file.
+ *
+ *
+ * {@link ParallelWorldClassLoader}("foo/") would load X.class from
+ * /foo/X.class (note that X is defined in the root package, not
+ * foo.X.
+ *
+ *
+ * This can be combined with {@link MaskingClassLoader} to mask classes which are loaded by the parent
+ * class loader so that the child class loader
+ * classes living in different folders are loaded
+ * before the parent class loader loads classes living the jar file publicly
+ * visible
+ * For example, with the following jar file:
+ *
+ * {@link ParallelWorldClassLoader}(MaskingClassLoader.class.getClassLoader()) would load foo.X.class from
+ * /bar/foo.X.class not the foo.X.class in the publicly visible place in the jar file, thus
+ * masking the parent classLoader from loading the class from foo.X.class
+ * (note that X is defined in the package foo, not
+ * bar.foo.X.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class ParallelWorldClassLoader extends ClassLoader {
+
+ /**
+ * Strings like "prefix/", "abc/", or "" to indicate
+ * classes should be loaded normally.
+ */
+ private final String prefix;
+
+ public ParallelWorldClassLoader(ClassLoader parent,String prefix) {
+ super(parent);
+ this.prefix = prefix;
+ }
+
+ protected Class findClass(String name) throws ClassNotFoundException {
+ StringBuffer sb = new StringBuffer(name.length()+prefix.length()+6);
+ sb.append(prefix).append(name.replace('.','/')).append(".class");
+
+ InputStream is = getParent().getResourceAsStream(sb.toString());
+ if (is==null)
+ throw new ClassNotFoundException(name);
+
+ try {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] buf = new byte[1024];
+ int len;
+ while((len=is.read(buf))>=0)
+ baos.write(buf,0,len);
+
+ buf = baos.toByteArray();
+ int packIndex = name.lastIndexOf('.');
+ if (packIndex != -1) {
+ String pkgname = name.substring(0, packIndex);
+ // Check if package already loaded.
+ Package pkg = getPackage(pkgname);
+ if (pkg == null) {
+ definePackage(pkgname, null, null, null, null, null, null, null);
+ }
+ }
+ return defineClass(name,buf,0,buf.length);
+ } catch (IOException e) {
+ throw new ClassNotFoundException(name,e);
+ }
+ }
+
+ protected URL findResource(String name) {
+ return getParent().getResource(prefix+name);
+ }
+
+ protected Enumeration findResources(String name) throws IOException {
+ return getParent().getResources( prefix+name);
+ }
+
+ /**
+ * Given the URL inside jar, returns the URL to the jar itself.
+ */
+ public static URL toJarUrl(URL res) throws ClassNotFoundException, MalformedURLException {
+ String url = res.toExternalForm();
+ if(!url.startsWith("jar:"))
+ throw new ClassNotFoundException("Loaded outside a jar "+url);
+ url = url.substring(4); // cut off jar:
+ url = url.substring(0,url.lastIndexOf('!')); // cut off everything after '!'
+ return new URL(url);
+ }
+}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java
index f77048324be..3ce8c80627f 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
/**
* istack-commons tool time utilities.
*
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java b/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java
index d976cd66459..c4f8f825a3b 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@ public class AnnotationProcessorFactoryImpl implements AnnotationProcessorFactor
if (wsAP == null) {
AnnotationProcessorContext context = new AnnotationProcessorContext();
- wsAP = new WebServiceAP(null, null, null, context);
+ wsAP = new WebServiceAP(null, context, null, null);
}
wsAP.init(apEnv);
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java b/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java
index 9cf442544df..31850e07dd2 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
/**
*
*
This document describes the {@link com.sun.mirror.apt.AnnotationProcessor AnnotationProcessor}
- * included with JAX-WS 2.0.
+ * included with JAX-WS 2.0.1.
*
*
The {@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl AnnoatationnProcessorFactoryImpl} class
* tells the APT
diff --git a/jaxws/src/share/classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin b/jaxws/src/share/classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin
new file mode 100644
index 00000000000..6b19c805ad8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin
@@ -0,0 +1,4 @@
+com.sun.tools.internal.xjc.addon.locator.SourceLocationAddOn
+com.sun.tools.internal.xjc.addon.sync.SynchronizedMethodAddOn
+com.sun.tools.internal.xjc.addon.at_generated.PluginImpl
+com.sun.tools.internal.xjc.addon.episode.PluginImpl
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java
index c9afcaa1792..2ec45591cc3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc;
import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
index ddc5a4ac95b..5dec6daad65 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
UNEXPECTED_NGCC_TOKEN = \
Unexpected {0} appears at line {1} column {2}
@@ -5,15 +30,16 @@ BASEDIR_DOESNT_EXIST = \
Non-existent directory: {0}
VERSION = \
- schemagen version "JAXB 2.0 in JDK 1.6" \n\
- JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.0 in JDK 1.6)
+ schemagen version "JAXB 2.1.3" \n\
+ JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.3 in JDK)
USAGE = \
Usage: schemagen [-options ...] \n\
Options: \n\
-\ \ \ \ -d : specify where to place processor and javac generated class files \n\
-\ \ \ \ -cp : specify where to find user specified files \n\
-\ \ \ \ -classpath : specify where to find user specified files \n\
-\ \ \ \ -version : display version information
+\ \ \ \ -d : specify where to place processor and javac generated class files\n\
+\ \ \ \ -cp : specify where to find user specified files\n\
+\ \ \ \ -classpath : specify where to find user specified files\n\
+\ \ \ \ -episode : generate episode file for separate compilation\n\
+\ \ \ \ -version : display version information\n\
\ \ \ \ -help : display this usage message
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java
index b1f22f42c8e..8a9656f43f3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc;
import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java
index 8f538075766..699f47828cd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc;
import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
index ef178300eb2..3b268d5e530 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc;
import java.io.File;
@@ -122,7 +121,7 @@ public class SchemaGenerator {
}
Class schemagenRunner = classLoader.loadClass(Runner.class.getName());
- Method mainMethod = schemagenRunner.getDeclaredMethod("main",String[].class);
+ Method mainMethod = schemagenRunner.getDeclaredMethod("main",String[].class,File.class);
List aptargs = new ArrayList();
@@ -150,7 +149,7 @@ public class SchemaGenerator {
aptargs.addAll(options.arguments);
String[] argsarray = aptargs.toArray(new String[aptargs.size()]);
- return (Integer)mainMethod.invoke(null,new Object[]{argsarray});
+ return (Integer)mainMethod.invoke(null,new Object[]{argsarray,options.episodeFile});
}
/**
@@ -204,11 +203,15 @@ public class SchemaGenerator {
}
public static final class Runner {
- public static int main(String[] args) throws Exception {
+ public static int main(String[] args, File episode) throws Exception {
ClassLoader cl = Runner.class.getClassLoader();
Class apt = cl.loadClass("com.sun.tools.apt.Main");
Method processMethod = apt.getMethod("process",AnnotationProcessorFactory.class, String[].class);
- return (Integer) processMethod.invoke(null, new com.sun.tools.internal.jxc.apt.SchemaGenerator(), args);
+
+ com.sun.tools.internal.jxc.apt.SchemaGenerator r = new com.sun.tools.internal.jxc.apt.SchemaGenerator();
+ if(episode!=null)
+ r.setEpisodeFile(episode);
+ return (Integer) processMethod.invoke(null, r, args);
}
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java
index 09175235a11..47d1fc41874 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.io.File;
@@ -88,7 +87,7 @@ final class AnnotationParser implements AnnotationProcessor {
// -Aconfig=foo.config:bar.config where : is the pathSeparatorChar
StringTokenizer st = new StringTokenizer(value,File.pathSeparator);
if(!st.hasMoreTokens()) {
- errorListener.error(null,Messages.NO_FILE_SPECIFIED.format());
+ errorListener.error(null,Messages.OPERAND_MISSING.format(Const.CONFIG_FILE_OPTION));
continue;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java
index ce842f980b3..68aa512346a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.util.Arrays;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java
index 6b6008b92bd..8ec9cdb55c5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java
index 117fec778fe..e9a053414fd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import com.sun.mirror.apt.AnnotationProcessorEnvironment;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java
index 553dc68dd99..3390a5f5502 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,21 +22,22 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
-import java.util.List;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import com.sun.mirror.declaration.AnnotationMirror;
+import com.sun.mirror.declaration.Declaration;
import com.sun.mirror.declaration.FieldDeclaration;
import com.sun.mirror.declaration.MethodDeclaration;
import com.sun.mirror.declaration.ParameterDeclaration;
import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.declaration.AnnotationMirror;
-import com.sun.mirror.declaration.Declaration;
import com.sun.mirror.type.MirroredTypeException;
+import com.sun.mirror.type.MirroredTypesException;
import com.sun.mirror.type.TypeMirror;
import com.sun.xml.internal.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl;
import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
@@ -67,6 +68,10 @@ public final class InlineAnnotationReaderImpl extends AbstractInlineAnnotationRe
return f.getAnnotation(annotationType)!=null;
}
+ public boolean hasClassAnnotation(TypeDeclaration clazz, Class extends Annotation> annotationType) {
+ return clazz.getAnnotation(annotationType)!=null;
+ }
+
public Annotation[] getAllFieldAnnotations(FieldDeclaration field, Locatable srcPos) {
return getAllAnnotations(field,srcPos);
}
@@ -94,7 +99,8 @@ public final class InlineAnnotationReaderImpl extends AbstractInlineAnnotationRe
for( AnnotationMirror m : decl.getAnnotationMirrors() ) {
try {
String fullName = m.getAnnotationType().getDeclaration().getQualifiedName();
- Class type = getClass().getClassLoader().loadClass(fullName);
+ Class extends Annotation> type =
+ getClass().getClassLoader().loadClass(fullName).asSubclass(Annotation.class);
Annotation annotation = decl.getAnnotation(type);
if(annotation!=null)
r.add( LocatableAnnotation.create(annotation,srcPos) );
@@ -135,6 +141,26 @@ public final class InlineAnnotationReaderImpl extends AbstractInlineAnnotationRe
}
}
+ public TypeMirror[] getClassArrayValue(Annotation a, String name) {
+ try {
+ a.annotationType().getMethod(name).invoke(a);
+ assert false;
+ throw new IllegalStateException("should throw a MirroredTypesException");
+ } catch (IllegalAccessException e) {
+ throw new IllegalAccessError(e.getMessage());
+ } catch (InvocationTargetException e) {
+ if( e.getCause() instanceof MirroredTypesException ) {
+ MirroredTypesException me = (MirroredTypesException)e.getCause();
+ Collection r = me.getTypeMirrors();
+ return r.toArray(new TypeMirror[r.size()]);
+ }
+ // impossible
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new NoSuchMethodError(e.getMessage());
+ }
+ }
+
protected String fullName(MethodDeclaration m) {
return m.getDeclaringType().getQualifiedName()+'#'+m.getSimpleName();
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties
index 9f69124cbb2..c9a4d4dd55e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties
@@ -1,12 +1,34 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
NON_EXISTENT_FILE = \
Directory "{0}" doesn't exist.
UNRECOGNIZED_PARAMETER = \
Unrecognized option {0} is not valid.
-NO_FILE_SPECIFIED = \
- No directory was specified.
-
-NO_CLASSPATH_SPECIFIED = \
- No classpath was specified.
+OPERAND_MISSING = \
+ Option "{0}" is missing an operand.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java
index 61fc613136d..13f3293fef0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.text.MessageFormat;
@@ -36,9 +35,8 @@ import java.util.ResourceBundle;
enum Messages {
// Accessor
NON_EXISTENT_FILE, // 1 arg
- NO_FILE_SPECIFIED, // 0 args
- NO_CLASSPATH_SPECIFIED, // 0 args
UNRECOGNIZED_PARAMETER, //1 arg
+ OPERAND_MISSING, // 1 arg
;
private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle");
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java
index a63f4f9b7bd..fbeb61d75d7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.io.File;
@@ -44,6 +43,8 @@ public class Options {
public File targetDir = null;
+ public File episodeFile = null;
+
public final List arguments = new ArrayList();
public void parseArguments(String[] args) throws BadCommandLineException {
@@ -64,7 +65,7 @@ public class Options {
if (args[i].equals("-d")) {
if (i == args.length - 1)
throw new BadCommandLineException(
- (Messages.NO_FILE_SPECIFIED.format()));
+ (Messages.OPERAND_MISSING.format(args[i])));
targetDir = new File(args[++i]);
if( !targetDir.exists() )
throw new BadCommandLineException(
@@ -72,10 +73,18 @@ public class Options {
return 1;
}
+ if (args[i].equals("-episode")) {
+ if (i == args.length - 1)
+ throw new BadCommandLineException(
+ (Messages.OPERAND_MISSING.format(args[i])));
+ episodeFile = new File(args[++i]);
+ return 1;
+ }
+
if (args[i].equals("-cp") || args[i].equals("-classpath")) {
if (i == args.length - 1)
throw new BadCommandLineException(
- (Messages.NO_CLASSPATH_SPECIFIED.format()));
+ (Messages.OPERAND_MISSING.format(args[i])));
classpath = args[++i];
return 1;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java
index 63f1a508125..bbadce081cc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.apt;
import java.io.File;
@@ -67,6 +66,8 @@ public class SchemaGenerator implements AnnotationProcessorFactory {
*/
private final Map schemaLocations = new HashMap();
+ private File episodeFile;
+
public SchemaGenerator() {
}
@@ -74,6 +75,10 @@ public class SchemaGenerator implements AnnotationProcessorFactory {
schemaLocations.putAll(m);
}
+ public void setEpisodeFile(File episodeFile) {
+ this.episodeFile = episodeFile;
+ }
+
public Collection supportedOptions() {
return Collections.emptyList();
}
@@ -113,14 +118,20 @@ public class SchemaGenerator implements AnnotationProcessorFactory {
// use the default
file = new File(suggestedFileName);
out = env.getFiler().createBinaryFile(Filer.Location.CLASS_TREE,"",file);
+ file = file.getAbsoluteFile();
}
StreamResult ss = new StreamResult(out);
env.getMessager().printNotice("Writing "+file);
- ss.setSystemId(file.getPath());
+ ss.setSystemId(file.toURL().toExternalForm());
return ss;
}
}, errorListener);
+
+ if(episodeFile!=null) {
+ env.getMessager().printNotice("Writing "+episodeFile);
+ model.generateEpisodeFile(new StreamResult(episodeFile));
+ }
} catch (IOException e) {
errorListener.error(e.getMessage(),e);
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html
index 6042da9a78f..c3bb171c271 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html
@@ -1,3 +1,27 @@
+
APT related code.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java
index e6e3a929406..86f8fda6b44 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
// AttributesImpl.java - default implementation of Attributes.
// Written by David Megginson, sax@megginson.com
// NO WARRANTY! This class is in the public domain.
@@ -67,6 +66,7 @@ import org.xml.sax.Attributes;
* @since SAX 2.0
* @author David Megginson,
* sax@megginson.com
+ * @version 2.0
*/
public class AttributesImpl implements Attributes
{
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java
index ad701c23a66..475c8311397 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
/* this file is generated by RelaxNGCC */
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.SAXException;
@@ -76,12 +75,6 @@ public class Classes extends NGCCHandler {
$localName = $__local;
$qname = $__qname;
switch($_ngcc_current_state) {
- case 4:
- {
- $_ngcc_current_state = 3;
- $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
- }
- break;
case 12:
{
if(($__uri == "" && $__local == "classes")) {
@@ -93,6 +86,12 @@ public class Classes extends NGCCHandler {
}
}
break;
+ case 4:
+ {
+ $_ngcc_current_state = 3;
+ $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+ }
+ break;
case 2:
{
if(($__uri == "" && $__local == "excludes")) {
@@ -134,6 +133,17 @@ public class Classes extends NGCCHandler {
$localName = $__local;
$qname = $__qname;
switch($_ngcc_current_state) {
+ case 3:
+ {
+ if(($__uri == "" && $__local == "excludes")) {
+ $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+ $_ngcc_current_state = 1;
+ }
+ else {
+ unexpectedLeaveElement($__qname);
+ }
+ }
+ break;
case 4:
{
$_ngcc_current_state = 3;
@@ -157,11 +167,6 @@ public class Classes extends NGCCHandler {
}
}
break;
- case 0:
- {
- revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
- }
- break;
case 8:
{
if(($__uri == "" && $__local == "includes")) {
@@ -173,15 +178,9 @@ public class Classes extends NGCCHandler {
}
}
break;
- case 3:
+ case 0:
{
- if(($__uri == "" && $__local == "excludes")) {
- $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
- $_ngcc_current_state = 1;
- }
- else {
- unexpectedLeaveElement($__qname);
- }
+ revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
}
break;
default:
@@ -254,6 +253,20 @@ public class Classes extends NGCCHandler {
public void text(String $value) throws SAXException {
switch($_ngcc_current_state) {
+ case 9:
+ {
+ include_content = $value;
+ $_ngcc_current_state = 8;
+ action2();
+ }
+ break;
+ case 3:
+ {
+ exclude_content = $value;
+ $_ngcc_current_state = 3;
+ action0();
+ }
+ break;
case 4:
{
exclude_content = $value;
@@ -261,7 +274,20 @@ public class Classes extends NGCCHandler {
action0();
}
break;
- case 9:
+ case 2:
+ {
+ $_ngcc_current_state = 1;
+ $runtime.sendText(super._cookie, $value);
+ }
+ break;
+ case 10:
+ {
+ __text = $value;
+ $_ngcc_current_state = 9;
+ action3();
+ }
+ break;
+ case 8:
{
include_content = $value;
$_ngcc_current_state = 8;
@@ -275,38 +301,11 @@ public class Classes extends NGCCHandler {
action1();
}
break;
- case 2:
- {
- $_ngcc_current_state = 1;
- $runtime.sendText(super._cookie, $value);
- }
- break;
case 0:
{
revertToParentFromText(this, super._cookie, $value);
}
break;
- case 8:
- {
- include_content = $value;
- $_ngcc_current_state = 8;
- action2();
- }
- break;
- case 10:
- {
- __text = $value;
- $_ngcc_current_state = 9;
- action3();
- }
- break;
- case 3:
- {
- exclude_content = $value;
- $_ngcc_current_state = 3;
- action0();
- }
- break;
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java
index 961df1c35a8..b58719a3969 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
/* this file is generated by RelaxNGCC */
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.SAXException;
@@ -79,7 +78,7 @@ public class Config extends NGCCHandler {
case 1:
{
if(($__uri == "" && $__local == "schema")) {
- NGCCHandler h = new Schema(this, super._source, $runtime, 31, baseDir);
+ NGCCHandler h = new Schema(this, super._source, $runtime, 3, baseDir);
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
}
else {
@@ -101,7 +100,7 @@ public class Config extends NGCCHandler {
case 2:
{
if(($__uri == "" && $__local == "schema")) {
- NGCCHandler h = new Schema(this, super._source, $runtime, 32, baseDir);
+ NGCCHandler h = new Schema(this, super._source, $runtime, 4, baseDir);
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
}
else {
@@ -124,7 +123,7 @@ public class Config extends NGCCHandler {
case 4:
{
if(($__uri == "" && $__local == "classes")) {
- NGCCHandler h = new Classes(this, super._source, $runtime, 34);
+ NGCCHandler h = new Classes(this, super._source, $runtime, 6);
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
}
else {
@@ -289,21 +288,21 @@ public class Config extends NGCCHandler {
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
switch($__cookie__) {
- case 31:
+ case 3:
{
_schema = ((Schema)$__result__);
action0();
$_ngcc_current_state = 1;
}
break;
- case 32:
+ case 4:
{
_schema = ((Schema)$__result__);
action0();
$_ngcc_current_state = 1;
}
break;
- case 34:
+ case 6:
{
classes = ((Classes)$__result__);
$_ngcc_current_state = 2;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java
index b4ee9898ad1..3c6624a93cc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java
index ed59a08bb79..6ef8d69e971 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java
index db72354e9a4..279d5651868 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.Attributes;
@@ -31,6 +30,7 @@ import org.xml.sax.SAXException;
/**
*
*
+ * @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/
public abstract class NGCCHandler implements NGCCEventReceiver {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java
index 180a830b71a..2bd6dc42be5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java
index 6d942a358f3..581fef308b1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.gen.config;
import java.text.MessageFormat;
@@ -51,6 +50,7 @@ import org.xml.sax.SAXParseException;
*
*
TODO: provide support for interleaving.
*
+ * @version $Id: NGCCRuntime.java,v 1.16 2003/03/23 02:47:46 okajima Exp $
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/
public class NGCCRuntime implements ContentHandler, NGCCEventSource {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java
index 4895421cafe..1a7f41f9ca3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
/* this file is generated by RelaxNGCC */
package com.sun.tools.internal.jxc.gen.config;
import org.xml.sax.SAXException;
@@ -66,14 +65,14 @@ public class Schema extends NGCCHandler {
$localName = $__local;
$qname = $__qname;
switch($_ngcc_current_state) {
- case 2:
+ case 6:
{
- if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
+ if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
$runtime.consumeAttribute($ai);
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
}
else {
- $_ngcc_current_state = 1;
+ $_ngcc_current_state = 2;
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
}
}
@@ -94,14 +93,14 @@ public class Schema extends NGCCHandler {
revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
}
break;
- case 6:
+ case 2:
{
- if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+ if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
$runtime.consumeAttribute($ai);
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
}
else {
- $_ngcc_current_state = 2;
+ $_ngcc_current_state = 1;
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
}
}
@@ -120,6 +119,23 @@ public class Schema extends NGCCHandler {
$localName = $__local;
$qname = $__qname;
switch($_ngcc_current_state) {
+ case 6:
+ {
+ if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+ $runtime.consumeAttribute($ai);
+ $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+ }
+ else {
+ $_ngcc_current_state = 2;
+ $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+ }
+ }
+ break;
+ case 0:
+ {
+ revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+ }
+ break;
case 1:
{
if(($__uri == "" && $__local == "schema")) {
@@ -143,23 +159,6 @@ public class Schema extends NGCCHandler {
}
}
break;
- case 0:
- {
- revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
- }
- break;
- case 6:
- {
- if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
- $runtime.consumeAttribute($ai);
- $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
- }
- else {
- $_ngcc_current_state = 2;
- $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
- }
- }
- break;
default:
{
unexpectedLeaveElement($__qname);
@@ -173,13 +172,13 @@ public class Schema extends NGCCHandler {
$localName = $__local;
$qname = $__qname;
switch($_ngcc_current_state) {
- case 2:
+ case 6:
{
- if(($__uri == "" && $__local == "location")) {
- $_ngcc_current_state = 4;
+ if(($__uri == "" && $__local == "namespace")) {
+ $_ngcc_current_state = 8;
}
else {
- $_ngcc_current_state = 1;
+ $_ngcc_current_state = 2;
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
}
}
@@ -189,13 +188,13 @@ public class Schema extends NGCCHandler {
revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
}
break;
- case 6:
+ case 2:
{
- if(($__uri == "" && $__local == "namespace")) {
- $_ngcc_current_state = 8;
+ if(($__uri == "" && $__local == "location")) {
+ $_ngcc_current_state = 4;
}
else {
- $_ngcc_current_state = 2;
+ $_ngcc_current_state = 1;
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
}
}
@@ -213,6 +212,17 @@ public class Schema extends NGCCHandler {
$localName = $__local;
$qname = $__qname;
switch($_ngcc_current_state) {
+ case 6:
+ {
+ $_ngcc_current_state = 2;
+ $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+ }
+ break;
+ case 0:
+ {
+ revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+ }
+ break;
case 7:
{
if(($__uri == "" && $__local == "namespace")) {
@@ -223,12 +233,6 @@ public class Schema extends NGCCHandler {
}
}
break;
- case 2:
- {
- $_ngcc_current_state = 1;
- $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
- }
- break;
case 3:
{
if(($__uri == "" && $__local == "location")) {
@@ -239,14 +243,9 @@ public class Schema extends NGCCHandler {
}
}
break;
- case 0:
+ case 2:
{
- revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
- }
- break;
- case 6:
- {
- $_ngcc_current_state = 2;
+ $_ngcc_current_state = 1;
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
}
break;
@@ -261,11 +260,27 @@ public class Schema extends NGCCHandler {
public void text(String $value) throws SAXException {
int $ai;
switch($_ngcc_current_state) {
- case 4:
+ case 8:
{
- loc = $value;
- $_ngcc_current_state = 3;
- action0();
+ namespace = $value;
+ $_ngcc_current_state = 7;
+ }
+ break;
+ case 6:
+ {
+ if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+ $runtime.consumeAttribute($ai);
+ $runtime.sendText(super._cookie, $value);
+ }
+ else {
+ $_ngcc_current_state = 2;
+ $runtime.sendText(super._cookie, $value);
+ }
+ }
+ break;
+ case 0:
+ {
+ revertToParentFromText(this, super._cookie, $value);
}
break;
case 2:
@@ -280,27 +295,11 @@ public class Schema extends NGCCHandler {
}
}
break;
- case 8:
+ case 4:
{
- namespace = $value;
- $_ngcc_current_state = 7;
- }
- break;
- case 0:
- {
- revertToParentFromText(this, super._cookie, $value);
- }
- break;
- case 6:
- {
- if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
- $runtime.consumeAttribute($ai);
- $runtime.sendText(super._cookie, $value);
- }
- else {
- $_ngcc_current_state = 2;
- $runtime.sendText(super._cookie, $value);
- }
+ loc = $value;
+ $_ngcc_current_state = 3;
+ action0();
}
break;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng
index 697f3ac9c23..e3c593f25d0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng
@@ -1,4 +1,28 @@
+
-
-
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java
index 836f191f7ba..4eb70a1e304 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-
package com.sun.tools.internal.jxc.model.nav;
import java.util.ArrayList;
@@ -281,24 +280,21 @@ public class APTNavigator implements Navigator\n"+
- " -o : Specify the directory to place generated source files\n"+
- " -p : Specify the Java package to put the generated classes into\n"+
- " -c : The input schema is written in the RELAX NG compact syntax\n"+
- " -x : The input schema is written in the RELAX NG XML syntax\n"+
- " -xsd : The input schema is written in the XML SChema\n"+
- " -h : Generate code that allows method invocation chaining\n"
- );
- }
-
- public static int run(TxwOptions opts) {
- return new Main(opts).run();
- }
-
- private int run() {
- try {
- NodeSet ns = opts.source.build(opts);
- ns.write(opts);
- opts.codeModel.build(opts.codeWriter);
- return 0;
- } catch (IOException e) {
- opts.errorListener.error(new SAXParseException(e.getMessage(),null,e));
- return 1;
- } catch (IllegalSchemaException e) {
- opts.errorListener.error(new SAXParseException(e.getMessage(),null,e));
- return 1;
- } catch (SAXParseException e) {
- opts.errorListener.error(e);
- return 1;
- } catch (SAXException e) {
- opts.errorListener.error(new SAXParseException(e.getMessage(),null,e));
- return 1;
- }
- }
-
-
- /**
- * Gets the version number of TXW.
- */
- public static String getVersion() {
- try {
- Properties p = new Properties();
- p.load(Main.class.getResourceAsStream("version.properties"));
- return p.get("version").toString();
- } catch( Throwable _ ) {
- return "unknown";
- }
- }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/NameUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/NameUtil.java
deleted file mode 100644
index 99ac2db9ccd..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/NameUtil.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.codemodel.JJavaName;
-
-import java.util.ArrayList;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class NameUtil {
-
- protected static boolean isPunct(char c) {
- return (c == '-' || c == '.' || c == ':' || c == '_' || c == '\u00b7'
- || c == '\u0387' || c == '\u06dd' || c == '\u06de');
- }
-
- protected static boolean isDigit(char c) {
- return ((c >= '0' && c <= '9') || Character.isDigit(c));
- }
-
- protected static boolean isUpper(char c) {
- return ((c >= 'A' && c <= 'Z') || Character.isUpperCase(c));
- }
-
- protected static boolean isLower(char c) {
- return ((c >= 'a' && c <= 'z') || Character.isLowerCase(c));
- }
-
- protected static boolean isLetter(char c) {
- return ((c >= 'A' && c <= 'Z')
- || (c >= 'a' && c <= 'z')
- || Character.isLetter(c));
- }
-
- /**
- * Capitalizes the first character of the specified string,
- * and de-capitalize the rest of characters.
- */
- public static String capitalize(String s) {
- if (!isLower(s.charAt(0)))
- return s;
- StringBuffer sb = new StringBuffer(s.length());
- sb.append(Character.toUpperCase(s.charAt(0)));
- sb.append(s.substring(1).toLowerCase());
- return sb.toString();
- }
-
- // Precondition: s[start] is not punctuation
- protected static int nextBreak(String s, int start) {
- int n = s.length();
- for (int i = start; i < n; i++) {
- char c0 = s.charAt(i);
- if (i < n - 1) {
- char c1 = s.charAt(i + 1);
- if (isPunct(c1)) return i + 1;
- if (isDigit(c0) && !isDigit(c1)) return i + 1;
- if (!isDigit(c0) && isDigit(c1)) return i + 1;
- if (isLower(c0) && !isLower(c1)) return i + 1;
- if (isLetter(c0) && !isLetter(c1)) return i + 1;
- if (!isLetter(c0) && isLetter(c1)) return i + 1;
- if (i < n - 2) {
- char c2 = s.charAt(i + 2);
- if (isUpper(c0) && isUpper(c1) && isLower(c2))
- return i + 1;
- }
- }
- }
- return -1;
- }
-
-
- /**
- * Tokenizes a string into words and capitalizes the first
- * character of each word.
- *
- *
- * This method uses a change in character type as a splitter
- * of two words. For example, "abc100ghi" will be splitted into
- * {"Abc", "100","Ghi"}.
- */
- public static String[] toWordList(String s) {
- ArrayList ss = new ArrayList();
- int n = s.length();
- for (int i = 0; i < n;) {
-
- // Skip punctuation
- while (i < n) {
- if (!isPunct(s.charAt(i)))
- break;
- i++;
- }
- if (i >= n) break;
-
- // Find next break and collect word
- int b = nextBreak(s, i);
- String w = (b == -1) ? s.substring(i) : s.substring(i, b);
- ss.add(escape(capitalize(w)));
- if (b == -1) break;
- i = b;
- }
-
-// we can't guarantee a valid Java identifier anyway,
-// so there's not much point in rejecting things in this way.
-// if (ss.size() == 0)
-// throw new IllegalArgumentException("Zero-length identifier");
- return (String[])(ss.toArray(new String[0]));
- }
-
- protected static String toMixedCaseName(String[] ss, boolean startUpper) {
- StringBuffer sb = new StringBuffer();
- if(ss.length>0) {
- sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
- for (int i = 1; i < ss.length; i++)
- sb.append(ss[i]);
- }
- return sb.toString();
- }
-
- protected static String toMixedCaseVariableName(String[] ss,
- boolean startUpper,
- boolean cdrUpper) {
- if (cdrUpper)
- for (int i = 1; i < ss.length; i++)
- ss[i] = capitalize(ss[i]);
- StringBuffer sb = new StringBuffer();
- if( ss.length>0 ) {
- sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
- for (int i = 1; i < ss.length; i++)
- sb.append(ss[i]);
- }
- return sb.toString();
- }
-
-
- /**
- * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
- *
- * @return
- * Always return a string but there's no guarantee that
- * the generated code is a valid Java identifier.
- */
- public static String toConstantName(String s) {
- return toConstantName(toWordList(s));
- }
-
- /**
- * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
- *
- * @return
- * Always return a string but there's no guarantee that
- * the generated code is a valid Java identifier.
- */
- public static String toConstantName(String[] ss) {
- StringBuffer sb = new StringBuffer();
- if( ss.length>0 ) {
- sb.append(ss[0].toUpperCase());
- for (int i = 1; i < ss.length; i++) {
- sb.append('_');
- sb.append(ss[i].toUpperCase());
- }
- }
- return sb.toString();
- }
-
-
-
- /**
- * Escapes characters is the given string so that they can be
- * printed by only using US-ASCII characters.
- *
- * The escaped characters will be appended to the given
- * StringBuffer.
- *
- * @param sb
- * StringBuffer that receives escaped string.
- * @param s
- * String to be escaped. s.substring(start)
- * will be escaped and copied to the string buffer.
- */
- public static void escape(StringBuffer sb, String s, int start) {
- int n = s.length();
- for (int i = start; i < n; i++) {
- char c = s.charAt(i);
- if (Character.isJavaIdentifierPart(c))
- sb.append(c);
- else {
- sb.append("_");
- if (c <= '\u000f') sb.append("000");
- else if (c <= '\u00ff') sb.append("00");
- else if (c <= '\u0fff') sb.append("0");
- sb.append(Integer.toString(c, 16));
- }
- }
- }
-
- /**
- * Escapes characters that are unusable as Java identifiers
- * by replacing unsafe characters with safe characters.
- */
- private static String escape(String s) {
- int n = s.length();
- for (int i = 0; i < n; i++)
- if (!Character.isJavaIdentifierPart(s.charAt(i))) {
- StringBuffer sb = new StringBuffer(s.substring(0, i));
- escape(sb, s, i);
- return sb.toString();
- }
- return s;
- }
-
- /**
- * Escape any characters that would cause the single arg constructor
- * of java.net.URI to complain about illegal chars.
- *
- * @param s source string to be escaped
- */
- public static String escapeURI(String s) {
- StringBuffer sb = new StringBuffer();
- for( int i = 0; i < s.length(); i++ ) {
- char c = s.charAt(i);
- if(Character.isSpaceChar(c)) {
- sb.append("%20");
- } else {
- sb.append(c);
- }
- }
- return sb.toString();
- }
-
- /**
- * Calculate the parent URI path of the given URI path.
- *
- * @param uriPath the uriPath (as returned by java.net.URI#getPath()
- * @return the parent URI path of the given URI path
- */
- public static String getParentUriPath(String uriPath) {
- int idx = uriPath.lastIndexOf('/');
-
- if (uriPath.endsWith("/")) {
- uriPath = uriPath.substring(0,idx); // trim trailing slash
- idx = uriPath.lastIndexOf('/'); // move idx to parent context
- }
-
- return uriPath.substring(0, idx)+"/";
- }
-
- /**
- * Calculate the normalized form of the given uriPath.
- *
- * For example:
- * /a/b/c/ -> /a/b/c/
- * /a/b/c -> /a/b/
- * /a/ -> /a/
- * /a -> /
- *
- * @param uriPath path of a URI (as returned by java.net.URI#getPath()
- * @return the normalized uri path
- */
- public static String normalizeUriPath(String uriPath) {
- if (uriPath.endsWith("/"))
- return uriPath;
-
- // the uri path should always have at least a leading slash,
- // so no need to make sure that ( idx == -1 )
- int idx = uriPath.lastIndexOf('/');
- return uriPath.substring(0, idx+1);
- }
-
- /**
- * determine if two Strings are equal ignoring case allowing null values
- *
- * @param s string 1
- * @param t string 2
- * @return true iff the given strings are equal ignoring case, false if they aren't
- * equal or either of them are null.
- */
- public static boolean equalsIgnoreCase(String s, String t) {
- if (s == t) return true;
- if ((s != null) && (t != null)) {
- return s.equalsIgnoreCase(t);
- }
- return false;
- }
-
- /**
- * determine if two Strings are iqual allowing null values
- *
- * @param s string 1
- * @param t string 2
- * @return true iff the strings are equal, false if they aren't equal or either of
- * them are null.
- */
- public static boolean equal(String s, String t) {
- if (s == t) return true;
- if ((s != null) && (t != null)) {
- return s.equals(t);
- }
- return false;
- }
-
- public static String toClassName(String s) {
- return toMixedCaseName(toWordList(s), true);
- }
- public static String toVariableName(String s) {
- return toMixedCaseName(toWordList(s), false);
- }
- public static String toMethodName(String s) {
- String m = toMixedCaseName(toWordList(s), false);
- if(JJavaName.isJavaIdentifier(m))
- return m;
- else
- return '_'+m;
- }
- public static String toInterfaceName( String token ) {
- return toClassName(token);
- }
- public static String toPropertyName(String s) {
- return toClassName(s);
- }
- public static String toPackageName( String s ) {
- return toMixedCaseName(toWordList(s), false );
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/RELAXNGLoader.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/RELAXNGLoader.java
deleted file mode 100644
index 854bfb25133..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/RELAXNGLoader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import org.kohsuke.rngom.parse.Parseable;
-import org.kohsuke.rngom.parse.IllegalSchemaException;
-import org.kohsuke.rngom.ast.util.CheckingSchemaBuilder;
-import org.kohsuke.rngom.dt.CascadingDatatypeLibraryFactory;
-import org.kohsuke.rngom.dt.builtin.BuiltinDatatypeLibraryFactory;
-import org.relaxng.datatype.helpers.DatatypeLibraryLoader;
-import com.sun.tools.internal.txw2.model.NodeSet;
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.builder.relaxng.SchemaBuilderImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-class RELAXNGLoader implements SchemaBuilder {
- private final Parseable parseable;
-
- public RELAXNGLoader(Parseable parseable) {
- this.parseable = parseable;
- }
-
- public NodeSet build(TxwOptions options) throws IllegalSchemaException {
- SchemaBuilderImpl stage1 = new SchemaBuilderImpl(options.codeModel);
- Leaf pattern = (Leaf)parseable.parse(new CheckingSchemaBuilder(stage1,options.errorListener,
- new CascadingDatatypeLibraryFactory(
- new BuiltinDatatypeLibraryFactory(new DatatypeLibraryLoader()),
- new DatatypeLibraryLoader())));
-
- return new NodeSet(options,pattern);
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwTask.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwTask.java
deleted file mode 100644
index e8f8d5ab5d5..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwTask.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.codemodel.writer.FileCodeWriter;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.kohsuke.rngom.parse.compact.CompactParseable;
-import org.kohsuke.rngom.parse.xml.SAXParseable;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-/**
- * Ant task interface for txw compiler.
- *
- * @author ryan_shoemaker@dev.java.net
- */
-public class TxwTask extends org.apache.tools.ant.Task {
-
- // txw options - reuse command line options from the main driver
- private final TxwOptions options = new TxwOptions();
-
- // schema file
- private File schemaFile;
-
- // syntax style of RELAX NG source schema - "xml" or "compact"
- private static enum Style {
- COMPACT, XML, XMLSCHEMA, AUTO_DETECT
- }
- private Style style = Style.AUTO_DETECT;
-
- public TxwTask() {
- // default package
- options._package = options.codeModel.rootPackage();
-
- // default codewriter
- try {
- options.codeWriter = new FileCodeWriter(new File("."));
- } catch (IOException e) {
- throw new BuildException(e);
- }
- }
-
- /**
- * Parse @package
- *
- * @param pkg name of the package to generate the java classes into
- */
- public void setPackage( String pkg ) {
- options._package = options.codeModel._package( pkg );
- }
-
- /**
- * Parse @syntax
- *
- * @param style either "compact" for RELAX NG compact syntax or "XML"
- * for RELAX NG xml syntax
- */
- public void setSyntax( String style ) {
- this.style = Style.valueOf(style.toUpperCase());
- }
-
- /**
- * parse @schema
- *
- * @param schema the schema file to be processed by txw
- */
- public void setSchema( File schema ) {
- schemaFile = schema;
- }
-
- /**
- * parse @destdir
- *
- * @param dir the directory to produce generated source code in
- */
- public void setDestdir( File dir ) {
- try {
- options.codeWriter = new FileCodeWriter(dir);
- } catch (IOException e) {
- throw new BuildException(e);
- }
- }
-
- /**
- * parse @methodChaining
- *
- * @param flg true if the txw should generate api's that allow
- * method chaining (when possible, false otherwise
- */
- public void setMethodChaining( boolean flg ) {
- options.chainMethod = flg;
- }
-
- /**
- * launch txw
- */
- public void execute() throws BuildException {
- options.errorListener = new AntErrorListener(getProject());
-
- try {
- InputSource in = new InputSource(schemaFile.toURL().toExternalForm());
-
- String msg = "Compiling: " + in.getSystemId();
- log( msg, Project.MSG_INFO );
-
- if(style==Style.AUTO_DETECT) {
- String fileName = schemaFile.getPath().toLowerCase();
- if(fileName.endsWith("rnc"))
- style = Style.COMPACT;
- else
- if(fileName.endsWith("xsd"))
- style = Style.XMLSCHEMA;
- else
- style = Style.XML;
- }
-
- switch(style) {
- case COMPACT:
- options.source = new RELAXNGLoader(new CompactParseable(in,options.errorListener));
- break;
- case XML:
- options.source = new RELAXNGLoader(new SAXParseable(in,options.errorListener));
- break;
- case XMLSCHEMA:
- options.source = new XmlSchemaLoader(in);
- break;
- }
- } catch (MalformedURLException e) {
- throw new BuildException(e);
- }
-
- // kick off the compiler
- Main.run(options);
- log( "Compilation complete.", Project.MSG_INFO );
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DataPatternBuilderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DataPatternBuilderImpl.java
deleted file mode 100644
index 0c219e6ce2c..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DataPatternBuilderImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.tools.internal.txw2.model.Leaf;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.DataPatternBuilder;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-import org.kohsuke.rngom.parse.Context;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-final class DataPatternBuilderImpl implements DataPatternBuilder {
- final JType type;
-
- public DataPatternBuilderImpl(JType type) {
- this.type = type;
- }
-
- public Leaf makePattern(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return new Data(locator,type);
- }
-
- public void addParam(String name, String value, Context context, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- }
-
- public void annotation(ParsedElementAnnotation parsedElementAnnotation) {
- }
-
- public Leaf makePattern(Leaf except, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return makePattern(locator,annotations);
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DatatypeFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DatatypeFactory.java
deleted file mode 100644
index 37dd621dad8..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DatatypeFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.codemodel.JType;
-import com.sun.codemodel.JCodeModel;
-
-import javax.xml.namespace.QName;
-
-/**
- * Builds {@link Data} from a XML Schema datatype.
- * @author Kohsuke Kawaguchi
- */
-public class DatatypeFactory {
- private final JCodeModel codeModel;
-
- public DatatypeFactory(JCodeModel codeModel) {
- this.codeModel = codeModel;
- }
-
- /**
- * Decides the Java datatype from XML datatype.
- *
- * @return null
- * if none is found.
- */
- public JType getType(String datatypeLibrary, String type) {
- if(datatypeLibrary.equals("http://www.w3.org/2001/XMLSchema-datatypes")
- || datatypeLibrary.equals("http://www.w3.org/2001/XMLSchema")) {
- type = type.intern();
-
- if(type=="boolean")
- return codeModel.BOOLEAN;
- if(type=="int" || type=="nonNegativeInteger" || type=="positiveInteger")
- return codeModel.INT;
- if(type=="QName")
- return codeModel.ref(QName.class);
- if(type=="float")
- return codeModel.FLOAT;
- if(type=="double")
- return codeModel.DOUBLE;
- if(type=="anySimpleType" || type=="anyType")
- return codeModel.ref(String.class);
- }
-
- return null;
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarImpl.java
deleted file mode 100644
index cc49844f001..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.model.Ref;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.Grammar;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-class GrammarImpl extends GrammarSectionImpl
- implements Grammar {
-
- GrammarImpl(Scope scope) {
- super(scope,new com.sun.tools.internal.txw2.model.Grammar());
- }
-
- public Leaf endGrammar(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return new Ref(locator,grammar,com.sun.tools.internal.txw2.model.Grammar.START);
- }
-
- public Leaf makeParentRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return parent.makeRef(name,locator,annotations);
- }
-
- public Leaf makeRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return new Ref(locator,grammar,name);
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarSectionImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarSectionImpl.java
deleted file mode 100644
index 635074998d6..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarSectionImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Define;
-import com.sun.tools.internal.txw2.model.Grammar;
-import com.sun.tools.internal.txw2.model.Leaf;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.Div;
-import org.kohsuke.rngom.ast.builder.GrammarSection;
-import org.kohsuke.rngom.ast.builder.Include;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-abstract class GrammarSectionImpl implements GrammarSection {
-
- protected final Scope parent;
-
- protected final Grammar grammar;
-
- GrammarSectionImpl(
- Scope scope,
- Grammar grammar ) {
- this.parent = scope;
- this.grammar = grammar;
- }
-
- public void topLevelAnnotation(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
- }
-
- public void topLevelComment(CommentListImpl commentList) throws BuildException {
- }
-
- public Div makeDiv() {
- return new DivImpl(parent,grammar);
- }
-
- public Include makeInclude() {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- public void define(String name, Combine combine, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- Define def = grammar.get(name);
- def.location = locator;
-
- if(combine==null || def.leaf==null) {
- def.leaf = leaf;
- } else {
- def.leaf.merge(leaf);
- }
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/SchemaBuilderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/SchemaBuilderImpl.java
deleted file mode 100644
index 921676d8765..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/SchemaBuilderImpl.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.codemodel.JClass;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.Attribute;
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.tools.internal.txw2.model.Element;
-import com.sun.tools.internal.txw2.model.Empty;
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.model.List;
-import com.sun.tools.internal.txw2.model.Value;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.DataPatternBuilder;
-import org.kohsuke.rngom.ast.builder.ElementAnnotationBuilder;
-import org.kohsuke.rngom.ast.builder.Grammar;
-import org.kohsuke.rngom.ast.builder.NameClassBuilder;
-import org.kohsuke.rngom.ast.builder.SchemaBuilder;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-import org.kohsuke.rngom.nc.NameClass;
-import org.kohsuke.rngom.nc.NameClassBuilderImpl;
-import org.kohsuke.rngom.parse.Context;
-import org.kohsuke.rngom.parse.IllegalSchemaException;
-import org.kohsuke.rngom.parse.Parseable;
-
-import javax.xml.namespace.QName;
-
-/**
- * Builds a model from a RELAX NG grammar.
- *
- * @author Kohsuke Kawaguchi
- */
-public final class SchemaBuilderImpl implements SchemaBuilder {
- private final NameClassBuilderImpl ncb = new NameClassBuilderImpl();
- private final JClass string;
- private final DatatypeFactory dtf;
-
- public SchemaBuilderImpl(JCodeModel codeModel) {
- string = codeModel.ref(String.class);
- dtf = new DatatypeFactory(codeModel);
- }
-
-
- public Leaf expandPattern(Leaf leaf) throws BuildException {
- return leaf;
- }
-
-
-
- public NameClassBuilder getNameClassBuilder() throws BuildException {
- return ncb;
- }
-
- private Leaf merge(java.util.List leaves) {
- for( int i=1; i leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return merge(leaves);
- }
-
- public Leaf makeInterleave(java.util.List leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return merge(leaves);
- }
-
- public Leaf makeGroup(java.util.List leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return merge(leaves);
- }
-
- public Leaf makeOneOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return leaf;
- }
-
- public Leaf makeZeroOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return leaf.merge(new Empty(locator));
- }
-
- public Leaf makeOptional(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return leaf.merge(new Empty(locator));
- }
-
- public Leaf makeList(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return new List(locator,leaf);
- }
-
- public Leaf makeMixed(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return leaf.merge(new Data(locator,string));
- }
-
- public Leaf makeEmpty(LocatorImpl locator, AnnotationsImpl annotations) {
- return new Empty(locator);
- }
-
- public Leaf makeNotAllowed(LocatorImpl locator, AnnotationsImpl annotations) {
- // technically this is incorrect, but we won't be
- // able to handle correctly anyway.
- return new Empty(locator);
- }
-
- public Leaf makeText(LocatorImpl locator, AnnotationsImpl annotations) {
- return new Data(locator,string);
- }
-
- public Leaf makeAttribute(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- Leaf r = null;
- for( QName n : nameClass.listNames() ) {
- Leaf l = new Attribute(locator,n,leaf);
- if(r!=null) r = r.merge(l);
- else r = l;
- }
- if(r==null) return new Empty(locator);
- return r;
- }
-
- public Leaf makeElement(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- Leaf r = null;
- for( QName n : nameClass.listNames() ) {
- Leaf l = new Element(locator,n,leaf);
- if(r!=null) r = r.merge(l);
- else r = l;
- }
- if(r==null) return new Empty(locator);
- return r;
- }
-
- public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl locator) throws BuildException {
- return new DataPatternBuilderImpl(getType(datatypeLibrary, type));
- }
-
- private JType getType(String datatypeLibrary, String type) {
- JType t = dtf.getType(datatypeLibrary,type);
- if(t==null) t = string;
- return t;
- }
-
- public Leaf makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
- return new Value(locator,getType(datatypeLibrary, type),value);
- }
-
- public Grammar makeGrammar(Scope scope) {
- return new GrammarImpl(scope);
- }
-
- public Leaf annotate(Leaf leaf, AnnotationsImpl annotations) throws BuildException {
- return leaf;
- }
-
- public Leaf annotateAfter(Leaf leaf, ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
- return leaf;
- }
-
- public Leaf makeErrorPattern() {
- return new Empty(null);
- }
-
- public boolean usesComments() {
- return false;
- }
-
- public Leaf makeExternalRef(Parseable current, String uri, String ns, Scope scope, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException, IllegalSchemaException {
- // I'm not too sure if this is correct
- return current.parseExternal(uri, this, scope, ns );
- }
-
- public LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber) {
- return new LocatorImpl(systemId,lineNumber,columnNumber);
- }
-
- public AnnotationsImpl makeAnnotations(CommentListImpl commentList, Context context) {
- return new AnnotationsImpl();
- }
-
- public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl locator, CommentListImpl commentList, Context context) {
- return new ElementAnnotationBuilderImpl();
- }
-
- public CommentListImpl makeCommentList() {
- return null;
- }
-
- public Leaf commentAfter(Leaf leaf, CommentListImpl commentList) throws BuildException {
- return leaf;
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/package.html b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/package.html
deleted file mode 100644
index 587ef120494..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Reads RELAX NG grammar from RNGOM and builds the model for TXW.
-
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/XmlSchemaBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/XmlSchemaBuilder.java
deleted file mode 100644
index 804a2154757..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/XmlSchemaBuilder.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.xsd;
-
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.TxwOptions;
-import com.sun.tools.internal.txw2.builder.relaxng.DatatypeFactory;
-import com.sun.tools.internal.txw2.model.Attribute;
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.tools.internal.txw2.model.Define;
-import com.sun.tools.internal.txw2.model.Empty;
-import com.sun.tools.internal.txw2.model.Grammar;
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.model.List;
-import com.sun.tools.internal.txw2.model.NodeSet;
-import com.sun.tools.internal.txw2.model.Element;
-import com.sun.tools.internal.txw2.model.Ref;
-import com.sun.xml.xsom.XSAnnotation;
-import com.sun.xml.xsom.XSAttributeDecl;
-import com.sun.xml.xsom.XSAttributeUse;
-import com.sun.xml.xsom.XSComplexType;
-import com.sun.xml.xsom.XSContentType;
-import com.sun.xml.xsom.XSDeclaration;
-import com.sun.xml.xsom.XSFacet;
-import com.sun.xml.xsom.XSIdentityConstraint;
-import com.sun.xml.xsom.XSListSimpleType;
-import com.sun.xml.xsom.XSNotation;
-import com.sun.xml.xsom.XSParticle;
-import com.sun.xml.xsom.XSRestrictionSimpleType;
-import com.sun.xml.xsom.XSSchema;
-import com.sun.xml.xsom.XSSchemaSet;
-import com.sun.xml.xsom.XSSimpleType;
-import com.sun.xml.xsom.XSUnionSimpleType;
-import com.sun.xml.xsom.XSXPath;
-import com.sun.xml.xsom.XSWildcard;
-import com.sun.xml.xsom.XSModelGroupDecl;
-import com.sun.xml.xsom.XSModelGroup;
-import com.sun.xml.xsom.XSElementDecl;
-import com.sun.xml.xsom.XSType;
-import com.sun.xml.xsom.XSAttContainer;
-import com.sun.xml.xsom.XSAttGroupDecl;
-import com.sun.xml.xsom.visitor.XSFunction;
-import com.sun.xml.xsom.visitor.XSSimpleTypeFunction;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public final class XmlSchemaBuilder implements XSFunction, XSSimpleTypeFunction {
- public static NodeSet build( XSSchemaSet xs, TxwOptions opts ) {
- XmlSchemaBuilder builder = new XmlSchemaBuilder(xs,opts);
- builder.build(xs);
- return builder.nodeSet;
- }
-
- private void build(XSSchemaSet xs) {
- // make sure that we bind all complex types
- for( XSSchema s : xs.getSchemas() ) {
- for( XSComplexType t : s.getComplexTypes().values() ) {
- t.apply(this);
- }
- }
-
- nodeSet.addAll(complexTypes.values());
- nodeSet.addAll(modelGroups.values());
- nodeSet.addAll(attGroups.values());
- }
-
- public Leaf simpleType(XSSimpleType simpleType) {
- return simpleType.apply((XSSimpleTypeFunction)this);
- }
-
- public Leaf particle(XSParticle particle) {
- return particle.getTerm().apply(this);
- }
-
- public Leaf empty(XSContentType empty) {
- return new Empty(empty.getLocator());
- }
-
- public Attribute attributeDecl(XSAttributeDecl decl) {
- return new Attribute(decl.getLocator(),
- getQName(decl),
- simpleType(decl.getType()));
- }
-
- public Attribute attributeUse(XSAttributeUse use) {
- return attributeDecl(use.getDecl());
- }
-
- public Leaf wildcard(XSWildcard wc) {
- // wildcard can be always written through the well-formedness method.
- // no need to generate anything for this.
- return new Empty(wc.getLocator());
- }
-
- public Leaf modelGroupDecl(XSModelGroupDecl mg) {
- Define def = modelGroups.get(mg);
- if(def==null) {
- def = grammar.get(mg.getName()); // TODO: name collision detection and avoidance
- modelGroups.put(mg,def);
-
- def.addChild(mg.getModelGroup().apply(this));
- }
- return new Ref(mg.getLocator(),def);
- }
-
- public Leaf modelGroup(XSModelGroup mg) {
- XSParticle[] children = mg.getChildren();
- if(children.length==0) return new Empty(mg.getLocator());
-
- Leaf l = particle(children[0]);
- for( int i=1; i modelGroups = new HashMap();
-
- /**
- * We map complex types to interfaces.
- */
- private final Map complexTypes = new HashMap();
-
- /**
- * ... and attribute groups
- */
- private final Map attGroups = new HashMap();
-
- private final Grammar grammar = new Grammar();
-
- private XmlSchemaBuilder(XSSchemaSet xs,TxwOptions opts) {
- this.schemaSet = xs;
- grammar.addChild(new Empty(null));
- this.nodeSet = new NodeSet(opts,grammar);
- this.dtf = new DatatypeFactory(opts.codeModel);
- }
-
-
-
-// won't be used
- public Leaf annotation(XSAnnotation xsAnnotation) {
- throw new IllegalStateException();
- }
-
- public Leaf schema(XSSchema xsSchema) {
- throw new IllegalStateException();
- }
-
- public Leaf facet(XSFacet xsFacet) {
- throw new IllegalStateException();
- }
-
- public Leaf notation(XSNotation xsNotation) {
- throw new IllegalStateException();
- }
-
- public Leaf identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
- throw new IllegalStateException();
- }
-
- public Leaf xpath(XSXPath xsxPath) {
- throw new IllegalStateException();
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/package.html b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/package.html
deleted file mode 100644
index 1b90dc339cf..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Reads XML Schema grammar from XSOM and builds the model for TXW.
-
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Attribute.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Attribute.java
deleted file mode 100644
index 8b901d1f10b..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Attribute.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JAnnotationUse;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.NameUtil;
-import com.sun.tools.internal.txw2.model.prop.AttributeProp;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.xml.internal.txw2.annotation.XmlAttribute;
-import org.xml.sax.Locator;
-
-import javax.xml.namespace.QName;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Attribute declaration.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Attribute extends XmlNode {
- public Attribute(Locator location, QName name, Leaf leaf) {
- super(location, name, leaf);
- }
-
- void declare(NodeSet nset) {
- ; // attributes won't produce a class
- }
-
- void generate(NodeSet nset) {
- ; // nothing
- }
-
- void generate(JDefinedClass clazz, NodeSet nset, Set props) {
- Set types = new HashSet();
-
- for( Leaf l : collectChildren() ) {
- if (l instanceof Text) {
- types.add(((Text)l).getDatatype(nset));
- }
- }
-
- String methodName = NameUtil.toMethodName(name.getLocalPart());
-
- for( JType t : types ) {
- if(!props.add(new AttributeProp(name,t)))
- continue;
-
- JMethod m = clazz.method(JMod.PUBLIC,
- nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID,
- methodName);
- m.param(t,"value");
-
- JAnnotationUse a = m.annotate(XmlAttribute.class);
- if(!methodName.equals(name.getLocalPart()))
- a.param("value",name.getLocalPart());
- if(!name.getNamespaceURI().equals(""))
- a.param("ns",name.getNamespaceURI());
-
- }
- }
-
- public String toString() {
- return "Attribute "+name;
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Define.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Define.java
deleted file mode 100644
index c25127fb126..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Define.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.xml.internal.txw2.TypedXmlWriter;
-
-import java.util.HashSet;
-import java.util.Set;
-
-
-/**
- * A named pattern.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Define extends WriterNode {
- public final Grammar scope;
- public final String name;
-
- JDefinedClass clazz;
-
- public Define(Grammar scope, String name) {
- super(null,null);
- if(scope==null) scope = (Grammar)this; // hack for start pattern
- this.scope = scope;
- this.name = name;
- assert name!=null;
- }
-
- /**
- * Returns true if this define only contains
- * one child (and thus considered inlinable.)
- *
- * A pattern definition is also inlineable if
- * it's the start of the grammar (because "start" isn't a meaningful name)
- */
- public boolean isInline() {
- return hasOneChild() || name==Grammar.START;
- }
-
- void declare(NodeSet nset) {
- if(isInline()) return;
-
- clazz = nset.createClass(name);
- clazz._implements(TypedXmlWriter.class);
- }
-
- void generate(NodeSet nset) {
- if(clazz==null) return;
-
- HashSet props = new HashSet();
- for( Leaf l : this )
- l.generate(clazz,nset,props);
- }
-
- void generate(JDefinedClass clazz, NodeSet nset, Set props) {
- if(isInline()) {
- for( Leaf l : this )
- l.generate(clazz,nset, props);
- } else {
- assert this.clazz!=null;
- clazz._implements(this.clazz);
- }
- }
-
- void prepare(NodeSet nset) {
- if(isInline() && leaf instanceof WriterNode && !name.equals(Grammar.START))
- ((WriterNode)leaf).alternativeName = name;
- }
-
- public String toString() {
- return "Define "+name;
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Element.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Element.java
deleted file mode 100644
index 8dad70f6c3b..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Element.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JAnnotationUse;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.NameUtil;
-import com.sun.tools.internal.txw2.model.prop.ElementProp;
-import com.sun.tools.internal.txw2.model.prop.LeafElementProp;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.xml.internal.txw2.TypedXmlWriter;
-import com.sun.xml.internal.txw2.annotation.XmlElement;
-import org.xml.sax.Locator;
-
-import javax.xml.namespace.QName;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Element declaration.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Element extends XmlNode {
- /**
- * True if this element can be a root element.
- */
- public boolean isRoot;
-
- private Strategy strategy;
-
- public Element(Locator location, QName name, Leaf leaf) {
- super(location, name, leaf);
- }
-
- /**
- * Returns true if this element should generate an interface.
- */
- private Strategy decideStrategy() {
- if(isRoot)
- return new ToInterface();
-
- if(hasOneChild() && leaf instanceof Ref && !((Ref)leaf).isInline())
- return new HasOneRef((Ref)leaf);
-
- Set children = collectChildren();
- for( Leaf l : children ) {
- if( l instanceof XmlNode )
- // if it has attributes/elements in children
- // generate an interface
- return new ToInterface();
- }
-
- // otherwise this element only has data, so just generate methods for them.
- return new DataOnly();
- }
-
- void declare(NodeSet nset) {
- strategy = decideStrategy();
- strategy.declare(nset);
- }
-
- void generate(NodeSet nset) {
- strategy.generate(nset);
- }
-
- void generate(JDefinedClass clazz, NodeSet nset, Set props) {
- strategy.generate(clazz,nset,props);
- }
-
-
- private JMethod generateMethod(JDefinedClass clazz, NodeSet nset, JType retT) {
- String methodName = NameUtil.toMethodName(name.getLocalPart());
-
- JMethod m = clazz.method(JMod.PUBLIC, retT, methodName);
-
- JAnnotationUse a = m.annotate(XmlElement.class);
- if(!methodName.equals(name.getLocalPart()))
- a.param("value",name.getLocalPart());
- if(nset.defaultNamespace==null || !nset.defaultNamespace.equals(name.getNamespaceURI()))
- a.param("ns",name.getNamespaceURI());
-
- return m;
- }
-
- public String toString() {
- return "Element "+name;
- }
-
-
- interface Strategy {
- void declare(NodeSet nset);
- void generate(NodeSet nset);
- void generate(JDefinedClass clazz, NodeSet nset, Set props);
- }
-
- /**
- * Maps to an interface
- */
- private class ToInterface implements Strategy {
- private JDefinedClass clazz;
-
- public void declare(NodeSet nset) {
- String cname;
- if(alternativeName!=null)
- cname = alternativeName;
- else
- cname = name.getLocalPart();
- clazz = nset.createClass(cname);
- clazz._implements(TypedXmlWriter.class);
-
- clazz.annotate(XmlElement.class)
- .param("value",name.getLocalPart());
- // TODO: namespace
- }
-
- public void generate(NodeSet nset) {
- HashSet props = new HashSet();
- for( Leaf l : Element.this )
- l.generate(clazz,nset, props);
- }
-
- public void generate(JDefinedClass outer, NodeSet nset, Set props) {
- if(props.add(new ElementProp(name,clazz)))
- generateMethod(outer, nset, clazz);
- }
- }
-
- /**
- * For things like "element foo {refToAnotherPattern}"
- */
- private class HasOneRef implements Strategy {
- private final Ref ref;
-
- public HasOneRef(Ref ref) {
- this.ref = ref;
- }
-
- public void declare(NodeSet nset) {
- }
- public void generate(NodeSet nset) {
- }
-
- public void generate(JDefinedClass clazz, NodeSet nset, Set props) {
- if(props.add(new ElementProp(name,ref.def.clazz)))
- generateMethod(clazz, nset, ref.def.clazz);
- }
- }
-
- private class DataOnly implements Strategy {
- public void declare(NodeSet nset) {
- }
- public void generate(NodeSet nset) {
- }
-
- // TODO: code share with Attribute
- public void generate(JDefinedClass clazz, NodeSet nset, Set props) {
- Set types = new HashSet();
-
- for( Leaf l : collectChildren() ) {
- if (l instanceof Text) {
- types.add(((Text)l).getDatatype(nset));
- }
- }
-
- for( JType t : types ) {
- if(!props.add(new LeafElementProp(name,t)))
- continue;
- generateMethod(clazz,
- nset, nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID
- ).param(t,"value");
- }
- }
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Leaf.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Leaf.java
deleted file mode 100644
index 5fccf0c04c0..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Leaf.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.tools.internal.txw2.model.prop.ValueProp;
-import com.sun.xml.internal.txw2.annotation.XmlValue;
-import org.kohsuke.rngom.ast.om.ParsedPattern;
-import org.xml.sax.Locator;
-
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * {@link Leaf}s form a set (by a cyclic doubly-linked list.)
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class Leaf implements ParsedPattern {
- private Leaf next;
- private Leaf prev;
-
- /**
- * Source location where this leaf was defined.
- */
- public Locator location;
-
- protected Leaf(Locator location) {
- this.location = location;
- prev = next = this;
- }
-
- public final Leaf getNext() {
- assert next!=null;
- assert next.prev == this;
- return next;
- }
-
- public final Leaf getPrev() {
- assert prev!=null;
- assert prev.next == this;
- return prev;
- }
-
- /**
- * Combines two sets into one set.
- *
- * @return this
- */
- public final Leaf merge(Leaf that) {
- Leaf n1 = this.next;
- Leaf n2 = that.next;
-
- that.next = n1;
- that.next.prev = that;
- this.next = n2;
- this.next.prev = this;
-
- return this;
- }
-
- /**
- * Returns the collection of all the siblings
- * (including itself)
- */
- public final Iterable siblings() {
- return new Iterable() {
- public Iterator iterator() {
- return new CycleIterator(Leaf.this);
- }
- };
- }
-
- /**
- * Populate the body of the writer class.
- *
- * @param props
- * captures the generatesd {@link Prop}s to
- */
- abstract void generate(JDefinedClass clazz, NodeSet nset, Set props);
-
-
-
-
- /**
- * Creates a prop of the data value method.
- */
- protected final void createDataMethod(JDefinedClass clazz, JType valueType, NodeSet nset, Set props) {
- if(!props.add(new ValueProp(valueType)))
- return;
-
- JMethod m = clazz.method(JMod.PUBLIC,
- nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID,
- "_text");
- m.annotate(XmlValue.class);
- m.param(valueType,"value");
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/NodeSet.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/NodeSet.java
deleted file mode 100644
index 64c3839271e..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/NodeSet.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.ClassType;
-import com.sun.codemodel.JClassAlreadyExistsException;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMod;
-import com.sun.tools.internal.txw2.NameUtil;
-import com.sun.tools.internal.txw2.TxwOptions;
-import com.sun.xml.internal.txw2.annotation.XmlNamespace;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * Root of the model.
- *
- * @author Kohsuke Kawaguchi
- */
-public class NodeSet extends LinkedHashSet {
-
- /*package*/ final TxwOptions opts;
- /*package*/ final JCodeModel codeModel;
-
- /**
- * Set of all the {@link Element}s that can be root.
- */
- private final Set rootElements = new HashSet();
-
- /** The namespace URI declared in {@link XmlNamespace}. */
- /*package*/ final String defaultNamespace;
-
- public NodeSet(TxwOptions opts, Leaf entry) {
- this.opts = opts;
- this.codeModel = opts.codeModel;
- addAll(entry.siblings());
- markRoot(entry.siblings(),rootElements);
-
- // decide what to put in @XmlNamespace
- Set ns = new HashSet();
- for( Element e : rootElements )
- ns.add(e.name.getNamespaceURI());
-
- if(ns.size()!=1 || opts.noPackageNamespace || opts._package.isUnnamed())
- defaultNamespace = null;
- else {
- defaultNamespace = ns.iterator().next();
-
- opts._package.annotate(XmlNamespace.class)
- .param("value",defaultNamespace);
- }
- }
-
- /**
- * Marks all the element children as root.
- */
- private void markRoot(Iterable c, Set rootElements) {
- for( Leaf l : c ) {
- if( l instanceof Element ) {
- Element e = (Element)l;
- rootElements.add(e);
- e.isRoot = true;
- }
- if( l instanceof Ref ) {
- markRoot(((Ref)l).def,rootElements);
- }
- }
- }
-
- private void addAll(Iterable c) {
- for( Leaf l : c ) {
- if(l instanceof Element)
- if(add((Element)l))
- addAll((Element)l);
- if(l instanceof Grammar) {
- Grammar g = (Grammar)l;
- for( Define d : g.getDefinitions() )
- add(d);
- }
- if(l instanceof Ref) {
- Ref r = (Ref)l;
- Define def = r.def;
-// if(def instanceof Grammar) {
-// for( Define d : ((Grammar)def).getDefinitions() )
-// if(add(d))
-// addAll(d);
-// }
- add(def);
- }
- }
- }
-
- private boolean add(Define def) {
- boolean b = super.add(def);
- if(b)
- addAll(def);
- return b;
- }
-
- public Collection subset(Class t) {
- ArrayList r = new ArrayList(size());
- for( WriterNode n : this )
- if(t.isInstance(n))
- r.add((T)n);
- return r;
- }
-
- /**
- * Generate code
- */
- public void write(TxwOptions opts) {
- for( WriterNode n : this )
- n.prepare(this);
- for( WriterNode n : this )
- n.declare(this);
- for( WriterNode n : this )
- n.generate(this);
- }
-
- /*package*/ final JDefinedClass createClass(String name) {
- try {
- return opts._package._class(
- JMod.PUBLIC, NameUtil.toClassName(name), ClassType.INTERFACE );
- } catch (JClassAlreadyExistsException e) {
- for( int i=2; true; i++ ) {
- try {
- return opts._package._class(
- JMod.PUBLIC, NameUtil.toClassName(name+String.valueOf(i)), ClassType.INTERFACE );
- } catch (JClassAlreadyExistsException e1) {
- ; // continue
- }
- }
- }
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java
index d2edca837e5..6f53444edb1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,25 @@
package com.sun.tools.internal.ws;
-import com.sun.tools.internal.xjc.api.util.APTClassLoader;
+import com.sun.istack.internal.tools.MaskingClassLoader;
+import com.sun.istack.internal.tools.ParallelWorldClassLoader;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
import com.sun.tools.internal.xjc.api.util.ToolsJarNotFoundException;
+import com.sun.xml.internal.bind.util.Which;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
+import java.io.File;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
/**
* Invokes JAX-WS tools in a special class loader that can pick up APT classes,
@@ -39,40 +51,173 @@ import java.lang.reflect.Method;
*
* @author Kohsuke Kawaguchi
*/
-final class Invoker {
- /**
- * List of packages that need to be loaded in {@link APTClassLoader}.
- */
- private static final String[] prefixes = {
- "com.sun.tools.internal.jxc.",
- "com.sun.tools.internal.xjc.",
- "com.sun.tools.apt.",
- "com.sun.tools.internal.ws.",
- "com.sun.tools.javac.",
- "com.sun.tools.javadoc.",
- "com.sun.mirror."
- };
+public final class Invoker {
+ static int invoke(String mainClass, String[] args) throws Throwable {
+ // use the platform default proxy if available.
+ // see sun.net.spi.DefaultProxySelector for details.
+ try {
+ System.setProperty("java.net.useSystemProxies","true");
+ } catch (SecurityException e) {
+ // failing to set this property isn't fatal
+ }
- static void main(String toolName, String[] args) throws Throwable {
ClassLoader oldcc = Thread.currentThread().getContextClassLoader();
try {
- APTClassLoader cl = new APTClassLoader(Invoker.class.getClassLoader(),prefixes);
+ ClassLoader cl = Invoker.class.getClassLoader();
+ if(Arrays.asList(args).contains("-Xendorsed"))
+ cl = createClassLoader(cl); // perform JDK6 workaround hack
+ else {
+ if(!checkIfLoading21API()) {
+ if(Service.class.getClassLoader()==null)
+ System.err.println(WscompileMessages.INVOKER_NEED_ENDORSED());
+ else
+ System.err.println(WscompileMessages.WRAPPER_TASK_LOADING_20_API(Which.which(Service.class)));
+ return -1;
+ }
+ //find and load tools.jar
+ List urls = new ArrayList();
+ findToolsJar(cl, urls);
+
+ if(urls.size() > 0){
+ List mask = new ArrayList(Arrays.asList(maskedPackages));
+
+ // first create a protected area so that we load JAXB/WS 2.1 API
+ // and everything that depends on them inside
+ cl = new MaskingClassLoader(cl,mask);
+
+ // then this classloader loads the API and tools.jar
+ cl = new URLClassLoader(urls.toArray(new URL[urls.size()]), cl);
+
+ // finally load the rest of the RI. The actual class files are loaded from ancestors
+ cl = new ParallelWorldClassLoader(cl,"");
+ }
+
+ }
+
Thread.currentThread().setContextClassLoader(cl);
- Class compileTool = cl.loadClass("com.sun.tools.internal.ws.wscompile.CompileTool");
- Constructor ctor = compileTool.getConstructor(OutputStream.class,String.class);
- Object tool = ctor.newInstance(System.out,toolName);
+ Class compileTool = cl.loadClass(mainClass);
+ Constructor ctor = compileTool.getConstructor(OutputStream.class);
+ Object tool = ctor.newInstance(System.out);
Method runMethod = compileTool.getMethod("run",String[].class);
boolean r = (Boolean)runMethod.invoke(tool,new Object[]{args});
- System.exit(r ? 0 : 1);
+ return r ? 0 : 1;
} catch (ToolsJarNotFoundException e) {
System.err.println(e.getMessage());
} catch (InvocationTargetException e) {
throw e.getCause();
- } finally {
+ } catch(ClassNotFoundException e){
+ throw e;
+ }finally {
Thread.currentThread().setContextClassLoader(oldcc);
}
- System.exit(1);
+ return -1;
}
+
+ /**
+ * Returns true if the RI appears to be loading the JAX-WS 2.1 API.
+ */
+ public static boolean checkIfLoading21API() {
+ try {
+ Service.class.getMethod("getPort",Class.class, WebServiceFeature[].class);
+ // yup. things look good.
+ return true;
+ } catch (NoSuchMethodException e) {
+ } catch (LinkageError e) {
+ }
+ // nope
+ return false;
+ }
+
+ /**
+ * Creates a classloader that can load JAXB/WS 2.1 API and tools.jar,
+ * and then return a classloader that can RI classes, which can see all those APIs and tools.jar.
+ */
+ public static ClassLoader createClassLoader(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException {
+
+ URL[] urls = findIstackAPIs(cl);
+ if(urls.length==0)
+ return cl; // we seem to be able to load everything already. no need for the hack
+
+ List mask = new ArrayList(Arrays.asList(maskedPackages));
+ if(urls.length>1) {
+ // we need to load 2.1 API from side. so add them to the mask
+ mask.add("javax.xml.bind.");
+ mask.add("javax.xml.ws.");
+ }
+
+ // first create a protected area so that we load JAXB/WS 2.1 API
+ // and everything that depends on them inside
+ cl = new MaskingClassLoader(cl,mask);
+
+ // then this classloader loads the API and tools.jar
+ cl = new URLClassLoader(urls, cl);
+
+ // finally load the rest of the RI. The actual class files are loaded from ancestors
+ cl = new ParallelWorldClassLoader(cl,"");
+
+ return cl;
+ }
+
+ /**
+ * Creates a classloader for loading JAXB/WS 2.1 jar and tools.jar
+ */
+ private static URL[] findIstackAPIs(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException {
+ List urls = new ArrayList();
+
+ if(Service.class.getClassLoader()==null) {
+ // JAX-WS API is loaded from bootstrap classloader
+ URL res = cl.getResource("javax/xml/ws/EndpointReference.class");
+ if(res==null)
+ throw new ClassNotFoundException("There's no JAX-WS 2.1 API in the classpath");
+ urls.add(ParallelWorldClassLoader.toJarUrl(res));
+
+ res = cl.getResource("javax/xml/bind/annotation/XmlSeeAlso.class");
+ if(res==null)
+ throw new ClassNotFoundException("There's no JAXB 2.1 API in the classpath");
+ urls.add(ParallelWorldClassLoader.toJarUrl(res));
+ }
+
+ findToolsJar(cl, urls);
+
+ return urls.toArray(new URL[urls.size()]);
+ }
+
+ private static void findToolsJar(ClassLoader cl, List urls) throws ToolsJarNotFoundException, MalformedURLException {
+ try {
+ Class.forName("com.sun.tools.javac.Main",false,cl);
+ Class.forName("com.sun.tools.apt.Main",false,cl);
+ // we can already load them in the parent class loader.
+ // so no need to look for tools.jar.
+ // this happens when we are run inside IDE/Ant, or
+ // in Mac OS.
+ } catch (ClassNotFoundException e) {
+ // otherwise try to find tools.jar
+ File jreHome = new File(System.getProperty("java.home"));
+ File toolsJar = new File( jreHome.getParent(), "lib/tools.jar" );
+
+ if (!toolsJar.exists()) {
+ throw new ToolsJarNotFoundException(toolsJar);
+ }
+ urls.add(toolsJar.toURL());
+ }
+ }
+
+ /**
+ * The list of package prefixes we want the
+ * {@link MaskingClassLoader} to prevent the parent
+ * classLoader from loading
+ */
+ public static String[] maskedPackages = new String[]{
+ "com.sun.istack.internal.tools.",
+ "com.sun.tools.internal.jxc.",
+ "com.sun.tools.internal.xjc.",
+ "com.sun.tools.internal.ws.",
+ "com.sun.codemodel.internal.",
+ "com.sun.relaxng.",
+ "com.sun.xml.internal.xsom.",
+ "com.sun.xml.internal.bind.",
+ "com.sun.xml.internal.ws."
+ };
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java
index fa3c51393dc..7d5aa32531e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java
index 7f6fc1ea8d7..a4b3de5da4d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,37 @@
*/
package com.sun.tools.internal.ws;
-/**
- * @author Vivek Pandey
- */
+import com.sun.tools.internal.ws.wscompile.WsgenTool;
+/**
+ * WsGen tool entry point.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
public class WsGen {
+ /**
+ * CLI entry point. Use {@link Invoker} to
+ * load tools.jar
+ */
public static void main(String[] args) throws Throwable {
- Invoker.main("wsgen",args);
+ System.exit(Invoker.invoke("com.sun.tools.internal.ws.wscompile.WsgenTool", args));
+ }
+
+ /**
+ * Entry point for tool integration.
+ *
+ *
+ * This does the same as {@link #main(String[])} except
+ * it doesn't invoke {@link System#exit(int)}. This method
+ * also doesn't play with classloaders. It's the caller's
+ * responsibility to set up the classloader to load all jars
+ * needed to run the tool, including $JAVA_HOME/lib/tools.jar
+ *
+ * @return
+ * 0 if the tool runs successfully.
+ */
+ public static int doMain(String[] args) throws Throwable {
+ return new WsgenTool(System.out).run(args) ? 0 : 1;
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java
index 98be2983479..94fd2a83a41 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,37 @@
*/
package com.sun.tools.internal.ws;
-/**
- * @author Vivek Pandey
- */
+import com.sun.tools.internal.ws.wscompile.WsimportTool;
+/**
+ * WsImport tool entry point.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
public class WsImport {
+ /**
+ * CLI entry point. Use {@link Invoker} to
+ * load tools.jar
+ */
public static void main(String[] args) throws Throwable {
- Invoker.main("wsimport",args);
+ System.exit(Invoker.invoke("com.sun.tools.internal.ws.wscompile.WsimportTool", args));
+ }
+
+ /**
+ * Entry point for tool integration.
+ *
+ *
+ * This does the same as {@link #main(String[])} except
+ * it doesn't invoke {@link System#exit(int)}. This method
+ * also doesn't play with classloaders. It's the caller's
+ * responsibility to set up the classloader to load all jars
+ * needed to run the tool, including $JAVA_HOME/lib/tools.jar
+ *
+ * @return
+ * 0 if the tool runs successfully.
+ */
+ public static int doMain(String[] args) throws Throwable {
+ return new WsimportTool(System.out).run(args) ? 0 : 1;
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java
new file mode 100644
index 00000000000..c9c2ff3d62b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api;
+
+import com.sun.codemodel.internal.JMethod;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
+import com.sun.tools.internal.ws.processor.generator.JavaGeneratorExtensionFacade;
+
+/**
+ * Provides Java SEI Code generation Extensiblity mechanism.
+ *
+ * @see JavaGeneratorExtensionFacade
+ * @author Vivek Pandey
+ */
+public abstract class TJavaGeneratorExtension {
+ /**
+ * This method should be used to write annotations on {@link JMethod}.
+ *
+ * @param wsdlOperation non-null wsdl extensiblity element - wsdl:portType/wsdl:operation.
+ * @param jMethod non-null {@link JMethod}
+ */
+ public abstract void writeMethodAnnotations(TWSDLOperation wsdlOperation, JMethod jMethod);
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java
new file mode 100644
index 00000000000..0f5be2fa8a3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+
+import javax.xml.namespace.QName;
+
+/**
+ * A WSDL element or attribute that can be extended.
+ *
+ * @author Vivek Pandey
+ */
+public interface TWSDLExtensible {
+ /**
+ * Gives the wsdl extensiblity element's name attribute value. It can be null as @name on some of the wsdl
+ * extensibility elements are optinal such as wsdl:input
+ */
+ String getNameValue();
+
+ /**
+ * Gives namespace URI of a wsdl extensibility element.
+ */
+ String getNamespaceURI();
+
+ /**
+ * Gives the WSDL element or WSDL extensibility element name
+ */
+ QName getWSDLElementName();
+
+ /**
+ * An {@link TWSDLExtensionHandler} will call this method to add an {@link TWSDLExtension} object
+ *
+ * @param e non-null extension object
+ */
+ void addExtension(TWSDLExtension e);
+
+ /**
+ * Gives iterator over {@link TWSDLExtension}s
+ */
+ Iterable extends TWSDLExtension> extensions();
+
+ /**
+ * Gives the parent of a wsdl extensibility element.
+ *
+ * For example,
+ *
+ *
+ *
+ * ...
+ * Here, the {@link TWSDLExtensible}representing wsdl:operation's parent would be wsdl:portType
+ *
+ * @return null if the {@link TWSDLExtensible} has no parent, root of wsdl document - wsdl:definition.
+ */
+ TWSDLExtensible getParent();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Mode.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java
similarity index 80%
rename from jaxws/src/share/classes/com/sun/xml/internal/ws/model/Mode.java
rename to jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java
index 3691fce609d..c709b30e5c1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Mode.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,19 +23,16 @@
* have any questions.
*/
-package com.sun.xml.internal.ws.model;
+package com.sun.tools.internal.ws.api.wsdl;
/**
- * Defines parameter mode, IN, OUT or INOUT
+ * A WSDL extension
*
* @author Vivek Pandey
*/
-
-public enum Mode {
- IN(0), OUT(1), INOUT(2);
-
- private Mode(int mode){
- this.mode = mode;
- }
- private final int mode;
+public interface TWSDLExtension {
+ /**
+ * Gives Parent {@link TWSDLExtensible} element
+ */
+ TWSDLExtensible getParent();
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java
new file mode 100644
index 00000000000..5b7fe935ca4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
+import org.w3c.dom.Element;
+
+/**
+ * JAXWS WSDL parser {@link com.sun.tools.internal.ws.wsdl.parser.WSDLParser} will call an {@link TWSDLExtensionHandler} registered
+ * with it for the WSDL extensibility elements thats not already defined in the WSDL 1.1 spec, such as SOAP or MIME.
+ *
+ * @author Vivek Pandey
+ */
+public abstract class TWSDLExtensionHandler {
+ /**
+ * Gives the namespace of an extensibility element.
+ *
+ * For example a soap 1.1 XXExtensionHandler would return ""http://schemas.xmlsoap.org/wsdl/soap/"
+ */
+ public String getNamespaceURI() {
+ return null;
+ }
+
+ /**
+ * This interface is called during WSDL parsing on detecting any wsdl extension.
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean doHandleExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_DEFINITIONS)) {
+ return handleDefinitionsExtension(context, parent, e);
+ } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_TYPES)) {
+ return handleTypesExtension(context, parent, e);
+ } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT_TYPE)) {
+ return handlePortTypeExtension(context, parent, e);
+ } else if (
+ parent.getWSDLElementName().equals(WSDLConstants.QNAME_BINDING)) {
+ return handleBindingExtension(context, parent, e);
+ } else if (
+ parent.getWSDLElementName().equals(WSDLConstants.QNAME_OPERATION)) {
+ return handleOperationExtension(context, parent, e);
+ } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
+ return handleInputExtension(context, parent, e);
+ } else if (
+ parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
+ return handleOutputExtension(context, parent, e);
+ } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_FAULT)) {
+ return handleFaultExtension(context, parent, e);
+ } else if (
+ parent.getWSDLElementName().equals(WSDLConstants.QNAME_SERVICE)) {
+ return handleServiceExtension(context, parent, e);
+ } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT)) {
+ return handlePortExtension(context, parent, e);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Callback for wsdl:portType
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:definitions
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:type
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleTypesExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:binding
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:portType/wsdl:operation.
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:input
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:output
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:fault
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:service
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+
+ /**
+ * Callback for wsdl:port
+ *
+ * @param context Parser context that will be passed on by the wsdl parser
+ * @param parent The Parent element within which the extensibility element is defined
+ * @param e The extensibility elemenet
+ * @return false if there was some error during the extension handling otherwise returns true. If returned false
+ * then the WSDL parser can abort if the wsdl extensibility element had required attribute set to true
+ */
+ public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ return false;
+ }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ExceptionType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java
similarity index 74%
rename from jaxws/src/share/classes/com/sun/xml/internal/ws/model/ExceptionType.java
rename to jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java
index ff7d1eb9770..45d0a3a42a8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ExceptionType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,21 +22,21 @@
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-package com.sun.xml.internal.ws.model;
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+import com.sun.codemodel.internal.JClass;
+
+import java.util.Map;
+
/**
- * Type of java exception
+ * Abstracts wsdl:portType/wsdl:operation
*
* @author Vivek Pandey
*/
-public enum ExceptionType {
- WSDLException(0), UserDefined(1);
-
- ExceptionType(int exceptionType){
- this.exceptionType = exceptionType;
- }
-
- public int value() {
- return exceptionType;
- }
- private final int exceptionType;
+public interface TWSDLOperation extends TWSDLExtensible{
+ /**
+ * Gives a Map of fault name attribute value to the {@link JClass}
+ */
+ Map getFaults();
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java
new file mode 100644
index 00000000000..6f6e3e00c7f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
+
+/**
+ * Provides WSDL parsing context. It should be used by the WSDL extension handlers to register their namespaces so that
+ * it can be latter used by other extensions to resolve the namespaces.
+ *
+ * @author Vivek Pandey
+ */
+public interface TWSDLParserContext {
+
+ /**
+ * Pushes the parsing context
+ */
+ void push();
+
+ /**
+ * pops the parsing context
+ */
+ void pop();
+
+ /**
+ * Gives the namespace URI for a given prefix
+ *
+ * @param prefix non-null prefix
+ * @return null of the prefix is not found
+ */
+ String getNamespaceURI(String prefix);
+
+ /**
+ * Gives the prefixes in the current context
+ */
+ Iterable getPrefixes();
+
+ /**
+ * Gives default namespace
+ *
+ * @return null if there is no default namespace declaration found
+ */
+ String getDefaultNamespaceURI();
+
+ /**
+ * Registers naemespace declarations of a given {@link Element} found in the WSDL
+ *
+ * @param e {@link Element} whose namespace declarations need to be registered
+ */
+ void registerNamespaces(Element e);
+
+ /**
+ * gives the location information for the given Element.
+ */
+ Locator getLocation(Element e);
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java
index 1889080b291..a3a514020ad 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,8 @@
*/
/**
- *
JAX-WS 2.0 Tools
- * This document describes the tools included with JAX-WS 2.0.
+ *
* Tool to import a WSDL and to generate an SEI (a javax.jws.WebService) interface that can be either implemented
* on the server to build a web service, or can be used on the client to invoke the web service.
*
*
This abstract class is used to process a particular {@link com.sun.tools.internal.ws.processor.config.Configuration
- * Configuration} to build a {@link com.sun.tools.internal.ws.processor.model Model} and to run
- * {@link com.sun.tools.internal.ws.processor.ProcessorAction ProcessorActions} on that model.
-
*
The model is used to represent the entire Web Service. The JAX-WS ProcessorActions can process
* this Model to generate Java artifacts such as the service interface.
*
-
A Modeler is used to create a Model of a Web Service from a particular Web
@@ -128,7 +115,7 @@
* javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
* idirectly via the {@link com.sun.istack.internal.ws.WSAP WSAP} when invoked by APT.
*
- *
This is the entry point for the WebServiceAP when APT is invoked on a SEI
* annotated with the javax.jws.WebService annotation.
*
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/Processor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/Processor.java
deleted file mode 100644
index 8b899c5f6eb..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/Processor.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.ModelInfo;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * This abstract class contains methods for getting a Modeler and creating a model
- * from that Modeler given a particular configuration. ProcessorActions can also
- * be registered and run with instances of this class.
- *
- * @author WS Development Team
- *
- */
-public class Processor {
-
- public Processor(Configuration configuration, Properties options, Model model) {
- this(configuration,options);
- _model = model;
- }
-
- public Processor(Configuration configuration, Properties options) {
- _configuration = configuration;
- _options = options;
-
- // find the value of the "print stack traces" property
- _printStackTrace = Boolean.valueOf(_options.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
- _env = _configuration.getEnvironment();
- }
-
- public void add(ProcessorAction action) {
- _actions.add(action);
- }
-
- public Model getModel() {
- return _model;
- }
-
- public void run() {
- runModeler();
- if (_model != null) {
- runActions();
- }
- }
-
- public void runModeler() {
- try {
- ModelInfo modelInfo = _configuration.getModelInfo();
- if (modelInfo == null) {
- throw new ProcessorException("processor.missing.model");
- }
-
- _model = modelInfo.buildModel(_options);
-
- } catch (JAXWSExceptionBase e) {
- if (_printStackTrace) {
- _env.printStackTrace(e);
- }
- _env.error(e);
- }
- }
-
- public void runActions() {
- try {
- if (_model == null) {
- // avoid reporting yet another error here
- return;
- }
-
- for (ProcessorAction action : _actions) {
- action.perform(_model, _configuration, _options);
- }
- } catch (JAXWSExceptionBase e) {
- if (_printStackTrace || _env.verbose()) {
- _env.printStackTrace(e);
- }
- _env.error(e);
- }
- }
-
- private final Properties _options;
- private final Configuration _configuration;
- private final List _actions = new ArrayList();
- private Model _model;
- private final boolean _printStackTrace;
- private final ProcessorEnvironment _env;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorActionVersion.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorActionVersion.java
deleted file mode 100644
index 54eb4cb6a65..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorActionVersion.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor;
-
-/**
- * @author WS Development Team
- *
- * Typesafe enum class to hold the ProcessorActionVersion
- */
-public enum ProcessorActionVersion {
- PRE_20("1.1.2"), VERSION_20("2.0");
-
- ProcessorActionVersion(String version) {
- this.version = version;
- }
-
- public String value() {
- return version;
- }
-
- private final String version;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorConstants.java
deleted file mode 100644
index b3345117a7d..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorConstants.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-/**
- * Constants used by Model, Modelers, Config ProcessorActions
- *
- * @author WS Development Team
- */
-public class ProcessorConstants {
- public final static String SOAP_VERSION_1_1 = "SOAP 1.1";
- public final static String SOAP_VERSION_1_2 = "SOAP 1.2";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java
index 6f13aff45d9..fd998f244de 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
package com.sun.tools.internal.ws.processor;
import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-import com.sun.xml.internal.ws.util.localization.Localizable;
/**
* ProcessorException represents an exception that occurred while processing
@@ -42,11 +41,15 @@ public class ProcessorException extends JAXWSExceptionBase {
super(key, args);
}
+ public ProcessorException(String msg){
+ super(msg);
+ }
+
public ProcessorException(Throwable throwable) {
super(throwable);
}
- public String getResourceBundleName() {
+ public String getDefaultResourceBundleName() {
return "com.sun.tools.internal.ws.resources.processor";
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorOptions.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorOptions.java
deleted file mode 100644
index de198cd375a..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorOptions.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-/**
- * Property names used by ProcessorActions
- *
- * @author WS Development Team
- */
-public class ProcessorOptions {
-
- public final static String SOURCE_DIRECTORY_PROPERTY = "sourceDirectory";
- public final static String DESTINATION_DIRECTORY_PROPERTY =
- "destinationDirectory";
- public final static String NONCLASS_DESTINATION_DIRECTORY_PROPERTY =
- "nonclassDestinationDirectory";
- public final static String VALIDATE_WSDL_PROPERTY = "validationWSDL";
- public final static String EXPLICIT_SERVICE_CONTEXT_PROPERTY =
- "explicitServiceContext";
- public final static String PRINT_STACK_TRACE_PROPERTY = "printStackTrace";
- public final static String DONOT_OVERWRITE_CLASSES = "doNotOverWrite";
- public final static String NO_DATA_BINDING_PROPERTY = "noDataBinding";
- public final static String USE_WSI_BASIC_PROFILE = "useWSIBasicProfile";
- public final static String STRICT_COMPLIANCE = "strictCompliance";
- public final static String JAXWS_SOURCE_VERSION = "sourceVersion";
- public final static String UNWRAP_DOC_LITERAL_WRAPPERS =
- "unwrapDocLitWrappers";
- public final static String BINDING_FILES = "bindingFiles";
- public final static String EXTENSION = "extension";
- public final static String PROTOCOL = "protocol";
- public final static String TRANSPORT = "transport";
- public final static String WSDL_LOCATION = "wsdllocation";
- public final static String DEFAULT_PACKAGE = "defaultpackage";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ClassModelInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ClassModelInfo.java
deleted file mode 100644
index eda6fa2cb43..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ClassModelInfo.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.xml.internal.ws.util.VersionUtil;
-
-/**
- *
- * @author WS Development Team
- */
-public class ClassModelInfo extends ModelInfo {
-
- public ClassModelInfo(String className) {
- this.className = className;
- }
-
-
- public Modeler getModeler(Properties properties) {
- return null;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public String getClassName() {
- return className;
- }
-
- private String className;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ModelInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ModelInfo.java
deleted file mode 100644
index ca07bc57a7b..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ModelInfo.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import org.xml.sax.EntityResolver;
-
-/**
- * This class contiains information used by {@link com.sun.tools.internal.ws.processor.modeler.Modeler
- * Modelers} to build {@link com.sun.tools.internal.ws.processor.model.Model Models}.
- *
- * @author WS Development Team
- */
-public abstract class ModelInfo {
-
- protected ModelInfo() {}
-
- public Configuration getParent() {
- return _parent;
- }
-
- public void setParent(Configuration c) {
- _parent = c;
- }
-
- public String getName() {
- return _name;
- }
-
- public void setName(String s) {
- _name = s;
- }
-
- public Configuration getConfiguration() {
- return _parent;
- }
-
- public HandlerChainInfo getClientHandlerChainInfo() {
- return _clientHandlerChainInfo;
- }
-
- public void setClientHandlerChainInfo(HandlerChainInfo i) {
- _clientHandlerChainInfo = i;
- }
-
- public HandlerChainInfo getServerHandlerChainInfo() {
- return _serverHandlerChainInfo;
- }
-
- public void setServerHandlerChainInfo(HandlerChainInfo i) {
- _serverHandlerChainInfo = i;
- }
-
- public String getJavaPackageName() {
- return _javaPackageName;
- }
-
- public void setJavaPackageName(String s) {
- _javaPackageName = s;
- }
-
- public Model buildModel(Properties options){
- return getModeler(options).buildModel();
- }
-
- public EntityResolver getEntityResolver() {
- return entityResolver;
- }
-
- public void setEntityResolver(EntityResolver entityResolver) {
- this.entityResolver = entityResolver;
- }
-
- public String getDefaultJavaPackage() {
- return _defaultJavaPackage;
- }
-
- public void setDefaultJavaPackage(String _defaultJavaPackage) {
- this._defaultJavaPackage = _defaultJavaPackage;
- }
-
- protected abstract Modeler getModeler(Properties options);
-
- private Configuration _parent;
- private String _name;
- private String _javaPackageName;
- private String _defaultJavaPackage;
- private HandlerChainInfo _clientHandlerChainInfo;
- private HandlerChainInfo _serverHandlerChainInfo;
- private EntityResolver entityResolver;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/WSDLModelInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/WSDLModelInfo.java
deleted file mode 100644
index 12eab008ac9..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/WSDLModelInfo.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-
-import java.util.*;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.tools.internal.ws.util.JAXWSClassFactory;
-
-/**
- *
- * @author WS Development Team
- */
-public class WSDLModelInfo extends ModelInfo {
-
- public WSDLModelInfo() {}
-
- protected Modeler getModeler(Properties options) {
- return JAXWSClassFactory.newInstance().createWSDLModeler(this, options);
- }
-
- public String getLocation() {
- return _location;
- }
-
- public void setLocation(String s) {
- _location = s;
- }
-
- public Map getJAXWSBindings(){
- return _jaxwsBindings;
- }
-
- public void putJAXWSBindings(String systemId, Document binding){
- _jaxwsBindings.put(systemId, binding);
- }
-
- public Set getJAXBBindings(){
- return _jaxbBindings;
- }
-
- public void addJAXBBIndings(InputSource jaxbBinding){
- _jaxbBindings.add(jaxbBinding);
- }
-
- public void setHandlerConfig(Element handlerConfig){
- this.handlerConfig = handlerConfig;
- }
-
- public Element getHandlerConfig(){
- return handlerConfig;
- }
-
- private Element handlerConfig;
-
- private String _location;
-
- //external jaxws:bindings elements
- private Map _jaxwsBindings = new HashMap();
-
- //we need an array of jaxb:binding elements, they are children of jaxws:bindings
- //and could come from an external customization file or wsdl.
- private Set _jaxbBindings = new HashSet();
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/CustomizationParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/CustomizationParser.java
deleted file mode 100644
index 72670bf2245..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/CustomizationParser.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import java.net.URL;
-import java.util.*;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
-
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * @author Vivek Pandey
- *
- */
-public class CustomizationParser extends InputParser {
-
- /**
- * @param entityResolver
- * @param env
- * @param options
- */
- public CustomizationParser(EntityResolver entityResolver, ProcessorEnvironment env, Properties options) {
- super(env, options);
- this.entityResolver = entityResolver;
- }
-
-
- /* (non-Javadoc)
- * @see com.sun.xml.internal.ws.processor.config.parser.InputParser#parse(java.io.File[], java.lang.String)
- */
- protected Configuration parse(List inputFiles) throws Exception{
- //File wsdlFile = inputFiles[0];
- Configuration configuration = new Configuration(getEnv());
- wsdlModelInfo = new WSDLModelInfo();
- wsdlModelInfo.setLocation(inputFiles.get(0));
- if(_options.get(ProcessorOptions.WSDL_LOCATION) == null)
- _options.setProperty(ProcessorOptions.WSDL_LOCATION, inputFiles.get(0));
-
- //modelInfoParser = (JAXWSBindingInfoParser)getModelInfoParsers().get(JAXWSBindingsConstants.JAXWS_BINDINGS);
- modelInfoParser = new JAXWSBindingInfoParser(getEnv());
-
- //get the jaxws bindingd file and add it to the modelInfo
- Set bindingFiles = (Set)_options.get(ProcessorOptions.BINDING_FILES);
- for(String bindingFile : bindingFiles){
- addBinding(bindingFile);
- }
-
-
- for(InputSource jaxwsBinding : jaxwsBindings){
- Document doc = modelInfoParser.parse(jaxwsBinding);
- if(doc != null){
- wsdlModelInfo.putJAXWSBindings(jaxwsBinding.getSystemId(), doc);
- }
- }
-
- //copy jaxb binding sources in modelInfo
- for(InputSource jaxbBinding : jaxbBindings){
- wsdlModelInfo.addJAXBBIndings(jaxbBinding);
- }
-
- addHandlerChainInfo();
- configuration.setModelInfo(wsdlModelInfo);
- return configuration;
- }
-
- private void addBinding(String bindingLocation) throws Exception{
- JAXWSUtils.checkAbsoluteness(bindingLocation);
- InputSource is = null;
- if(entityResolver != null){
- is = entityResolver.resolveEntity(null, bindingLocation);
- }
- if(is == null)
- is = new InputSource(bindingLocation);
-
- XMLStreamReader reader =
- XMLStreamReaderFactory.createFreshXMLStreamReader(is, true);
- XMLStreamReaderUtil.nextElementContent(reader);
- if(reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)){
- jaxwsBindings.add(is);
- }else if(reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS)){
- jaxbBindings.add(is);
- }else{
- warn("configuration.notBindingFile");
- }
- }
-
- private void addHandlerChainInfo() throws Exception{
- //setup handler chain info
- for(Map.Entry entry:wsdlModelInfo.getJAXWSBindings().entrySet()){
- Element e = entry.getValue().getDocumentElement();
- NodeList nl = e.getElementsByTagNameNS(
- "http://java.sun.com/xml/ns/javaee", "handler-chains");
- if(nl.getLength()== 0)
- continue;
- //take the first one, anyway its 1 handler-config per customization
- Element hc = (Element)nl.item(0);
- wsdlModelInfo.setHandlerConfig(hc);
- return;
- }
- }
-
- private WSDLModelInfo wsdlModelInfo;
- private JAXWSBindingInfoParser modelInfoParser;
- private Set jaxwsBindings = new HashSet();
- private Set jaxbBindings = new HashSet();
- private EntityResolver entityResolver;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/InputParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/InputParser.java
deleted file mode 100644
index a2e2b08d154..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/InputParser.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.namespace.QName;
-
-import org.xml.sax.InputSource;
-
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-
-/**
- * @author Vivek Pandey
- *
- *
- */
-public abstract class InputParser{
- protected LocalizableMessageFactory _messageFactory =
- new LocalizableMessageFactory(
- "com.sun.tools.internal.ws.resources.configuration");
-
- public InputParser(ProcessorEnvironment env, Properties options) {
- this._env = env;
- this._options = options;
- _modelInfoParsers = new HashMap();
-
-// /*
-// * Load modelinfo parsers from the plugins which want to extend
-// * this functionality
-// */
-// Iterator i = ToolPluginFactory.getInstance().getExtensions(
-// ToolPluginConstants.WSCOMPILE_PLUGIN,
-// ToolPluginConstants.WSCOMPILE_MODEL_INFO_EXT_POINT);
-// while(i != null && i.hasNext()) {
-// ModelInfoPlugin plugin = (ModelInfoPlugin)i.next();
-// _modelInfoParsers.put(plugin.getModelInfoName(),
-// plugin.createModelInfoParser(env));
-// }
- }
-
- protected Configuration parse(InputStream is) throws Exception{
- //TODO: Not implemented exception
- return null;
- }
-
- protected Configuration parse(InputSource is) throws Exception{
- //TODO: Not implemented exception
- return null;
- }
-
- protected Configuration parse(List inputSources) throws Exception{
- //TODO: Not implemented exception
- return null;
- }
-
- /**
- * @return Returns the _env.
- */
- public ProcessorEnvironment getEnv(){
- return _env;
- }
-
- /**
- * @param env The ProcessorEnvironment to set.
- */
- public void setEnv(ProcessorEnvironment env){
- this._env = env;
- }
-
- protected void warn(String key) {
- _env.warn(_messageFactory.getMessage(key));
- }
-
- protected void warn(String key, String arg) {
- _env.warn(_messageFactory.getMessage(key, arg));
- }
-
- protected void warn(String key, Object[] args) {
- _env.warn(_messageFactory.getMessage(key, args));
- }
-
- protected void info(String key) {
- _env.info(_messageFactory.getMessage(key));
- }
-
- protected void info(String key, String arg) {
- _env.info(_messageFactory.getMessage(key, arg));
- }
-
- protected ProcessorEnvironment _env;
- protected Properties _options;
- protected Map _modelInfoParsers;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/JAXWSBindingInfoParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/JAXWSBindingInfoParser.java
deleted file mode 100644
index e4e560f8273..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/JAXWSBindingInfoParser.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.util.xml.NullEntityResolver;
-import com.sun.tools.internal.ws.wsdl.framework.ParseException;
-
-/**
- * @author Vivek Pandey
- *
- * External jaxws:bindings parser
- */
-public class JAXWSBindingInfoParser {
-
- private ProcessorEnvironment env;
-
- /**
- * @param env
- */
- public JAXWSBindingInfoParser(ProcessorEnvironment env) {
- this.env = env;
- }
-
- public Document parse(InputSource source) {
- try {
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
- builderFactory.setNamespaceAware(true);
- builderFactory.setValidating(false);
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
- builder.setErrorHandler(new ErrorHandler() {
- public void error(SAXParseException e)
- throws SAXParseException {
- throw e;
- }
-
- public void fatalError(SAXParseException e)
- throws SAXParseException {
- throw e;
- }
-
- public void warning(SAXParseException err)
- throws SAXParseException {
- // do nothing
- }
- });
-
- builder.setEntityResolver(new NullEntityResolver());
- return builder.parse(source);
- } catch (ParserConfigurationException e) {
- throw new ParseException("parsing.parserConfigException",e);
- } catch (FactoryConfigurationError e) {
- throw new ParseException("parsing.factoryConfigException",e);
- }catch(SAXException e){
- throw new ParseException("parsing.saxException",e);
- }catch(IOException e){
- throw new ParseException("parsing.saxException",e);
- }
- }
-
- public final Set outerBindings = new HashSet();
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ParserUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ParserUtil.java
deleted file mode 100644
index 84b18c8d4e2..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ParserUtil.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-import com.sun.tools.internal.ws.processor.config.ConfigurationException;
-import com.sun.xml.internal.ws.streaming.Attributes;
-import com.sun.xml.internal.ws.streaming.XMLReader;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-/**
- *
- * @author WS Development Team
- */
-public class ParserUtil {
- public static void failWithFullName(String key, String file, XMLReader reader) {
- throw new ConfigurationException(key, new Object[] { file, Integer.toString(
- reader.getLineNumber()), reader.getName().toString() });
- }
-
- public static void failWithFullName(String key, String file, XMLStreamReader reader) {
- throw new ConfigurationException(key, new Object[] { file, Integer.toString(
- reader.getLocation().getLineNumber()), reader.getName().toString() });
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/Reader.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/Reader.java
deleted file mode 100644
index cd9a100314b..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/Reader.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-
-import java.net.URL;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.xml.sax.EntityResolver;
-
-/**
- * @author Vivek Pandey
- *
- * Main entry point from CompileTool
- */
-public class Reader {
-
- /**
- *
- */
- public Reader(ProcessorEnvironment env, Properties options) {
- this._env = env;
- this._options = options;
- }
-
- public Configuration parse(EntityResolver entityResolver, List inputSources)
- throws Exception {
- //reset the input type flags before parsing
- isClassFile = false;
-
- InputParser parser = null;
- //now its just the first file. do we expect more than one input files?
- validateInput(inputSources.get(0));
-
- if(isClassFile){
- parser = new ClassModelParser(_env, _options);
- } else {
- parser = new CustomizationParser(entityResolver, _env, _options);
- }
- return parser.parse(inputSources);
- }
-
- protected void validateInput(String file) throws Exception{
- if(isClass(file)){
- isClassFile = true;
- return;
- }
-
-// JAXWSUtils.checkAbsoluteness(file);
-// URL url = new URL(file);
-//
-// XMLStreamReader reader =
-// XMLStreamReaderFactory.createXMLStreamReader(url.openStream(), true);
-//
-// XMLStreamReaderUtil.nextElementContent(reader);
-// if(!reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS)){
-// //we are here, means invalid element
-// ParserUtil.failWithFullName("configuration.invalidElement", file, reader);
-// }
- }
-
- public boolean isClass(String className) {
- try {
- _env.getClassLoader().loadClass(className);
- } catch (ClassNotFoundException e) {
- return false;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return true;
- }
-
- private boolean isClassFile;
-
- protected ProcessorEnvironment _env;
-
- protected Properties _options;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java
index 4726a47a9de..a933faa0173 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,28 @@
package com.sun.tools.internal.ws.processor.generator;
-import com.sun.codemodel.internal.*;
-import com.sun.tools.internal.ws.processor.config.Configuration;
+import com.sun.codemodel.internal.ClassType;
+import com.sun.codemodel.internal.JAnnotationUse;
+import com.sun.codemodel.internal.JBlock;
+import com.sun.codemodel.internal.JClass;
+import com.sun.codemodel.internal.JClassAlreadyExistsException;
+import com.sun.codemodel.internal.JDefinedClass;
+import com.sun.codemodel.internal.JDocComment;
+import com.sun.codemodel.internal.JExpr;
+import com.sun.codemodel.internal.JFieldRef;
+import com.sun.codemodel.internal.JFieldVar;
+import com.sun.codemodel.internal.JMethod;
+import com.sun.codemodel.internal.JMod;
+import com.sun.codemodel.internal.JType;
+import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.ws.processor.model.Fault;
import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
import javax.xml.ws.WebFault;
import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
/**
*
@@ -43,39 +55,25 @@ import java.util.Properties;
public class CustomExceptionGenerator extends GeneratorBase {
private Map faults = new HashMap();
- public CustomExceptionGenerator() {
+ public static void generate(Model model,
+ WsimportOptions options,
+ ErrorReceiver receiver){
+ CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator(model, options, receiver);
+ exceptionGen.doGeneration();
}
-
- public GeneratorBase getGenerator(
+ private CustomExceptionGenerator(
Model model,
- Configuration config,
- Properties properties) {
- return new CustomExceptionGenerator(model, config, properties);
+ WsimportOptions options,
+ ErrorReceiver receiver) {
+ super(model, options, receiver);
}
- public GeneratorBase getGenerator(
- Model model,
- Configuration config,
- Properties properties,
- SOAPVersion ver) {
- return new CustomExceptionGenerator(model, config, properties);
+ public GeneratorBase getGenerator(Model model, WsimportOptions options, ErrorReceiver receiver) {
+ return new CustomExceptionGenerator(model, options, receiver);
}
- protected CustomExceptionGenerator(
- Model model,
- Configuration config,
- Properties properties) {
- super(model, config, properties);
- }
-
- protected void preVisitModel(Model model) throws Exception {
- }
-
- protected void postVisitModel(Model model) throws Exception {
- faults = null;
- }
-
- protected void preVisitFault(Fault fault) throws Exception {
+ @Override
+ public void visit(Fault fault) throws Exception {
if (isRegistered(fault))
return;
registerFault(fault);
@@ -93,13 +91,13 @@ public class CustomExceptionGenerator extends GeneratorBase {
try {
write(fault);
faults.put(fault.getJavaException().getName(), fault.getExceptionClass());
- } catch (Exception e) {
+ } catch (JClassAlreadyExistsException e) {
throw new GeneratorException("generator.nestedGeneratorError",e);
}
}
- private void write(Fault fault) throws Exception{
- String className = env.getNames().customExceptionClassName(fault);
+ private void write(Fault fault) throws JClassAlreadyExistsException {
+ String className = Names.customExceptionClassName(fault);
JDefinedClass cls = cm._class(className, ClassType.CLASS);
JDocComment comment = cls.javadoc();
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java
index 49382cf407c..9cee479e62e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,12 @@
package com.sun.tools.internal.ws.processor.generator;
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.model.AbstractType;
+import com.sun.codemodel.internal.ClassType;
+import com.sun.codemodel.internal.JAnnotationUse;
+import com.sun.codemodel.internal.JClassAlreadyExistsException;
+import com.sun.codemodel.internal.JCodeModel;
+import com.sun.codemodel.internal.JDefinedClass;
+import com.sun.tools.internal.ws.ToolVersion;
import com.sun.tools.internal.ws.processor.model.Block;
import com.sun.tools.internal.ws.processor.model.Fault;
import com.sun.tools.internal.ws.processor.model.Model;
@@ -49,27 +41,25 @@ import com.sun.tools.internal.ws.processor.model.Port;
import com.sun.tools.internal.ws.processor.model.Request;
import com.sun.tools.internal.ws.processor.model.Response;
import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeVisitor;
-import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitStructure;
-import com.sun.tools.internal.ws.processor.util.IndentingWriter;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
-import com.sun.tools.internal.ws.processor.util.GeneratedFileInfo;
-import com.sun.tools.internal.ws.ToolVersion;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.tools.internal.ws.processor.util.IndentingWriter;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.codemodel.internal.*;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import javax.jws.HandlerChain;
-import javax.xml.transform.Transformer;
import javax.xml.transform.OutputKeys;
-import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.Transformer;
import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
/**
*
@@ -78,173 +68,53 @@ import javax.xml.transform.dom.DOMSource;
public abstract class GeneratorBase
implements
GeneratorConstants,
- ProcessorAction,
- ModelVisitor,
- JAXBTypeVisitor {
- protected File sourceDir;
- protected File destDir;
- protected File nonclassDestDir;
- protected ProcessorEnvironment env;
- protected Model model;
- protected Service service;
- protected SOAPVersion curSOAPVersion;
- protected String targetVersion;
+ ModelVisitor{
+ private File destDir;
+ private String targetVersion;
protected boolean donotOverride;
- protected String servicePackage;
protected JCodeModel cm;
- protected boolean printStackTrace;
- protected String wsdlLocation;
-
- private LocalizableMessageFactory messageFactory;
-
- public GeneratorBase() {
- sourceDir = null;
- destDir = null;
- nonclassDestDir = null;
- env = null;
- model = null;
- }
-
- public void perform(
- Model model,
- Configuration config,
- Properties properties) {
- GeneratorBase generator = getGenerator(model, config, properties);
-
- generator.doGeneration();
- }
-
- public abstract GeneratorBase getGenerator(
- Model model,
- Configuration config,
- Properties properties);
- public abstract GeneratorBase getGenerator(
- Model model,
- Configuration config,
- Properties properties,
- SOAPVersion ver);
-
- protected GeneratorBase(
- Model model,
- Configuration config,
- Properties properties) {
+ protected final Model model;
+ protected final String wsdlLocation;
+ protected final ErrorReceiver receiver;
+ protected final WsimportOptions options;
+ protected GeneratorBase(Model model, WsimportOptions options, ErrorReceiver receiver){
this.model = model;
-
- if(model.getJAXBModel().getS2JJAXBModel() != null)
- cm = model.getJAXBModel().getS2JJAXBModel().generateCode(null, new JAXBTypeGenerator.JAXBErrorListener());
- else
- cm = new JCodeModel();
-
- this.env = (ProcessorEnvironment) config.getEnvironment();
- String key = ProcessorOptions.DESTINATION_DIRECTORY_PROPERTY;
- String dirPath = properties.getProperty(key);
- this.destDir = new File(dirPath);
- key = ProcessorOptions.SOURCE_DIRECTORY_PROPERTY;
- String sourcePath = properties.getProperty(key);
- this.sourceDir = new File(sourcePath);
- key = ProcessorOptions.NONCLASS_DESTINATION_DIRECTORY_PROPERTY;
- String nonclassDestPath = properties.getProperty(key);
- this.nonclassDestDir = new File(nonclassDestPath);
- if (nonclassDestDir == null)
- nonclassDestDir = destDir;
- messageFactory =
- new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.generator");
- this.targetVersion =
- properties.getProperty(ProcessorOptions.JAXWS_SOURCE_VERSION);
- key = ProcessorOptions.DONOT_OVERWRITE_CLASSES;
- this.donotOverride =
- Boolean.valueOf(properties.getProperty(key)).booleanValue();
- this.printStackTrace = Boolean.valueOf(properties.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
- this.wsdlLocation = properties.getProperty(ProcessorOptions.WSDL_LOCATION);
+ this.options = options;
+ this.destDir = options.destDir;
+ this.receiver = receiver;
+ this.wsdlLocation = options.wsdlLocation;
+ this.targetVersion = options.target.getVersion();
+ this.cm = options.getCodeModel();
}
protected void doGeneration() {
try {
model.accept(this);
} catch (Exception e) {
- if (env.verbose())
- e.printStackTrace();
- throw new GeneratorException("generator.nestedGeneratorError",e);
+ receiver.error(e);
}
}
public void visit(Model model) throws Exception {
- preVisitModel(model);
- visitModel(model);
- postVisitModel(model);
- }
-
- protected void preVisitModel(Model model) throws Exception {
- }
-
- protected void visitModel(Model model) throws Exception {
- env.getNames().resetPrefixFactory();
for (Service service : model.getServices()) {
service.accept(this);
}
}
- protected void postVisitModel(Model model) throws Exception {
- }
-
public void visit(Service service) throws Exception {
- preVisitService(service);
- visitService(service);
- postVisitService(service);
- }
-
- protected void preVisitService(Service service) throws Exception {
- servicePackage = Names.getPackageName(service);
- }
-
- protected void visitService(Service service) throws Exception {
- this.service = service;
-// Iterator ports = service.getPorts();
for (Port port : service.getPorts()) {
port.accept(this);
}
- this.service = null;
- }
-
- protected void postVisitService(Service service) throws Exception {
- Iterator extraTypes = model.getExtraTypes();
- while (extraTypes.hasNext()) {
- AbstractType type = (AbstractType) extraTypes.next();
- }
- servicePackage = null;
}
public void visit(Port port) throws Exception {
- preVisitPort(port);
- visitPort(port);
- postVisitPort(port);
- }
-
- protected void preVisitPort(Port port) throws Exception {
- curSOAPVersion = port.getSOAPVersion();
- }
-
- protected void visitPort(Port port) throws Exception {
for (Operation operation : port.getOperations()) {
operation.accept(this);
}
}
- protected void postVisitPort(Port port) throws Exception {
- curSOAPVersion = null;
- }
-
public void visit(Operation operation) throws Exception {
- preVisitOperation(operation);
- visitOperation(operation);
- postVisitOperation(operation);
- }
-
- protected void preVisitOperation(Operation operation) throws Exception {
- }
-
- protected void visitOperation(Operation operation) throws Exception {
operation.getRequest().accept(this);
if (operation.getResponse() != null)
operation.getResponse().accept(this);
@@ -258,161 +128,20 @@ public abstract class GeneratorBase
}
}
- protected void postVisitOperation(Operation operation) throws Exception {
- }
-
public void visit(Parameter param) throws Exception {
- preVisitParameter(param);
- visitParameter(param);
- postVisitParameter(param);
- }
-
- protected void preVisitParameter(Parameter param) throws Exception {
- }
-
- protected void visitParameter(Parameter param) throws Exception {
- }
-
- protected void postVisitParameter(Parameter param) throws Exception {
}
public void visit(Block block) throws Exception {
- preVisitBlock(block);
- visitBlock(block);
- postVisitBlock(block);
- }
-
- protected void preVisitBlock(Block block) throws Exception {
- }
-
- protected void visitBlock(Block block) throws Exception {
- }
-
- protected void postVisitBlock(Block block) throws Exception {
}
public void visit(Response response) throws Exception {
- preVisitResponse(response);
- visitResponse(response);
- postVisitResponse(response);
}
- protected void preVisitResponse(Response response) throws Exception {
- }
-
- protected void visitResponse(Response response) throws Exception {
- Iterator iter = response.getParameters();
- AbstractType type;
- Block block;
- while (iter.hasNext()) {
- ((Parameter) iter.next()).accept(this);
- }
- iter = response.getBodyBlocks();
- while (iter.hasNext()) {
- block = (Block) iter.next();
- type = block.getType();
- if(type instanceof JAXBType)
- ((JAXBType) type).accept(this);
- else if(type instanceof RpcLitStructure)
- ((RpcLitStructure) type).accept(this);
-
- responseBodyBlock(block);
- }
- iter = response.getHeaderBlocks();
- while (iter.hasNext()) {
- block = (Block) iter.next();
- type = block.getType();
- if(type instanceof JAXBType)
- ((JAXBType) type).accept(this);
- responseHeaderBlock(block);
- }
-
- //attachment
- iter = response.getAttachmentBlocks();
- while (iter.hasNext()) {
- block = (Block) iter.next();
- type = block.getType();
- if(type instanceof JAXBType)
- ((JAXBType) type).accept(this);
- responseAttachmentBlock(block);
- }
-
- }
-
- protected void responseBodyBlock(Block block) throws Exception {
- }
-
- protected void responseHeaderBlock(Block block) throws Exception {
- }
-
- protected void responseAttachmentBlock(Block block) throws Exception {
- }
-
- protected void postVisitResponse(Response response) throws Exception {
- }
public void visit(Request request) throws Exception {
- preVisitRequest(request);
- visitRequest(request);
- postVisitRequest(request);
- }
-
- protected void preVisitRequest(Request request) throws Exception {
- }
-
- protected void visitRequest(Request request) throws Exception {
- Iterator iter = request.getParameters();
- AbstractType type;
- Block block;
- while (iter.hasNext()) {
- ((Parameter) iter.next()).accept(this);
- }
- iter = request.getBodyBlocks();
- while (iter.hasNext()) {
- block = (Block) iter.next();
- type = block.getType();
- if(type instanceof JAXBType)
- ((JAXBType) type).accept(this);
- else if(type instanceof RpcLitStructure)
- ((RpcLitStructure) type).accept(this);
- requestBodyBlock(block);
- }
- iter = request.getHeaderBlocks();
- while (iter.hasNext()) {
- block = (Block) iter.next();
- type = block.getType();
- if(type instanceof JAXBType)
- ((JAXBType) type).accept(this);
- requestHeaderBlock(block);
- }
- }
-
- protected void requestBodyBlock(Block block) throws Exception {
- }
-
- protected void requestHeaderBlock(Block block) throws Exception {
- }
-
- protected void postVisitRequest(Request request) throws Exception {
}
public void visit(Fault fault) throws Exception {
- preVisitFault(fault);
- visitFault(fault);
- postVisitFault(fault);
- }
-
- protected void preVisitFault(Fault fault) throws Exception {
- }
-
- protected void visitFault(Fault fault) throws Exception {
- }
-
- protected void postVisitFault(Fault fault) throws Exception {
- }
-
- protected void writeWarning(IndentingWriter p) throws IOException {
- writeWarning(p, targetVersion);
}
public List getJAXWSClassComment(){
@@ -421,52 +150,14 @@ public abstract class GeneratorBase
public static List getJAXWSClassComment(String targetVersion) {
List comments = new ArrayList();
- comments.add("This class was generated by the JAXWS SI.\n");
+ comments.add("This class was generated by the JAX-WS RI.\n");
comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n");
comments.add("Generated source version: " + targetVersion);
return comments;
}
- public static void writeWarning(IndentingWriter p,
- String targetVersion) throws IOException {
- /*
- * Write boiler plate comment.
- */
- p.pln("// This class was generated by the JAX SI, do not edit.");
- p.pln("// Contents subject to change without notice.");
- p.pln("// " + ToolVersion.VERSION.BUILD_VERSION);
- p.pln("// Generated source version: " + targetVersion);
- p.pln();
- }
-
- public void writePackage(IndentingWriter p, String classNameStr)
- throws IOException {
-
- writePackage(p, classNameStr, targetVersion);
- }
-
- public static void writePackage(
- IndentingWriter p,
- String classNameStr,
- String sourceVersion)
- throws IOException {
-
- writeWarning(p, sourceVersion);
- writePackageOnly(p, classNameStr);
- }
-
- public static void writePackageOnly(IndentingWriter p, String classNameStr)
- throws IOException {
- int idx = classNameStr.lastIndexOf(".");
- if (idx > 0) {
- p.pln("package " + classNameStr.substring(0, idx) + ";");
- p.pln();
- }
- }
-
-
protected JDefinedClass getClass(String className, ClassType type) {
- JDefinedClass cls = null;
+ JDefinedClass cls;
try {
cls = cm._class(className, type);
} catch (JClassAlreadyExistsException e){
@@ -476,7 +167,7 @@ public abstract class GeneratorBase
}
protected void log(String msg) {
- if (env.verbose()) {
+ if (options.verbose) {
System.out.println(
"["
+ Names.stripQualifier(this.getClass().getName())
@@ -486,101 +177,14 @@ public abstract class GeneratorBase
}
}
- protected void warn(String key) {
- env.warn(messageFactory.getMessage(key));
- }
-
- protected void warn(String key, String arg) {
- env.warn(messageFactory.getMessage(key, arg));
- }
-
- protected void warn(String key, Object[] args) {
- env.warn(messageFactory.getMessage(key, args));
- }
-
- protected void info(String key) {
- env.info(messageFactory.getMessage(key));
- }
-
- protected void info(String key, String arg) {
- env.info(messageFactory.getMessage(key, arg));
- }
-
- protected static void fail(String key) {
- throw new GeneratorException(key);
- }
-
- protected static void fail(String key, String arg) {
- throw new GeneratorException(key, arg);
- }
-
- protected static void fail(String key, String arg1, String arg2) {
- throw new GeneratorException(key, new Object[] { arg1, arg2 });
- }
-
- protected static void fail(Localizable arg) {
- throw new GeneratorException("generator.nestedGeneratorError", arg);
- }
-
- protected static void fail(Throwable arg) {
- throw new GeneratorException(
- "generator.nestedGeneratorError",
- arg);
- }
-
- /* (non-Javadoc)
- * @see com.sun.xml.internal.ws.processor.model.jaxb.JAXBTypeVisitor#visit(com.sun.xml.internal.ws.processor.model.jaxb.JAXBType)
- */
- public void visit(JAXBType type) throws Exception {
- preVisitJAXBType(type);
- visitJAXBType(type);
- postVisitJAXBType(type);
-
- }
-
- /**
- * @param type
- */
- protected void postVisitJAXBType(JAXBType type) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * @param type
- */
- protected void visitJAXBType(JAXBType type) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * @param type
- */
- protected void preVisitJAXBType(JAXBType type) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see com.sun.xml.internal.ws.processor.model.jaxb.JAXBTypeVisitor#visit(com.sun.xml.internal.ws.processor.model.jaxb.RpcLitStructure)
- */
- public void visit(RpcLitStructure type) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- protected void writeHandlerConfig(String className, JDefinedClass cls, WSDLModelInfo wsdlModelInfo) {
- Element e = wsdlModelInfo.getHandlerConfig();
+ protected void writeHandlerConfig(String className, JDefinedClass cls, WsimportOptions options) {
+ Element e = options.getHandlerChainConfiguration();
if(e == null)
return;
JAnnotationUse handlerChainAnn = cls.annotate(cm.ref(HandlerChain.class));
- //String fullName = env.getNames().customJavaTypeClassName(port.getJavaInterface());
NodeList nl = e.getElementsByTagNameNS(
"http://java.sun.com/xml/ns/javaee", "handler-chain");
if(nl.getLength() > 0){
- Element hn = (Element)nl.item(0);
String fName = getHandlerConfigFileName(className);
handlerChainAnn.param("file", fName);
generateHandlerChainFile(e, className);
@@ -595,14 +199,10 @@ public abstract class GeneratorBase
private void generateHandlerChainFile(Element hChains, String name) {
String hcName = getHandlerConfigFileName(name);
- File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir, env);
+ File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir);
File hcFile = new File(packageDir, hcName);
- /* adding the file name and its type */
- GeneratedFileInfo fi = new GeneratedFileInfo();
- fi.setFile(hcFile);
- fi.setType("HandlerConfig");
- env.addGeneratedFile(fi);
+ options.addGeneratedFile(hcFile);
try {
IndentingWriter p =
@@ -617,6 +217,7 @@ public abstract class GeneratorBase
"2");
it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
it.transform( new DOMSource(hChains), new StreamResult(p) );
+ p.close();
} catch (Exception e) {
throw new GeneratorException(
"generator.nestedGeneratorError",
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java
index c8fcd512d53..0688b6b3a84 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,56 +31,12 @@ import com.sun.tools.internal.ws.processor.modeler.ModelerConstants;
* @author WS Development Team
*/
public interface GeneratorConstants extends ModelerConstants {
-
- /*
- * Constants used in the generators
- */
- public static final String FILE_TYPE_WSDL = "Wsdl";
- public static final String FILE_TYPE_REMOTE_INTERFACE = "RemoteInterface";
- public static final String FILE_TYPE_SERVICE = "Service";
- public static final String FILE_TYPE_HANDLER_CONFIG = "HandlerConfig";
- public static final String FILE_TYPE_SERVICE_IMPL = "ServiceImpl";
- public static final String FILE_TYPE_EXCEPTION = "Exception";
- public static final String FILE_TYPE_WRAPPER_BEAN = "WrapperBean";
- public static final String FILE_TYPE_EXCEPTION_BEAN = "ExceptionBean";
- /*
- * Identifiers potentially useful for all Generators
- */
-
- public static final String ID_DELEGATE_BASE = "com.sun.xml.internal.ws.soap.internal.DelegateBase";
-
-
public static final char DOTC = '.';
public static final String SIG_INNERCLASS = "$";
-
- public static final String UNDERSCORE = "_";
- public static final String STUB_SUFFIX = "_Stub";
-
- public static final String CLIENT_DELEGATE_SUFFIX = "_Delegate";
- public static final String CLIENT_CONTACTINFOLIST_SUFFIX = "_ContactInfoList";
-
- public static final String CLIENT_ENCODER_DECODER_SUFFIX = "_CED";
- public static final String SERVER_ENCODER_DECODER_SUFFIX = "_SED";
- public static final String TIE_SUFFIX = "_Tie";
-
- public static final String PEPT_TIE_SUFFIX = "_PTie";
- public static final String EPTFF_SUFFIX = "_EPTFF";
public static final String JAVA_SRC_SUFFIX = ".java";
- public static final String IMPL_SUFFIX = "_Impl";
- public static final String ARRAY = "Array";
- public static final String MEMBER_PREFIX = "my";
-
- public static final String OPCODE_SUFFIX = "_OPCODE";
public static final String QNAME_SUFFIX = "_QNAME";
- public static final String TYPE_QNAME_SUFFIX = "_TYPE" + QNAME_SUFFIX;
-
public static final String GET = "get";
public static final String IS = "is";
- public static final String SET = "set";
public static final String RESPONSE = "Response";
- public static final String NS_PREFIX = "ns";
- public static final String SERVICE_SUFFIX = "_Service";
- public static final String JAVA_PACKAGE_PREFIX = "java.";
- public static final String JAVAX_PACKAGE_PREFIX = "javax.";
public static final String FAULT_CLASS_MEMBER_NAME = "faultInfo";
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java
index 12c50384766..36d6c6d148c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
package com.sun.tools.internal.ws.processor.generator;
import com.sun.tools.internal.ws.processor.ProcessorException;
-import com.sun.xml.internal.ws.util.localization.Localizable;
/**
*
@@ -42,7 +41,7 @@ public class GeneratorException extends ProcessorException {
super(throwable);
}
- public String getResourceBundleName() {
+ public String getDefaultResourceBundleName() {
return "com.sun.tools.internal.ws.resources.generator";
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java
index 6f552118dae..64dbe6f5953 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,7 @@
package com.sun.tools.internal.ws.processor.generator;
-import java.io.IOException;
-import java.util.Comparator;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.Block;
-import com.sun.tools.internal.ws.processor.model.Fault;
-import com.sun.tools.internal.ws.processor.model.Operation;
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureType;
-import com.sun.tools.internal.ws.processor.util.IndentingWriter;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
+import com.sun.tools.internal.ws.wscompile.Options;
/**
@@ -44,67 +34,19 @@ import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
*/
public class GeneratorUtil implements GeneratorConstants {
- public static void writeNewQName(IndentingWriter p, QName name)
- throws IOException {
- p.p(
- "new QName(\""
- + name.getNamespaceURI()
- + "\", \""
- + name.getLocalPart()
- + "\")");
- }
-
-
- public static void writeBlockQNameDeclaration(
- IndentingWriter p,
- Operation operation,
- Block block,
- Names names)
- throws IOException {
- String qname = names.getBlockQNameName(operation, block);
- p.p("private static final QName ");
- p.p(qname + " = ");
- writeNewQName(p, block.getName());
- p.pln(";");
- }
-
- public static void writeQNameDeclaration(
- IndentingWriter p,
- QName name,
- Names names)
- throws IOException {
- String qname = names.getQNameName(name);
- p.p("private static final QName ");
- p.p(qname + " = ");
- writeNewQName(p, name);
- p.pln(";");
- }
-
- public static void writeQNameTypeDeclaration(
- IndentingWriter p,
- QName name,
- Names names)
- throws IOException {
- String qname = names.getTypeQName(name);
- p.p("private static final QName ");
- p.p(qname + " = ");
- writeNewQName(p, name);
- p.pln(";");
- }
-
public static boolean classExists(
- ProcessorEnvironment env,
+ Options options,
String className) {
try {
// Takes care of inner classes.
- getLoadableClassName(className, env.getClassLoader());
+ getLoadableClassName(className, options.getClassLoader());
return true;
} catch(ClassNotFoundException ce) {
+ return false;
}
- return false;
}
- public static String getLoadableClassName(
+ private static String getLoadableClassName(
String className,
ClassLoader classLoader)
throws ClassNotFoundException {
@@ -122,62 +64,4 @@ public class GeneratorUtil implements GeneratorConstants {
}
return className;
}
-
- public static class FaultComparator implements Comparator {
- private boolean sortName = false;
- public FaultComparator() {
- }
- public FaultComparator(boolean sortName) {
- this.sortName = sortName;
- }
-
- public int compare(Object o1, Object o2) {
- if (sortName) {
- QName name1 = ((Fault) o1).getBlock().getName();
- QName name2 = ((Fault) o2).getBlock().getName();
- // Faults that are processed by name first, then type
- if (!name1.equals(name2)) {
- return name1.toString().compareTo(name2.toString());
- }
- }
- JavaStructureType type1 = ((Fault) o1).getJavaException();
- JavaStructureType type2 = ((Fault) o2).getJavaException();
- int result = sort(type1, type2);
- return result;
- }
-
- protected int sort(JavaStructureType type1, JavaStructureType type2) {
- if (type1.getName().equals(type2.getName())) {
- return 0;
- }
- JavaStructureType superType;
- superType = type1.getSuperclass();
- while (superType != null) {
- if (superType.equals(type2)) {
- return -1;
- }
- superType = superType.getSuperclass();
- }
- superType = type2.getSuperclass();
- while (superType != null) {
- if (superType.equals(type1)) {
- return 1;
- }
- superType = superType.getSuperclass();
- }
- if (type1.getSubclasses() == null && type2.getSubclasses() != null)
- return -1;
- if (type1.getSubclasses() != null && type2.getSubclasses() == null)
- return 1;
- if (type1.getSuperclass() != null
- && type2.getSuperclass() == null) {
- return 1;
- }
- if (type1.getSuperclass() == null
- && type2.getSuperclass() != null) {
- return -1;
- }
- return type1.getName().compareTo(type2.getName());
- }
- }
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JAXBTypeGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JAXBTypeGenerator.java
deleted file mode 100644
index a4c201bfa08..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JAXBTypeGenerator.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.generator;
-
-import java.util.Properties;
-
-import org.xml.sax.SAXParseException;
-
-import com.sun.codemodel.internal.CodeWriter;
-import com.sun.codemodel.internal.JCodeModel;
-import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-//import com.sun.tools.internal.xjc.addon.Augmenter;
-import com.sun.tools.internal.xjc.api.ErrorListener;
-import com.sun.tools.internal.xjc.api.JAXBModel;
-import com.sun.tools.internal.xjc.api.S2JJAXBModel;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitStructure;
-import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.tools.internal.ws.wscompile.WSCodeWriter;
-
-/**
- * @author Vivek Pandey
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class JAXBTypeGenerator extends GeneratorBase {
-
- /**
- * @author Vivek Pandey
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
- public static class JAXBErrorListener implements ErrorListener {
-
- /**
- *
- */
- public JAXBErrorListener() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
- */
- public void error(SAXParseException arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
- */
- public void warning(SAXParseException arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see com.sun.tools.internal.xjc.api.ErrorListener#info(org.xml.sax.SAXParseException)
- */
- public void info(SAXParseException arg0) {
- // TODO Auto-generated method stub
-
- }
-
- }
- /**
- *
- */
- public JAXBTypeGenerator() {
- super();
- // TODO Auto-generated constructor stub
- }
- /**
- * @param model
- * @param config
- * @param properties
- */
- public JAXBTypeGenerator(Model model, Configuration config,
- Properties properties) {
- super(model, config, properties);
- }
- /* (non-Javadoc)
- * @see GeneratorBase#getGenerator(com.sun.xml.internal.ws.processor.model.Model, com.sun.xml.internal.ws.processor.config.Configuration, java.util.Properties)
- */
- public GeneratorBase getGenerator(Model model, Configuration config,
- Properties properties) {
- return new JAXBTypeGenerator(model, config, properties);
- }
- /* (non-Javadoc)
- * @see cGeneratorBase#getGenerator(com.sun.xml.internal.ws.processor.model.Model, com.sun.xml.internal.ws.processor.config.Configuration, java.util.Properties, com.sun.xml.internal.ws.soap.SOAPVersion)
- */
- public GeneratorBase getGenerator(Model model, Configuration config,
- Properties properties, SOAPVersion ver) {
- return new JAXBTypeGenerator(model, config, properties);
- }
-
- /* (non-Javadoc)
- * @see JAXBTypeVisitor#visit(JAXBType)
- */
- public void visit(JAXBType type) throws Exception {
- //this is a raw type, probably from rpclit
- if(type.getJaxbModel() == null)
- return;
- S2JJAXBModel model = type.getJaxbModel().getS2JJAXBModel();
- if (model != null)
- generateJAXBClasses(model);
- }
-
-
- /* (non-Javadoc)
- * @see JAXBTypeVisitor#visit(com.sun.xml.internal.ws.processor.model.jaxb.RpcLitStructure)
- */
- public void visit(RpcLitStructure type) throws Exception {
- S2JJAXBModel model = type.getJaxbModel().getS2JJAXBModel();
- generateJAXBClasses(model);
- }
-
- private static boolean doneGeneration = true;
- private void generateJAXBClasses(S2JJAXBModel model) throws Exception{
- if(doneGeneration)
- return;
- JCodeModel cm = null;
-
- // get the list of jaxb source files
- CodeWriter cw = new WSCodeWriter(sourceDir,env);
-
- if(env.verbose())
- cw = new ProgressCodeWriter(cw, System.out); // TODO this should not be System.out, should be
- // something from ProcessorEnvironment
- //TODO:set package level javadoc in JPackage
- cm = model.generateCode(null, new ConsoleErrorReporter(env, printStackTrace));
- cm.build(cw);
- doneGeneration = true;
- }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DivImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java
similarity index 59%
rename from jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DivImpl.java
rename to jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java
index 2b68817a30c..2936437caf8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DivImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,26 +23,26 @@
* have any questions.
*/
-package com.sun.tools.internal.txw2.builder.relaxng;
+package com.sun.tools.internal.ws.processor.generator;
-import com.sun.tools.internal.txw2.model.Grammar;
-import com.sun.tools.internal.txw2.model.Leaf;
-import org.kohsuke.rngom.ast.builder.Div;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
+import com.sun.codemodel.internal.JMethod;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
/**
- * @author Kohsuke Kawaguchi
+ * @author Arun Gupta
*/
-class DivImpl
- extends GrammarSectionImpl
- implements Div {
+public final class JavaGeneratorExtensionFacade extends TJavaGeneratorExtension {
+ private final TJavaGeneratorExtension[] extensions;
- DivImpl(Scope parent, Grammar grammar) {
- super(parent,grammar);
+ JavaGeneratorExtensionFacade(TJavaGeneratorExtension... extensions) {
+ assert extensions != null;
+ this.extensions = extensions;
}
- public void endDiv(LocatorImpl locator, AnnotationsImpl annotations) {
+ public void writeMethodAnnotations(TWSDLOperation wsdlOperation, JMethod jMethod) {
+ for (TJavaGeneratorExtension e : extensions) {
+ e.writeMethodAnnotations(wsdlOperation, jMethod);
+ }
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java
index a768205db37..0d77a452853 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,18 @@
package com.sun.tools.internal.ws.processor.generator;
-import com.sun.tools.internal.ws.processor.model.*;
+import com.sun.tools.internal.ws.processor.model.Fault;
+import com.sun.tools.internal.ws.processor.model.ModelProperties;
+import com.sun.tools.internal.ws.processor.model.Port;
+import com.sun.tools.internal.ws.processor.model.Service;
import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBProperty;
-import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
import com.sun.tools.internal.ws.util.ClassNameInfo;
-import com.sun.xml.internal.ws.streaming.PrefixFactory;
-import com.sun.xml.internal.ws.streaming.PrefixFactoryImpl;
import com.sun.xml.internal.ws.util.StringUtils;
-import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
import javax.xml.namespace.QName;
-import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -50,45 +48,6 @@ import java.util.Map;
*/
public class Names implements GeneratorConstants{
- public Names() {
- }
-
- public String stubFor(Port port, String infix) {
- String result =
- (String) port.getProperty(ModelProperties.PROPERTY_STUB_CLASS_NAME);
- if (result == null) {
- result =
- makeDerivedClassName(
- port.getJavaInterface(),
- STUB_SUFFIX,
- infix);
- }
- return result;
- }
-
- public String tieFor(Port port, String infix) {
- String result =
- (String) port.getProperty(ModelProperties.PROPERTY_TIE_CLASS_NAME);
- if (result == null) {
- result =
- makeDerivedClassName(
- port.getJavaInterface(),
- TIE_SUFFIX,
- infix);
- }
- return result;
- }
-
- public String makeDerivedClassName(
- JavaInterface javaInterface,
- String suffix,
- String infix) {
-
- String name =
- ClassNameInfo.replaceInnerClassSym(javaInterface.getRealName());
- return name + (infix == null ? "" : UNDERSCORE + infix) + suffix;
- }
-
public static String getPortName(Port port) {
String javaPortName =
(String) port.getProperty(ModelProperties.PROPERTY_JAVA_PORT_NAME);
@@ -107,10 +66,6 @@ public class Names implements GeneratorConstants{
}
}
- public static String stripQualifier(Class classObj) {
- String name = classObj.getName();
- return stripQualifier(name);
- }
public static String stripQualifier(String name) {
return ClassNameInfo.getName(name);
@@ -121,147 +76,37 @@ public class Names implements GeneratorConstants{
return packageName != null ? packageName : "";
}
- public static String getUnqualifiedClassName(String className) {
- return ClassNameInfo.getName(className).replace('$', '.');
+
+ public static String customJavaTypeClassName(JavaInterface intf) {
+ return intf.getName();
}
- /**
- * Return the File object that should be used as the source file
- * for the given Java class, using the supplied destination
- * directory for the top of the package hierarchy.
- */
- public File sourceFileForClass(
- String className,
- String outputClassName,
- File destDir,
- ProcessorEnvironment env)
- throws GeneratorException {
- File packageDir =
- DirectoryUtil.getOutputDirectoryFor(className, destDir, env);
- String outputName = stripQualifier(outputClassName);
-
- String outputFileName = outputName + JAVA_SRC_SUFFIX;
- return new File(packageDir, outputFileName);
+ public static String customExceptionClassName(Fault fault) {
+ return fault.getJavaException().getName();
}
- public static String getPackageName(Service service) {
- String portPackage =
- getPackageName(service.getJavaInterface().getName());
- return portPackage;
- }
-
- public String customJavaTypeClassName(JavaInterface intf) {
- String intName = intf.getName();
- return intName;
- }
-
- public String customExceptionClassName(Fault fault) {
- String typeName = fault.getJavaException().getName();
- return typeName;
- }
-
- public String getExceptionClassMemberName(){
+ public static String getExceptionClassMemberName(){
return FAULT_CLASS_MEMBER_NAME;
}
- public String getQNameName(QName name) {
- String qname =
- getPrefix(name) + UNDERSCORE + name.getLocalPart() + QNAME_SUFFIX;
- return validInternalJavaIdentifier(qname);
- }
-
- public String getBlockQNameName(Operation operation, Block block) {
- QName blockName = block.getName();
- String qname = getPrefix(blockName);
- if (operation != null)
- qname += UNDERSCORE + operation.getUniqueName();
- qname += UNDERSCORE + blockName.getLocalPart() + QNAME_SUFFIX;
- return validInternalJavaIdentifier(qname);
- }
-
- public String getTypeQName(QName name) {
- String qname =
- getPrefix(name)
- + UNDERSCORE
- + name.getLocalPart()
- + TYPE_QNAME_SUFFIX;
- return validInternalJavaIdentifier(qname);
- }
-
- /* (non-Javadoc)
- * @see Names#validJavaClassName(String)
- */
- public String validJavaClassName(String name) {
- return JAXBRIContext.mangleNameToClassName(name);
- }
-
- /* (non-Javadoc)
- * @see Names#validJavaMemberName(String)
- */
- public String validJavaMemberName(String name) {
- return JAXBRIContext.mangleNameToVariableName(name);
- }
-
- public String validInternalJavaIdentifier(String name) {
- // return a valid java identifier without dropping characters (i.e. do not apply
- // the mapping of XML names to Java identifiers in the spec); it's only meant
- // to be used to generate internal identifiers (e.g. variable names in generated code)
-
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < name.length(); ++i) {
- char ch = name.charAt(i);
- if (i == 0) {
- if (Character.isJavaIdentifierStart(ch)) {
- sb.append(ch);
- } else {
- sb.append("_$");
- sb.append(Integer.toHexString((int) ch));
- sb.append("$");
- }
- } else {
- if (Character.isJavaIdentifierPart(ch)) {
- sb.append(ch);
- } else {
- sb.append("$");
- sb.append(Integer.toHexString((int) ch));
- sb.append("$");
- }
- }
- }
-
- String id = sb.toString();
-
- String tmp = (String) reservedWords.get(id);
- if (tmp != null)
- id = tmp;
- return id;
- }
-
- public String validExternalJavaIdentifier(String name) {
- return validInternalJavaIdentifier(name).replace('$', '_');
- }
-
- public String validJavaName(String name) {
- name = wordBreakString(name);
- name = removeWhiteSpace(name);
-
- String tmp = (String) reservedWords.get(name);
- if (tmp != null)
- name = tmp;
- return name;
- }
-
- public boolean isJavaReservedWord(String name) {
+ public static boolean isJavaReservedWord(String name) {
return reservedWords.get(name) != null;
}
+ /**
+ * See if its a java keyword name, if so then mangle the name
+ */
+ public static @NotNull String getJavaReserverVarialbeName(@NotNull String name){
+ return (reservedWords.get(name) == null)?name:reservedWords.get(name);
+ }
+
/* here we check on wether return values datatype is
boolean. If its boolean, instead of a get method
its set a is to comply with JavaBeans
Pattern spec */
- public String getJavaMemberReadMethod(JavaStructureMember member) {
- String return_value = null;
- if ((member.getType().getRealName()) == "boolean") {
+ public static String getJavaMemberReadMethod(JavaStructureMember member) {
+ String return_value;
+ if (member.getType().getRealName().equals("boolean")) {
return_value = IS + StringUtils.capitalize(member.getName());
} else {
return_value = GET + StringUtils.capitalize(member.getName());
@@ -269,104 +114,14 @@ public class Names implements GeneratorConstants{
return (return_value);
}
- public String getJavaMemberWriteMethod(JavaStructureMember member) {
- return SET + StringUtils.capitalize(member.getName());
- }
-
public static String getResponseName(String messageName) {
return messageName + RESPONSE;
}
-
- public String getJavaReadMethod(JAXBProperty prop){
- if(prop.getType().getName().equals("boolean"))
- return IS + StringUtils.capitalize(prop.getName());
- return getJavaReadMethod(prop.getName());
- }
-
- public String getJavaWriteMethod(JAXBProperty prop){
- return getJavaWriteMethod(prop.getName());
- }
-
- public String getJavaReadMethod(String prop){
- return GET + StringUtils.capitalize(prop);
- }
-
- public String getJavaWriteMethod(String prop){
- return SET + StringUtils.capitalize(prop);
- }
-
- public String removeWhiteSpace(String str) {
- String tmp = removeCharacter(' ', str);
- return tmp;
- }
-
- public String wordBreakString(String str) {
- StringBuffer buf = new StringBuffer(str);
- char ch;
- for (int i = 0; i < buf.length(); i++) {
- ch = buf.charAt(i);
- if (Character.isDigit(ch)) {
- if (i + 1 < buf.length()
- && !Character.isDigit(buf.charAt(i + 1))) {
- buf.insert(1 + i++, ' ');
- }
- } else if (Character.isSpaceChar(ch) || ch == '_') {
- continue;
- } else if (!Character.isJavaIdentifierPart(ch)) {
- buf.setCharAt(i, ' ');
- } else if (!Character.isLetter(ch)) {
- buf.setCharAt(i, ' ');
- }
- }
- return buf.toString();
- }
-
- public String removeCharacter(int ch, String str) {
- String tmp;
- int idx = str.indexOf(ch);
- while (idx >= 0) {
- str =
- str.substring(0, idx)
- + StringUtils.capitalize(str.substring(idx + 1).trim());
- idx = str.indexOf(' ');
- }
-
- return str;
- }
-
- public String getPrefix(QName name) {
- return getPrefix(name.getNamespaceURI());
- }
-
- public String getPrefix(String uri) {
- return prefixFactory.getPrefix(uri);
- }
-
- public void resetPrefixFactory() {
- prefixFactory = new PrefixFactoryImpl(NS_PREFIX);
- }
-
- public void setSerializerNameInfix(String serNameInfix) {
- if (serNameInfix != null && serNameInfix.length() > 0)
- serializerNameInfix = UNDERSCORE + serNameInfix;
- }
-
- public String getSerializerNameInfix() {
- // Fix for bug 4811625 and 4778136, undoing what setter does (remove beginning underscore)
- String str = serializerNameInfix;
- if ((serializerNameInfix != null)
- && (serializerNameInfix.charAt(0) == '_'))
- str = serializerNameInfix.substring(1);
- return str;
- }
-
- protected String serializerNameInfix = null;
- protected PrefixFactory prefixFactory = new PrefixFactoryImpl(NS_PREFIX);
- protected static Map reservedWords;
+ private static final Map reservedWords;
static {
- reservedWords = new HashMap();
+ reservedWords = new HashMap();
reservedWords.put("abstract", "_abstract");
reservedWords.put("assert", "_assert");
reservedWords.put("boolean", "_boolean");
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java
index 542f1614e5b..79334ed1ce1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,87 +26,58 @@
package com.sun.tools.internal.ws.processor.generator;
import com.sun.codemodel.internal.*;
-import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
import com.sun.tools.internal.ws.processor.model.*;
import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
import com.sun.tools.internal.ws.processor.model.java.JavaMethod;
import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
-import com.sun.tools.internal.ws.processor.util.GeneratedFileInfo;
-import com.sun.tools.internal.ws.processor.util.IndentingWriter;
-import com.sun.tools.internal.ws.wscompile.WSCodeWriter;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.Options;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.wsdl.document.PortType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.ws.Holder;
+import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.namespace.QName;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
+import javax.xml.ws.Holder;
+import java.util.ArrayList;
import java.util.List;
-import java.util.Properties;
-import java.util.Iterator;
-public class SeiGenerator extends GeneratorBase implements ProcessorAction {
- private WSDLModelInfo wsdlModelInfo;
+public class SeiGenerator extends GeneratorBase{
private String serviceNS;
+ private TJavaGeneratorExtension extension;
+ private List extensionHandlers;
- public SeiGenerator() {
+ public static void generate(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions){
+ SeiGenerator seiGenerator = new SeiGenerator(model, options, receiver, extensions);
+ seiGenerator.doGeneration();
}
- protected void doGeneration() {
- try {
- model.accept(this);
- } catch (Exception e) {
- if (env.verbose())
- e.printStackTrace();
- throw new GeneratorException(
- "generator.nestedGeneratorError",
- e);
- }
+ private SeiGenerator(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
+ super(model, options, receiver);
+ extensionHandlers = new ArrayList();
+
+ // register handlers for default extensions
+ //spec does not require generation of these annotations
+ // and we can infer from wsdl anyway, so lets disable it
+ //register(new W3CAddressingJavaGeneratorExtension());
+
+ for (TJavaGeneratorExtension j : extensions)
+ register(j);
+
+ this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[0]));
}
- public GeneratorBase getGenerator(Model model, Configuration config, Properties properties) {
- return new SeiGenerator(model, config, properties);
- }
-
- public SeiGenerator(Model model, Configuration config, Properties properties) {
- super(model, config, properties);
- this.model = model;
- this.wsdlModelInfo = (WSDLModelInfo)config.getModelInfo();
- }
-
- public GeneratorBase getGenerator(Model model, Configuration config, Properties properties, SOAPVersion ver) {
- return new SeiGenerator(model, config, properties);
- }
-
-
- private void write(Service service, Port port) throws Exception{
+ private void write(Port port) {
JavaInterface intf = port.getJavaInterface();
- String className = env.getNames().customJavaTypeClassName(intf);
+ String className = Names.customJavaTypeClassName(intf);
- if (donotOverride && GeneratorUtil.classExists(env, className)) {
+ if (donotOverride && GeneratorUtil.classExists(options, className)) {
log("Class " + className + " exists. Not overriding.");
return;
}
@@ -137,20 +108,24 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
//@WebService
JAnnotationUse webServiceAnn = cls.annotate(cm.ref(WebService.class));
- writeWebServiceAnnotation(service, port, webServiceAnn);
+ writeWebServiceAnnotation(port, webServiceAnn);
//@HandlerChain
- writeHandlerConfig(env.getNames().customJavaTypeClassName(port.getJavaInterface()), cls, wsdlModelInfo);
+ writeHandlerConfig(Names.customJavaTypeClassName(port.getJavaInterface()), cls, options);
//@SOAPBinding
writeSOAPBinding(port, cls);
+ //@XmlSeeAlso
+ if(options.target.isLaterThan(Options.Target.V2_1))
+ writeXmlSeeAlso(cls);
+
for (Operation operation: port.getOperations()) {
JavaMethod method = operation.getJavaMethod();
//@WebMethod
- JMethod m = null;
- JDocComment methodDoc = null;
+ JMethod m;
+ JDocComment methodDoc;
String methodJavaDoc = operation.getJavaDoc();
if(method.getReturnType().getName().equals("void")){
m = cls.method(JMod.PUBLIC, void.class, method.getName());
@@ -169,7 +144,7 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
writeWebMethod(operation, m);
JClass holder = cm.ref(Holder.class);
for (JavaParameter parameter: method.getParametersList()) {
- JVar var = null;
+ JVar var;
JAXBTypeAndAnnotation paramType = parameter.getType().getType();
if (parameter.isHolder()) {
var = m.param(holder.narrow(paramType.getType().boxify()), parameter.getName());
@@ -183,21 +158,38 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
JAnnotationUse paramAnn = var.annotate(cm.ref(WebParam.class));
writeWebParam(operation, parameter, paramAnn);
}
+ com.sun.tools.internal.ws.wsdl.document.Operation wsdlOp = operation.getWSDLPortTypeOperation();
for(Fault fault:operation.getFaultsSet()){
m._throws(fault.getExceptionClass());
methodDoc.addThrows(fault.getExceptionClass());
+ wsdlOp.putFault(fault.getWsdlFaultName(), fault.getExceptionClass());
+ }
+
+ //It should be the last thing to invoke after JMethod is built completely
+ extension.writeMethodAnnotations(wsdlOp, m);
+ }
+ }
+
+ private void writeXmlSeeAlso(JDefinedClass cls) {
+ if (model.getJAXBModel().getS2JJAXBModel() != null) {
+ List objectFactories = model.getJAXBModel().getS2JJAXBModel().getAllObjectFactories();
+
+ //if there are no object facotires, dont generate @XmlSeeAlso
+ if(objectFactories.size() == 0)
+ return;
+
+ JAnnotationUse xmlSeeAlso = cls.annotate(cm.ref(XmlSeeAlso.class));
+ JAnnotationArrayMember paramArray = xmlSeeAlso.paramArray("value");
+ for (JClass of : objectFactories) {
+ paramArray = paramArray.param(of);
}
}
- CodeWriter cw = new WSCodeWriter(sourceDir,env);
- if(env.verbose())
- cw = new ProgressCodeWriter(cw, System.out);
- cm.build(cw);
}
private void writeWebMethod(Operation operation, JMethod m) {
Response response = operation.getResponse();
- JAnnotationUse webMethodAnn = m.annotate(cm.ref(WebMethod.class));;
+ JAnnotationUse webMethodAnn = m.annotate(cm.ref(WebMethod.class));
String operationName = (operation instanceof AsyncOperation)?
((AsyncOperation)operation).getNormalOperation().getName().getLocalPart():
operation.getName().getLocalPart();
@@ -214,7 +206,7 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
m.annotate(javax.jws.Oneway.class);
}else if (!operation.getJavaMethod().getReturnType().getName().equals("void") &&
operation.getResponse().getParametersList().size() > 0){
- Block block = null;
+ Block block;
String resultName = null;
String nsURI = null;
if (operation.getResponse().getBodyBlocks().hasNext()) {
@@ -245,11 +237,9 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
JAnnotationUse wr = null;
if(!resultName.equals("return")){
- if(wr == null)
- wr = m.annotate(javax.jws.WebResult.class);
+ wr = m.annotate(javax.jws.WebResult.class);
wr.param("name", resultName);
}
- //if (operation.getStyle().equals(SOAPStyle.DOCUMENT) && !(nsURI.equals(serviceNS))) {
if((nsURI != null) && (!nsURI.equals(serviceNS) || (isDocStyle && operation.isWrapped()))){
if(wr == null)
wr = m.annotate(javax.jws.WebResult.class);
@@ -298,18 +288,6 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
}
}
- //TODO: JAXB should expose the annotations so that it can be added to JAnnotationUse
- protected void writeJAXBTypeAnnotations(JAnnotationUse annUse, Parameter param) throws IOException{
- List annotations = param.getAnnotations();
- if(annotations == null)
- return;
-
- for(String annotation:param.getAnnotations()){
- //p.pln(annotation);
- //annUse.
- }
- }
-
private boolean isMessageParam(Parameter param, Message message) {
Block block = param.getBlock();
@@ -357,7 +335,7 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
Response res = operation.getResponse();
boolean header = isHeaderParam(param, req) ||
- (res != null ? isHeaderParam(param, res) : false);
+ (res != null && isHeaderParam(param, res));
String name;
boolean isWrapped = operation.isWrapped();
@@ -374,9 +352,9 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
if (isDocStyle) {
ns = param.getBlock().getName().getNamespaceURI(); // its bare nsuri
if(isWrapped){
- ns = ((JAXBType)param.getType()).getName().getNamespaceURI();
+ ns = param.getType().getName().getNamespaceURI();
}
- }else if(!isDocStyle && header){
+ }else if(header){
ns = param.getBlock().getName().getNamespaceURI();
}
@@ -390,7 +368,7 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
if (param.isINOUT()){
paramAnno.param("mode", javax.jws.WebParam.Mode.INOUT);
}else if ((res != null) && (isMessageParam(param, res) || isHeaderParam(param, res) || isAttachmentParam(param, res) ||
- isUnboundParam(param,res))){
+ isUnboundParam(param,res) || param.isOUT())){
paramAnno.param("mode", javax.jws.WebParam.Mode.OUT);
}
@@ -399,14 +377,13 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
paramAnno.param("partName", javaParameter.getParameter().getName());
}
- boolean isDocStyle = true;
- boolean sameParamStyle = true;
+ private boolean isDocStyle = true;
+ private boolean sameParamStyle = true;
private void writeSOAPBinding(Port port, JDefinedClass cls) {
JAnnotationUse soapBindingAnn = null;
- isDocStyle = port.getStyle() != null ? port.getStyle().equals(SOAPStyle.DOCUMENT) : true;
+ isDocStyle = port.getStyle() == null || port.getStyle().equals(SOAPStyle.DOCUMENT);
if(!isDocStyle){
- if(soapBindingAnn == null)
- soapBindingAnn = cls.annotate(SOAPBinding.class);
+ soapBindingAnn = cls.annotate(SOAPBinding.class);
soapBindingAnn.param("style", SOAPBinding.Style.RPC);
port.setWrapped(true);
}
@@ -433,7 +410,7 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
}
}
- private void writeWebServiceAnnotation(Service service, Port port, JAnnotationUse wsa) {
+ private void writeWebServiceAnnotation(Port port, JAnnotationUse wsa) {
QName name = (QName) port.getProperty(ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
wsa.param("name", name.getLocalPart());
wsa.param("targetNamespace", name.getNamespaceURI());
@@ -451,7 +428,7 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
public void visit(Service service) throws Exception {
String jd = model.getJavaDoc();
if(jd != null){
- JPackage pkg = cm._package(wsdlModelInfo.getJavaPackageName());
+ JPackage pkg = cm._package(options.defaultPackage);
pkg.javadoc().add(jd);
}
@@ -467,11 +444,15 @@ public class SeiGenerator extends GeneratorBase implements ProcessorAction {
try {
- write(service, port);
+ write(port);
} catch (Exception e) {
throw new GeneratorException(
"generator.nestedGeneratorError",
e);
}
}
+
+ private void register(TJavaGeneratorExtension h) {
+ extensionHandlers.add(h);
+ }
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java
index 1e2eadbc59a..2cea1189011 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,97 +25,51 @@
package com.sun.tools.internal.ws.processor.generator;
-import com.sun.codemodel.internal.JClassAlreadyExistsException;
-import com.sun.codemodel.internal.ClassType;
-import com.sun.codemodel.internal.CodeWriter;
-import com.sun.codemodel.internal.JAnnotationUse;
-import com.sun.codemodel.internal.JClass;
-import com.sun.codemodel.internal.JCommentPart;
-import com.sun.codemodel.internal.JDefinedClass;
-import com.sun.codemodel.internal.JDocComment;
-import com.sun.codemodel.internal.JExpression;
-import com.sun.codemodel.internal.JFieldVar;
-import com.sun.codemodel.internal.JMethod;
-import com.sun.codemodel.internal.JMod;
-import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.*;
-import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-import java.util.Properties;
-
-import com.sun.tools.internal.xjc.api.XJC;
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
import com.sun.tools.internal.ws.processor.model.Model;
import com.sun.tools.internal.ws.processor.model.Port;
import com.sun.tools.internal.ws.processor.model.Service;
import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.tools.internal.ws.wscompile.WSCodeWriter;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.xml.internal.ws.util.StringUtils;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.Options;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.resources.GeneratorMessages;
import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.ws.util.JAXWSUtils;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.net.MalformedURLException;
+import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
-import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceFeature;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
/**
*
* @author WS Development Team
*/
-public class ServiceGenerator extends GeneratorBase implements ProcessorAction {
- private String serviceNS;
- private WSDLModelInfo wsdlModelInfo;
+public class ServiceGenerator extends GeneratorBase{
- public ServiceGenerator() {
- super();
+ public static void generate(Model model, WsimportOptions options, ErrorReceiver receiver){
+ ServiceGenerator serviceGenerator = new ServiceGenerator(model, options, receiver);
+ serviceGenerator.doGeneration();
}
-
- private ServiceGenerator(
- Model model,
- Configuration config,
- Properties properties) {
- super(model, config, properties);
- this.wsdlModelInfo = (WSDLModelInfo)config.getModelInfo();
- }
-
- public GeneratorBase getGenerator(
- Model model,
- Configuration config,
- Properties properties) {
- return new ServiceGenerator(model, config, properties);
- }
-
- public GeneratorBase getGenerator(
- Model model,
- Configuration config,
- Properties properties,
- SOAPVersion ver) {
- return new ServiceGenerator(model, config, properties);
- }
-
- /**
- * Generates an expression that evaluates to "new QName(...)"
- */
- private JInvocation createQName(QName name) {
- return JExpr._new(cm.ref(QName.class)).arg(name.getNamespaceURI()).arg(name.getLocalPart());
+ private ServiceGenerator(Model model, WsimportOptions options, ErrorReceiver receiver) {
+ super(model, options, receiver);
}
private JInvocation createURL(URL url) {
return JExpr._new(cm.ref(URL.class)).arg(url.toExternalForm());
}
- protected void visitService(Service service) {
+ @Override
+ public void visit(Service service) {
try {
- JavaInterface intf = (JavaInterface) service.getJavaInterface();
- String className = env.getNames().customJavaTypeClassName(intf);
- if (donotOverride && GeneratorUtil.classExists(env, className)) {
+ JavaInterface intf = service.getJavaInterface();
+ String className = Names.customJavaTypeClassName(intf);
+ if (donotOverride && GeneratorUtil.classExists(options, className)) {
log("Class " + className + " exists. Not overriding.");
return;
}
@@ -168,46 +122,70 @@ public class ServiceGenerator extends GeneratorBase implements ProcessorAction {
writeWebServiceClientAnnotation(service, webServiceClientAnn);
//@HandlerChain
- writeHandlerConfig(env.getNames().customJavaTypeClassName(service.getJavaInterface()), cls, wsdlModelInfo);
+ writeHandlerConfig(Names.customJavaTypeClassName(service.getJavaInterface()), cls, options);
for (Port port: service.getPorts()) {
if (port.isProvider()) {
continue; // No getXYZPort() for porvider based endpoint
}
- //@WebEndpoint
- JMethod m = null;
- JDocComment methodDoc = null;
- JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
- m = cls.method(JMod.PUBLIC, retType, port.getPortGetter());
- methodDoc = m.javadoc();
- if(port.getJavaDoc() != null)
- methodDoc.add(port.getJavaDoc());
- JCommentPart ret = methodDoc.addReturn();
- ret.add("returns "+retType.name());
- JBlock body = m.body();
- StringBuffer statement = new StringBuffer("return (");
- statement.append(retType.name());
- statement.append(")super.getPort(new QName(\""+port.getName().getNamespaceURI()+"\", \""+ port.getName().getLocalPart()+"\"), ");
- statement.append(retType.name());
- statement.append(".class);");
- body.directStatement(statement.toString());
- writeWebEndpoint(port, m);
+
+ //write getXyzPort()
+ writeDefaultGetPort(port, cls);
+
+ //write getXyzPort(WebServicesFeature...)
+ if(options.target.isLaterThan(Options.Target.V2_1))
+ writeGetPort(port, cls);
}
- CodeWriter cw = new WSCodeWriter(sourceDir,env);
-
- if(env.verbose())
- cw = new ProgressCodeWriter(cw, System.out);
- cm.build(cw);
-
} catch (IOException e) {
- throw new GeneratorException(
- "generator.nestedGeneratorError",
- e);
+ receiver.error(e);
}
}
+ private void writeGetPort(Port port, JDefinedClass cls) {
+ JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
+ JMethod m = cls.method(JMod.PUBLIC, retType, port.getPortGetter());
+ JDocComment methodDoc = m.javadoc();
+ if(port.getJavaDoc() != null)
+ methodDoc.add(port.getJavaDoc());
+ JCommentPart ret = methodDoc.addReturn();
+ JCommentPart paramDoc = methodDoc.addParam("features");
+ paramDoc.append("A list of ");
+ paramDoc.append("{@link "+WebServiceFeature.class.getName()+"}");
+ paramDoc.append("to configure on the proxy. Supported features not in the features parameter will have their default values.");
+ ret.add("returns "+retType.name());
+ m.varParam(WebServiceFeature.class, "features");
+ JBlock body = m.body();
+ StringBuffer statement = new StringBuffer("return (");
+ statement.append(retType.name());
+ statement.append(")super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+ statement.append(retType.name());
+ statement.append(".class, features);");
+ body.directStatement(statement.toString());
+ writeWebEndpoint(port, m);
+ }
+
+ private void writeDefaultGetPort(Port port, JDefinedClass cls) {
+ JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
+ String portGetter = port.getPortGetter();
+ JMethod m = cls.method(JMod.PUBLIC, retType, portGetter);
+ JDocComment methodDoc = m.javadoc();
+ if(port.getJavaDoc() != null)
+ methodDoc.add(port.getJavaDoc());
+ JCommentPart ret = methodDoc.addReturn();
+ ret.add("returns "+retType.name());
+ JBlock body = m.body();
+ StringBuffer statement = new StringBuffer("return (");
+ statement.append(retType.name());
+ statement.append(")super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+ statement.append(retType.name());
+ statement.append(".class);");
+ body.directStatement(statement.toString());
+ writeWebEndpoint(port, m);
+ }
+
+
protected JDefinedClass getClass(String className, ClassType type) {
- JDefinedClass cls = null;
+ JDefinedClass cls;
try {
cls = cm._class(className, type);
} catch (JClassAlreadyExistsException e){
@@ -218,7 +196,7 @@ public class ServiceGenerator extends GeneratorBase implements ProcessorAction {
private void writeWebServiceClientAnnotation(Service service, JAnnotationUse wsa) {
String serviceName = service.getName().getLocalPart();
- serviceNS = service.getName().getNamespaceURI();
+ String serviceNS= service.getName().getNamespaceURI();
wsa.param("name", serviceName);
wsa.param("targetNamespace", serviceNS);
wsa.param("wsdlLocation", wsdlLocation);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SimpleToBoxedUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SimpleToBoxedUtil.java
deleted file mode 100644
index 20ba880de2b..00000000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SimpleToBoxedUtil.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.generator;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- *
- * @author WS Development Team
- */
-public final class SimpleToBoxedUtil {
-
- public static String getBoxedExpressionOfType(String s, String c) {
- if (isPrimitive(c)) {
- StringBuffer sb = new StringBuffer();
- sb.append("new ");
- sb.append(getBoxedClassName(c));
- sb.append('(');
- sb.append(s);
- sb.append(')');
- return sb.toString();
- } else
- return s;
- }
-
- public static String getUnboxedExpressionOfType(String s, String c) {
- if (isPrimitive(c)) {
- StringBuffer sb = new StringBuffer();
- sb.append('(');
- sb.append(s);
- sb.append(").");
- sb.append(c);
- sb.append("Value()");
- return sb.toString();
- } else
- return s;
- }
-
- public static String convertExpressionFromTypeToType(
- String s,
- String from,
- String to)
- throws Exception {
- if (from.equals(to))
- return s;
- else {
- if (!isPrimitive(to) && isPrimitive(from))
- return getBoxedExpressionOfType(s, from);
- else if (isPrimitive(to) && isPrimitive(from))
- return getUnboxedExpressionOfType(s, to);
- else
- return s;
- }
- }
-
- public static String getBoxedClassName(String className) {
- if (isPrimitive(className)) {
- StringBuffer sb = new StringBuffer();
- sb.append("java.lang.");
- if (className.equals(int.class.getName()))
- sb.append("Integer");
- else if (className.equals(char.class.getName()))
- sb.append("Character");
- else {
- sb.append(Character.toUpperCase(className.charAt(0)));
- sb.append(className.substring(1));
- }
- return sb.toString();
- } else
- return className;
- }
-
- public static boolean isPrimitive(String className) {
- return primitiveSet.contains(className);
- }
-
- static Set primitiveSet = null;
-
- static {
- primitiveSet = new HashSet();
- primitiveSet.add("boolean");
- primitiveSet.add("byte");
- primitiveSet.add("double");
- primitiveSet.add("float");
- primitiveSet.add("int");
- primitiveSet.add("long");
- primitiveSet.add("short");
- }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java
new file mode 100644
index 00000000000..dbc10ddbf8e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: W3CAddressingJavaGeneratorExtension.java,v 1.1.2.4 2006/10/31 19:57:28 vivekp Exp $
+ */
+
+package com.sun.tools.internal.ws.processor.generator;
+
+import com.sun.codemodel.internal.JAnnotationArrayMember;
+import com.sun.codemodel.internal.JAnnotationUse;
+import com.sun.codemodel.internal.JClass;
+import com.sun.codemodel.internal.JMethod;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
+import com.sun.tools.internal.ws.wsdl.document.Fault;
+import com.sun.tools.internal.ws.wsdl.document.Operation;
+
+import javax.xml.ws.Action;
+import javax.xml.ws.FaultAction;
+import java.util.Map;
+
+/**
+ * @author Arun Gupta
+ */
+public class W3CAddressingJavaGeneratorExtension extends TJavaGeneratorExtension {
+ @Override
+ public void writeMethodAnnotations(TWSDLOperation two, JMethod jMethod) {
+ JAnnotationUse actionAnn = null;
+
+ if (!(two instanceof Operation))
+ return;
+
+ Operation o = ((Operation)two);
+
+ // explicit input action
+ if (o.getInput().getAction() != null && !o.getInput().getAction().equals("")) {
+ // explicitly specified
+ actionAnn = jMethod.annotate(Action.class);
+ actionAnn.param("input", o.getInput().getAction());
+ }
+
+ // explicit output action
+ if (o.getOutput() != null && o.getOutput().getAction() != null && !o.getOutput().getAction().equals("")) {
+ // explicitly specified
+ if (actionAnn == null)
+ actionAnn = jMethod.annotate(Action.class);
+
+ actionAnn.param("output", o.getOutput().getAction());
+ }
+
+ // explicit fault action
+ if (o.getFaults() != null && o.getFaults().size() > 0) {
+ Map map = o.getFaults();
+ JAnnotationArrayMember jam = null;
+
+ for (Fault f : o.faults()) {
+ if (f.getAction() == null)
+ continue;
+
+ if (f.getAction().equals(""))
+ continue;
+
+ if (actionAnn == null) {
+ actionAnn = jMethod.annotate(Action.class);
+ }
+ if (jam == null) {
+ jam = actionAnn.paramArray("fault");
+ }
+ final JAnnotationUse faAnn = jam.annotate(FaultAction.class);
+ faAnn.param("className", map.get(f.getName()));
+ faAnn.param("value", f.getAction());
+ }
+ }
+ }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java
index 56aadfb0375..b84bbe0a46f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,15 +25,14 @@
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.processor.model.java.JavaType;
+
+import javax.xml.namespace.QName;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.xml.internal.ws.util.NullIterator;
-
/**
*
* @author WS Development Team
@@ -123,7 +122,7 @@ public abstract class AbstractType {
public Iterator getProperties() {
if (properties == null) {
- return NullIterator.getInstance();
+ return Collections.emptyList().iterator();
} else {
return properties.keySet().iterator();
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java
index 282c3eadb9d..9aa2642241a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,14 @@
*/
package com.sun.tools.internal.ws.processor.model;
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JCodeModel;
+import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
+import com.sun.tools.internal.ws.processor.model.java.JavaType;
+import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
/**
@@ -44,24 +44,24 @@ public class AsyncOperation extends Operation {
/**
*
*/
- public AsyncOperation() {
- super();
+ public AsyncOperation(Entity entity) {
+ super(entity);
// TODO Auto-generated constructor stub
}
/**
* @param operation
*/
- public AsyncOperation(Operation operation) {
- super(operation);
+ public AsyncOperation(Operation operation, Entity entity) {
+ super(operation, entity);
this.operation = operation;
}
/**
* @param name
*/
- public AsyncOperation(QName name) {
- super(name);
+ public AsyncOperation(QName name, Entity entity) {
+ super(name, entity);
// TODO Auto-generated constructor stub
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java
index 28758996eaa..786281d1fd8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@ package com.sun.tools.internal.ws.processor.model;
/**
* @author Vivek Pandey
*
- * Async Operation type
+ * Async WSDLOperation type
*/
public final class AsyncOperationType {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java
index 57328539229..690eb5d3b34 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,10 @@
*/
package com.sun.tools.internal.ws.processor.model;
+
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wsdl.document.*;
+
import javax.xml.namespace.QName;
/**
@@ -37,13 +41,8 @@ public class Block extends ModelObject {
public static final int HEADER = 2;
public static final int ATTACHMENT = 3;
- public Block() {}
-
- public Block(QName name) {
- this.name = name;
- }
-
- public Block(QName name, AbstractType type) {
+ public Block(QName name, AbstractType type, Entity entity) {
+ super(entity);
this.name = name;
this.type = type;
}
@@ -52,10 +51,6 @@ public class Block extends ModelObject {
return name;
}
- public void setName(QName n) {
- name = n;
- }
-
public AbstractType getType() {
return type;
}
@@ -76,16 +71,7 @@ public class Block extends ModelObject {
visitor.visit(this);
}
- private QName name;
+ private final QName name;
private AbstractType type;
private int location;
-
- /**
- * @return true if the block is unbound
- */
- public boolean isUnbound() {
- if(location == UNBOUND)
- return true;
- return false;
- }
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java
index 4897843131c..e2d63deadd0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java
index 4b62705dc38..e5c1f091800 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,26 +24,29 @@
*/
package com.sun.tools.internal.ws.processor.model;
+import com.sun.codemodel.internal.JClass;
+import com.sun.tools.internal.ws.processor.generator.GeneratorUtil;
+import com.sun.tools.internal.ws.processor.model.java.JavaException;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.generator.GeneratorUtil;
-import com.sun.tools.internal.ws.processor.model.java.JavaException;
-import com.sun.codemodel.internal.JClass;
-
/**
*
* @author WS Development Team
*/
public class Fault extends ModelObject {
- public Fault() {}
+ public Fault(Entity entity) {
+ super(entity);
+ }
- public Fault(String name) {
+ public Fault(String name, Entity entity) {
+ super(entity);
this.name = name;
parentFault = null;
}
@@ -80,26 +83,6 @@ public class Fault extends ModelObject {
return parentFault;
}
- public void setParentFault(Fault parentFault) {
- if (this.parentFault != null &&
- parentFault != null &&
- !this.parentFault.equals(parentFault)) {
-
- throw new ModelException("model.parent.fault.already.set",
- new Object[] {
- getName(),
- this.parentFault.getName(),
- parentFault.getName()
- });
- }
- this.parentFault = parentFault;
- }
-
- public void addSubfault(Fault fault) {
- subfaults.add(fault);
- fault.setParentFault(this);
- }
-
public Iterator getSubfaults() {
if (subfaults.size() == 0) {
return null;
@@ -107,12 +90,6 @@ public class Fault extends ModelObject {
return subfaults.iterator();
}
- public Iterator getSortedSubfaults() {
- Set sortedFaults = new TreeSet(new GeneratorUtil.FaultComparator());
- sortedFaults.addAll(subfaults);
- return sortedFaults.iterator();
- }
-
/* serialization */
public Set getSubfaultsSet() {
return subfaults;
@@ -187,4 +164,14 @@ public class Fault extends ModelObject {
private QName elementName = null;
private String javaMemberName = null;
private JClass exceptionClass;
+
+ public String getWsdlFaultName() {
+ return wsdlFaultName;
+ }
+
+ public void setWsdlFaultName(String wsdlFaultName) {
+ this.wsdlFaultName = wsdlFaultName;
+ }
+
+ private String wsdlFaultName;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java
index bf9ad8f0b4d..397c96439c4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,18 @@
*/
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
import javax.xml.namespace.QName;
public class HeaderFault extends Fault {
- public HeaderFault() {}
+ public HeaderFault(Entity entity) {
+ super(entity);
+ }
- public HeaderFault(String name) {
- super(name);
+ public HeaderFault(String name, Entity entity) {
+ super(name, entity);
}
public QName getMessage() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java
index ed807ca7f8b..117aeb35580 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,28 @@
package com.sun.tools.internal.ws.processor.model;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.resources.ModelMessages;
import javax.xml.namespace.QName;
+import java.util.*;
/**
*
* @author WS Development Team
*/
public abstract class Message extends ModelObject {
+ protected Message(com.sun.tools.internal.ws.wsdl.document.Message entity, ErrorReceiver receiver) {
+ super(entity);
+ setErrorReceiver(receiver);
+ }
public void addBodyBlock(Block b) {
if (_bodyBlocks.containsKey(b.getName())) {
- throw new ModelException("model.uniqueness");
+ errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
+ throw new AbortException();
}
_bodyBlocks.put(b.getName(), b);
b.setLocation(Block.BODY);
@@ -85,7 +87,8 @@ public abstract class Message extends ModelObject {
public void addHeaderBlock(Block b) {
if (_headerBlocks.containsKey(b.getName())) {
- throw new ModelException("model.uniqueness");
+ errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
+ throw new AbortException();
}
_headerBlocks.put(b.getName(), b);
b.setLocation(Block.HEADER);
@@ -116,7 +119,8 @@ public abstract class Message extends ModelObject {
/** attachment block */
public void addAttachmentBlock(Block b) {
if (_attachmentBlocks.containsKey(b.getName())) {
- throw new ModelException("model.uniqueness");
+ errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
+ throw new AbortException();
}
_attachmentBlocks.put(b.getName(), b);
b.setLocation(Block.ATTACHMENT);
@@ -169,7 +173,8 @@ public abstract class Message extends ModelObject {
public void addParameter(Parameter p) {
if (_parametersByName.containsKey(p.getName())) {
- throw new ModelException("model.uniqueness");
+ errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(p.getName(), p.getName()));
+ throw new AbortException();
}
_parameters.add(p);
_parametersByName.put(p.getName(), p);
@@ -179,7 +184,7 @@ public abstract class Message extends ModelObject {
if (_parametersByName.size() != _parameters.size()) {
initializeParametersByName();
}
- return (Parameter) _parametersByName.get(name);
+ return _parametersByName.get(name);
}
public Iterator getParameters() {
@@ -203,8 +208,8 @@ public abstract class Message extends ModelObject {
Parameter param = (Parameter) iter.next();
if (param.getName() != null &&
_parametersByName.containsKey(param.getName())) {
-
- throw new ModelException("model.uniqueness");
+ errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getName()));
+ throw new AbortException();
}
_parametersByName.put(param.getName(), param);
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java
index 59ae490000c..ef68703b50a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,11 @@
package com.sun.tools.internal.ws.processor.model;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.EnumSet;
-import javax.xml.namespace.QName;
-
import com.sun.tools.internal.ws.processor.model.jaxb.JAXBModel;
-import com.sun.tools.internal.ws.processor.ProcessorActionVersion;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
+import java.util.*;
/**
* The model is used to represent the entire Web Service. The JAX-WS ProcessorActions can process
@@ -46,10 +39,12 @@ import com.sun.tools.internal.ws.processor.ProcessorActionVersion;
*/
public class Model extends ModelObject {
- public Model() {
+ public Model(Entity entity) {
+ super(entity);
}
- public Model(QName name) {
+ public Model(QName name, Entity entity) {
+ super(entity);
this.name = name;
}
@@ -145,31 +140,6 @@ public class Model extends ModelObject {
source = string;
}
- public ProcessorActionVersion getProcessorActionVersion(){
- return processorActionVersion;
- }
-
- public void setProcessorActionVersion(ProcessorActionVersion version){
- this.processorActionVersion = version;
- }
-
- public void setProcessorActionVersion(String version){
- for(ProcessorActionVersion paVersion : EnumSet.allOf(ProcessorActionVersion.class)){
- switch(paVersion){
- case PRE_20:
- if(version.equals(ProcessorActionVersion.PRE_20.toString()))
- processorActionVersion = ProcessorActionVersion.PRE_20;
- break;
- case VERSION_20:
- if(version.equals(ProcessorActionVersion.VERSION_20.toString()))
- processorActionVersion = ProcessorActionVersion.VERSION_20;
- break;
- default:
- throw new ModelException("model.invalid.processorActionVersion", new Object[]{version});
- }
- }
- }
-
public void setJAXBModel(JAXBModel jaxBModel) {
this.jaxBModel = jaxBModel;
}
@@ -185,5 +155,4 @@ public class Model extends ModelObject {
private Set extraTypes = new HashSet();
private String source;
private JAXBModel jaxBModel = null;
- private ProcessorActionVersion processorActionVersion = ProcessorActionVersion.VERSION_20;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java
index 11b49a7b687..4b14db94f98 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@ public class ModelException extends ProcessorException {
super("model.nestedModelError", arg);
}
- public String getResourceBundleName() {
+ public String getDefaultResourceBundleName() {
return "com.sun.tools.internal.ws.resources.model";
}
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java
index c0c47ea78c4..1f2faebfe93 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,38 @@
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import com.sun.xml.internal.ws.util.NullIterator;
+import org.xml.sax.Locator;
/**
*
* @author WS Development Team
*/
public abstract class ModelObject {
-
public abstract void accept(ModelVisitor visitor) throws Exception;
+ private final Entity entity;
+ protected ErrorReceiver errorReceiver;
+
+ protected ModelObject(Entity entity) {
+ this.entity = entity;
+ }
+
+ public void setErrorReceiver(ErrorReceiver errorReceiver) {
+ this.errorReceiver = errorReceiver;
+ }
+
+ public Entity getEntity() {
+ return entity;
+ }
+
public Object getProperty(String key) {
if (_properties == null) {
return null;
@@ -66,18 +84,20 @@ public abstract class ModelObject {
public Iterator getProperties() {
if (_properties == null) {
- return NullIterator.getInstance();
+ return Collections.emptyList().iterator();
} else {
return _properties.keySet().iterator();
}
}
- /* serialization */
+ public Locator getLocator(){
+ return entity.getLocator();
+ }
+
public Map getPropertiesMap() {
return _properties;
}
- /* serialization */
public void setPropertiesMap(Map m) {
_properties = m;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java
index abea8d62b63..9885f4bc8c8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java
index b28755e7a1a..448cb66a681 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java
index 6b482eee026..48c0453aeab 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@ package com.sun.tools.internal.ws.processor.model;
import com.sun.tools.internal.ws.processor.model.java.JavaMethod;
import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.xml.internal.bind.api.JAXBRIContext;
import javax.xml.namespace.QName;
@@ -41,15 +42,18 @@ import java.util.Set;
*/
public class Operation extends ModelObject {
- public Operation() {}
+ public Operation(Entity entity) {
+ super(entity);
+ }
- public Operation(Operation operation){
- this(operation._name);
+ public Operation(Operation operation, Entity entity){
+ this(operation._name, entity);
this._style = operation._style;
this._use = operation._use;
this.customizedName = operation.customizedName;
}
- public Operation(QName name) {
+ public Operation(QName name, Entity entity) {
+ super(entity);
_name = name;
_uniqueName = name.getLocalPart();
_faultNames = new HashSet();
@@ -226,6 +230,16 @@ public class Operation extends ModelObject {
return JAXBRIContext.mangleNameToVariableName(_name.getLocalPart());
}
+ public com.sun.tools.internal.ws.wsdl.document.Operation getWSDLPortTypeOperation(){
+ return wsdlOperation;
+ }
+
+ public void setWSDLPortTypeOperation(com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation){
+ this.wsdlOperation = wsdlOperation;
+ }
+
+
+
private String customizedName;
private boolean _isWrapped = true;
private QName _name;
@@ -238,5 +252,6 @@ public class Operation extends ModelObject {
private SOAPUse _use = SOAPUse.LITERAL;
private Set _faultNames;
private Set _faults;
+ private com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java
index 4f220acd774..1299de46d96 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,37 @@
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wsdl.document.MessagePart;
+
+import javax.jws.WebParam.Mode;
import java.util.ArrayList;
import java.util.List;
-import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
-import com.sun.xml.internal.ws.model.Mode;
-
/**
*
* @author WS Development Team
*/
public class Parameter extends ModelObject {
+ private final String entityName;
- public Parameter() {}
-
- public Parameter(String name) {
+ public Parameter(String name, Entity entity) {
+ super(entity);
this.name = name;
+ if(entity instanceof com.sun.tools.internal.ws.wsdl.document.Message){
+ this.entityName = ((com.sun.tools.internal.ws.wsdl.document.Message)entity).getName();
+ }else if(entity instanceof MessagePart){
+ this.entityName = ((MessagePart)entity).getName();
+ }else{
+ this.entityName = name;
+ }
+
+ }
+
+
+ public String getEntityName() {
+ return entityName;
}
public String getName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java
index a5680b67227..419d4d16777 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,29 +25,27 @@
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
+import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.config.HandlerChainInfo;
-import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-
/**
- *
* @author WS Development Team
*/
public class Port extends ModelObject {
- public Port() {}
+ public Port(Entity entity) {
+ super(entity);
+ }
- public Port(QName name) {
+ public Port(QName name, Entity entity) {
+ super(entity);
_name = name;
}
@@ -68,15 +66,15 @@ public class Port extends ModelObject {
if (operationsByName.size() != _operations.size()) {
initializeOperationsByName();
}
- return (Operation)operationsByName.get(name);
+ return operationsByName.get(name);
}
private void initializeOperationsByName() {
- operationsByName = new HashMap();
+ operationsByName = new HashMap();
if (_operations != null) {
for (Operation operation : _operations) {
if (operation.getUniqueName() != null &&
- operationsByName.containsKey(operation.getUniqueName())) {
+ operationsByName.containsKey(operation.getUniqueName())) {
throw new ModelException("model.uniqueness");
}
@@ -111,36 +109,6 @@ public class Port extends ModelObject {
_address = s;
}
- public HandlerChainInfo getClientHandlerChainInfo() {
- if (_clientHandlerChainInfo == null) {
- _clientHandlerChainInfo = new HandlerChainInfo();
- }
- return _clientHandlerChainInfo;
- }
-
- public void setClientHandlerChainInfo(HandlerChainInfo i) {
- _clientHandlerChainInfo = i;
- }
-
- public HandlerChainInfo getServerHandlerChainInfo() {
- if (_serverHandlerChainInfo == null) {
- _serverHandlerChainInfo = new HandlerChainInfo();
- }
- return _serverHandlerChainInfo;
- }
-
- public void setServerHandlerChainInfo(HandlerChainInfo i) {
- _serverHandlerChainInfo = i;
- }
-
- public SOAPVersion getSOAPVersion() {
- return _soapVersion;
- }
-
- public void setSOAPVersion(SOAPVersion soapVersion) {
- _soapVersion = soapVersion;
- }
-
public String getServiceImplName() {
return _serviceImplName;
}
@@ -165,16 +133,17 @@ public class Port extends ModelObject {
}
/**
- * XYZ_Service.getABC() method name
- * @return Returns the portGetterName.
- */
+ * XYZ_Service.getABC() method name
+ *
+ * @return Returns the portGetterName.
+ */
public String getPortGetter() {
return portGetter;
}
/**
- * @param portGetterName The portGetterName to set.
- */
+ * @param portGetterName The portGetterName to set.
+ */
public void setPortGetter(String portGetterName) {
this.portGetter = portGetterName;
}
@@ -200,12 +169,9 @@ public class Port extends ModelObject {
private String portGetter;
private QName _name;
- private List _operations = new ArrayList();
+ private List _operations = new ArrayList();
private JavaInterface _javaInterface;
private String _address;
private String _serviceImplName;
- private Map operationsByName = new HashMap();
- private HandlerChainInfo _clientHandlerChainInfo;
- private HandlerChainInfo _serverHandlerChainInfo;
- private SOAPVersion _soapVersion = SOAPVersion.SOAP_11;
+ private Map operationsByName = new HashMap();
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java
index 172704d5753..1c50dee5baa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,18 @@
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
/**
*
* @author WS Development Team
*/
public class Request extends Message {
- public Request() {}
+ public Request(com.sun.tools.internal.ws.wsdl.document.Message entity, ErrorReceiver receiver) {
+ super(entity, receiver);
+ }
public void accept(ModelVisitor visitor) throws Exception {
visitor.visit(this);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java
index a5199b3e127..19349c0ae5b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
package com.sun.tools.internal.ws.processor.model;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -35,7 +38,9 @@ import java.util.Map;
*/
public class Response extends Message {
- public Response() {}
+ public Response(com.sun.tools.internal.ws.wsdl.document.Message entity, ErrorReceiver receiver) {
+ super(entity, receiver);
+ }
public void addFaultBlock(Block b) {
if (_faultBlocks.containsKey(b.getName())) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java
index d3678ce83bc..4f2c06263cb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,14 +26,10 @@
package com.sun.tools.internal.ws.processor.model;
import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
import javax.xml.namespace.QName;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
*
@@ -41,9 +37,12 @@ import java.util.Map;
*/
public class Service extends ModelObject {
- public Service() {}
+ public Service(Entity entity) {
+ super(entity);
+ }
- public Service(QName name, JavaInterface javaInterface) {
+ public Service(QName name, JavaInterface javaInterface, Entity entity) {
+ super(entity);
this.name = name;
this.javaInterface = javaInterface;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java
index 224c60d9b3b..281ba6470f3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java
index 7d8cbd28370..1c172f57933 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java
index 019aedc3818..343d47bd237 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java
index 9bf221f5459..11f98f8c190 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,13 @@
package com.sun.tools.internal.ws.processor.model.java;
+import com.sun.tools.internal.ws.processor.model.ModelException;
+import com.sun.tools.internal.ws.util.ClassNameInfo;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import com.sun.tools.internal.ws.util.ClassNameInfo;
-
-import com.sun.tools.internal.ws.processor.model.ModelException;
-
/**
*
* @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java
index 6999e5c71f7..e0797fdbe30 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,35 @@
package com.sun.tools.internal.ws.processor.model.java;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import com.sun.tools.internal.ws.resources.ModelMessages;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.processor.model.Parameter;
-import com.sun.tools.internal.ws.processor.model.ModelException;
-import com.sun.codemodel.internal.JClass;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
/**
- *
* @author WS Development Team
*/
public class JavaMethod {
- public JavaMethod() {}
+ private final ErrorReceiver errorReceiver;
+ private final String name;
+ private final List parameters = new ArrayList();
+ private final List exceptions = new ArrayList();
+ private JavaType returnType;
- public JavaMethod(String name) {
+ public JavaMethod(String name, ErrorReceiver receiver) {
this.name = name;
this.returnType = null;
+ this.errorReceiver = receiver;
}
public String getName() {
return name;
}
- public void setName(String name) {
- this.name = name;
- }
-
public JavaType getReturnType() {
return returnType;
}
@@ -61,109 +62,48 @@ public class JavaMethod {
this.returnType = returnType;
}
- public boolean hasParameter(String paramName) {
- for (int i=0; i getParameters() {
- return parameters.iterator();
+ public void addParameter(JavaParameter param) {
+ // verify that this member does not already exist
+ if (hasParameter(param.getName())) {
+ errorReceiver.error(param.getParameter().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getParameter().getEntityName()));
+ Parameter duplicParam = getParameter(param.getName());
+ errorReceiver.error(duplicParam.getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), duplicParam.getEntityName()));
+ return;
+ }
+ parameters.add(param);
}
- public int getParameterCount() {
- return parameters.size();
- }
-
- /* serialization */
public List getParametersList() {
return parameters;
}
- /* serialization */
- public void setParametersList(List l) {
- parameters = l;
- }
-
- public boolean hasException(String exception) {
- return exceptions.contains(exception);
- }
-
public void addException(String exception) {
-
// verify that this exception does not already exist
- if (hasException(exception)) {
- throw new ModelException("model.uniqueness");
+ if (!exceptions.contains(exception)) {
+ exceptions.add(exception);
}
- exceptions.add(exception);
}
- public Iterator getExceptions() {
+ /** TODO: NB uses it, remove it once we expose it thru some API **/
+ public Iterator getExceptions() {
return exceptions.iterator();
}
-
- /* serialization */
- public List getExceptionsList() {
- return exceptions;
- }
-
- /* serialization */
- public void setExceptionsList(List l) {
- exceptions = l;
- }
-
- public String getDeclaringClass() {
- return declaringClass;
- }
- public void setDeclaringClass(String declaringClass) {
- this.declaringClass = declaringClass;
- }
-
- // TODO fix model importer/exporter to handle this
- public boolean getThrowsRemoteException() {
- return throwsRemoteException;
- }
- public void setThrowsRemoteException(boolean throwsRemoteException) {
- this.throwsRemoteException = throwsRemoteException;
- }
-
- public void addExceptionClass(JClass ex){
- exceptionClasses.add(ex);
- }
-
- public List getExceptionClasses(){
- return exceptionClasses;
- }
-
- private String name;
- private List parameters = new ArrayList();
- private List exceptions = new ArrayList();
- private List exceptionClasses = new ArrayList();
-
- private JavaType returnType;
- private String declaringClass;
- private boolean throwsRemoteException = true;
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java
index e341b823a8e..cebe5366808 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java
index 678a23477d9..720691400ca 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
package com.sun.tools.internal.ws.processor.model.java;
-import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
/**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java
index c0b08d31f3b..f2c92ded4b2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java
index 907a5269132..c2df0d563e9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,10 @@
package com.sun.tools.internal.ws.processor.model.java;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import com.sun.tools.internal.ws.processor.model.ModelException;
+import java.util.*;
+
/**
*
* @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java
index 87220881bbc..89721ea49d1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
package com.sun.tools.internal.ws.processor.model.java;
-import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
/**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java
index ef242ebe8a0..6a93252a902 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,10 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
+import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
+
import javax.xml.namespace.QName;
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
/**
* @author Kathy Walsh, Vivek Pandey
*
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java
index 6964389396f..17e7d2e27e6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,13 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import java.util.List;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-
import com.sun.tools.internal.xjc.api.Mapping;
import com.sun.tools.internal.xjc.api.Property;
import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.codemodel.internal.JType;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Kohsuke Kawaguchi, Vivek Pandey
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java
index 6fb25cfefa4..0a16d495925 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,12 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import com.sun.tools.internal.xjc.api.*;
+import com.sun.tools.internal.xjc.api.J2SJAXBModel;
+import com.sun.tools.internal.xjc.api.Mapping;
+import com.sun.tools.internal.xjc.api.S2JJAXBModel;
import javax.xml.namespace.QName;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.sun.codemodel.internal.JType;
+import java.util.*;
/**
* Root of the JAXB Model.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java
index 7e7a7c34282..3fe9ed77aed 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,11 +24,10 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import javax.xml.namespace.QName;
-
import com.sun.tools.internal.xjc.api.Property;
-import com.sun.codemodel.internal.JType;
+import javax.xml.namespace.QName;
+
/**
* @author Kohsuke Kawaguchi
*/
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java
index bd5940bddb7..a9dbdf32fbe 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,12 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
import com.sun.tools.internal.ws.processor.model.ModelException;
import com.sun.tools.internal.ws.processor.model.java.JavaStructureType;
+import javax.xml.namespace.QName;
+import java.util.*;
+
/**
* Top-level binding between JAXB generated Java type
* and XML Schema element declaration.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java
index ad3462807d8..665ce7ad3d5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@ package com.sun.tools.internal.ws.processor.model.jaxb;
import com.sun.tools.internal.ws.processor.model.AbstractType;
import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.codemodel.internal.JType;
import javax.xml.namespace.QName;
import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
index cfa340cb5d2..07be64ed56a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,9 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JAnnotatable;
+import com.sun.codemodel.internal.JType;
+import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
/**
* Holds JAXB JType and TypeAndAnnotation. This provides abstration over
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java
index 94fba8bc641..e1926580680 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java
index 0e4d6fbd832..70fb9188582 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import javax.xml.namespace.QName;
-
import com.sun.tools.internal.ws.processor.model.AbstractType;
+import javax.xml.namespace.QName;
+
/**
* @author Vivek Pandey
*
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java
index 17d58c719c7..095eb682837 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,11 @@
*/
package com.sun.tools.internal.ws.processor.model.jaxb;
-import java.util.ArrayList;
-import java.util.List;
+import com.sun.tools.internal.ws.processor.model.AbstractType;
import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.AbstractType;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Vivek Pandey
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java
index 5fb77a7dd8b..c96e2c42b15 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java
index 44243e7bfb0..71df3cc5ae0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
package com.sun.tools.internal.ws.processor.modeler;
+import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
+
import java.util.HashMap;
import java.util.Map;
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
-import com.sun.xml.internal.ws.util.VersionUtil;
-
/**
*
* @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java
index 88091d0631e..539de36abc3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java
index 1362f84c091..ec280f47053 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java
index 2f853499d72..b0953aa5762 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@ public class ModelerException extends ProcessorException {
super("modeler.nestedModelError", arg);
}
- public String getResourceBundleName() {
+ public String getDefaultResourceBundleName() {
return "com.sun.tools.internal.ws.resources.modeler";
}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java
index eaeb8145f8f..c6c3750c6d7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java
@@ -1,5 +1,5 @@
/*
- * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,28 +24,18 @@
*/
package com.sun.tools.internal.ws.processor.modeler.annotation;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
import com.sun.mirror.declaration.MethodDeclaration;
import com.sun.mirror.declaration.ParameterDeclaration;
import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.type.TypeMirror;
import com.sun.tools.internal.ws.processor.model.Model;
import com.sun.tools.internal.ws.processor.model.Operation;
import com.sun.tools.internal.ws.processor.model.Port;
import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBModel;
import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-import com.sun.tools.internal.xjc.api.Reference;
-
-import javax.xml.namespace.QName;
-
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
/**
@@ -85,14 +75,6 @@ public class AnnotationProcessorContext {
return seiContextMap.values();
}
- public boolean allEncoded() {
- for (SEIContext seiContext : seiContextMap.values()) {
- if (!isEncoded(seiContext.getModel()))
- return false;
- }
- return true;
- }
-
public int getRound() {
return round;
}
@@ -128,23 +110,15 @@ public class AnnotationProcessorContext {
private Map resOperationWrapperMap;
private Map exceptionBeanMap;
- private Model model;
- private Map