property.setGetMethodName(getMethod.getName());
property.setSetMethodName(setMethodName);
property.setMethodProperty(true);
JavaClass ptype = property.getType();
if (helper.isAnnotationPresent(property.getElement(), XmlJavaTypeAdapter.class)) {
XmlJavaTypeAdapter adapter = (XmlJavaTypeAdapter) helper.getAnnotation(property.getElement(), XmlJavaTypeAdapter.class);
property.setAdapterClass(adapter.value());
} else if (info.getAdaptersByClass().get(ptype) != null) {
property.setAdapterClass(info.getAdaptersByClass().get(ptype));
}
if (property.hasAdapterClass()) {
ptype = property.getValueType();
}
// Get schema-type info if specified and set it on the property for later use:
if (helper.isAnnotationPresent(property.getElement(), XmlSchemaType.class)) {
XmlSchemaType schemaType = (XmlSchemaType) helper.getAnnotation(property.getElement(), XmlSchemaType.class);
QName schemaTypeQname = new QName(XMLConstants.SCHEMA_INSTANCE_URL, schemaType.name());
property.setSchemaType(schemaTypeQname);
}
if (helper.isAnnotationPresent(property.getElement(), XmlAttachmentRef.class) && areEquals(ptype, JAVAX_ACTIVATION_DATAHANDLER)) {
property.setIsSwaAttachmentRef(true);
property.setSchemaType(XMLConstants.SWA_REF_QNAME);
} else if (areEquals(ptype, JAVAX_ACTIVATION_DATAHANDLER) || areEquals(ptype, byte[].class) || areEquals(ptype, Byte[].class) || areEquals(ptype, Image.class) || areEquals(ptype, Source.class) || areEquals(ptype, JAVAX_MAIL_INTERNET_MIMEMULTIPART)) {
property.setIsMtomAttachment(true);
property.setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
}
if (helper.isAnnotationPresent(property.getElement(), XmlMimeType.class)) {
property.setMimeType(((XmlMimeType) helper.getAnnotation(property.getElement(), XmlMimeType.class)).value());
}
if (helper.isAnnotationPresent(property.getElement(), XmlJavaTypeAdapter.class)) {
XmlJavaTypeAdapter adapter = (XmlJavaTypeAdapter) helper.getAnnotation(property.getElement(), XmlJavaTypeAdapter.class);
property.setAdapterClass(adapter.value());
} else if(info.getAdaptersByClass().get(ptype) != null) {
property.setAdapterClass(info.getAdaptersByClass().get(ptype));
}
if(helper.isAnnotationPresent(property.getElement(), XmlAttribute.class)) {
property.setIsAttribute(true);