jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertyGetterBase.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.xml.internal.ws.spi.db; |
26 package com.sun.xml.internal.ws.spi.db; |
27 |
27 |
|
28 import javax.xml.ws.WebServiceException; |
|
29 |
28 /** |
30 /** |
29 * This is the Gtter of a bean property. |
31 * This is the Gtter of a bean property. |
30 * |
32 * |
31 * @author shih-chang.chen@oracle.com |
33 * @author shih-chang.chen@oracle.com |
32 * @exclude |
34 * @exclude |
44 method.getParameterTypes().length == 0)) { |
46 method.getParameterTypes().length == 0)) { |
45 if (method.getName().startsWith("get") && |
47 if (method.getName().startsWith("get") && |
46 method.getName().length() > 3) { |
48 method.getName().length() > 3) { |
47 return true; |
49 return true; |
48 } else { |
50 } else { |
49 if (method.getReturnType().equals(boolean.class) && |
51 if ((method.getReturnType().equals(boolean.class) || method.getReturnType().equals(Boolean.class)) && |
50 method.getName().startsWith("is") && |
52 method.getName().startsWith("is") && |
51 method.getName().length() > 2) { |
53 method.getName().length() > 2) { |
52 return true; |
54 return true; |
53 } |
55 } |
54 } |
56 } |
55 } |
57 } |
56 return false; |
58 return false; |
57 } |
59 } |
|
60 |
|
61 static void verifyWrapperType(Class wrapperType) { |
|
62 String className = wrapperType.getName(); |
|
63 if (className.startsWith("java.") || className.startsWith("javax.")) { |
|
64 throw new WebServiceException("Invalid wrapper type " + className); |
|
65 } |
|
66 } |
58 } |
67 } |