/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
*
* <p>
* It uses JAXB's {@link AnnotationReader}, {@link Navigator} so that
* tools can use this with APT, and the runtime can use this with
* reflection.
*
* @author Jitendra Kotamraju
*/
private static final Logger LOGGER = Logger.getLogger(AbstractWrapperBeanGenerator.class.getName());
XmlList.class, XmlElement.class
};
static{
}
}
public static interface BeanMemberFactory<T,A> {
}
// Collects the JAXB annotations on a method
}
}
return jaxbAnnotation;
}
// Collects the JAXB annotations on a parameter
}
}
return jaxbAnnotation;
}
/**
* Returns Holder's value type.
*
* @return null if it not a Holder, otherwise return Holder's value type
*/
/**
* Computes request bean members for a method. Collects all IN and INOUT
* parameters as request bean fields. In this process, if a parameter
* has any known JAXB annotations they are collected as well.
* Special processing for @XmlElement annotation is done.
*
* @param method SEI method for which request bean members are computed
* @return List of request bean members
*/
int paramIndex = -1;
paramIndex++;
WebParam webParam = annReader.getMethodParameterAnnotation(WebParam.class, method, paramIndex, null);
continue;
}
// Should we flag an error - holder cannot be IN part ??
continue;
}
// Collect JAXB annotations on a parameter
// If a parameter contains @XmlElement, process it.
}
return requestMembers;
}
/**
* Computes response bean members for a method. Collects all OUT and INOUT
* parameters as response bean fields. In this process, if a parameter
* has any known JAXB annotations they are collected as well.
* Special processing for @XmlElement annotation is done.
*
* @param method SEI method for which response bean members are computed
* @return List of response bean members
*/
// return that need to be part response wrapper bean
boolean isResultHeader = false;
}
}
}
responseMembers.add(factory.createWrapperBeanMember(returnType, getPropertyName(responseElementName), jaxbRespAnnotations));
}
// Now parameters that need to be part response wrapper bean
int paramIndex = -1;
paramIndex++;
WebParam webParam = annReader.getMethodParameterAnnotation(WebParam.class, method, paramIndex, null);
continue; // not a holder or a header - so don't add it
}
}
return responseMembers;
}
for (Annotation a : jaxb) {
if (a.annotationType() == XmlElement.class) {
elemAnn = (XmlElement) a;
break;
}
}
XmlElement elem = (XmlElement) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[]{XmlElement.class}, handler);
}
private boolean nillable;
private boolean required;
boolean required) {
}
return name;
return namespace;
return nillable;
return required;
} else {
}
}
}
/**
* Computes and sorts exception bean members for a given exception as per
* the 3.7 section of the spec. It takes all getter properties in the
* exception and its superclasses(except getCause, getLocalizedMessage,
* getStackTrace, getClass). The returned collection is sorted based
* on the property names.
*
* <p>
* But if the exception has @XmlType its values are honored. Only the
* propOrder properties are considered. The returned collection is sorted
* as per the given propOrder.
*
* @param exception
* @return list of properties in the correct order for an exception bean
*/
// Consider only the @XmlType(propOrder) properties
// If not the default order of properties, use that propOrder
if (a != null) {
} else {
" has @XmlType and its propOrder contains unknown property "+prop);
}
}
return list;
}
}
}
}
// 2.1.x is doing the following: no final static, transient, non-public
// transient cannot used as modifier for method, so not doing it now
continue;
}
continue;
}
// Don't bother with invalid propertyNames.
continue;
}
fields.put(fieldName, factory.createWrapperBeanMember(returnType, fieldName, Collections.<Annotation>emptyList()));
}
}
}
/**
* Gets the property name by mangling using JAX-WS rules
* @param name to be mangled
* @return property name
*/
//We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
//care of mangling java identifiers
return getJavaReservedVarialbeName(propertyName);
}
//TODO MOVE Names.java to runtime (instead of doing the following)
/*
* See if its a java keyword name, if so then mangle the name
*/
}
static {
}
}