public boolean required() { return core.required(); }
if (xmlElement != null && !xmlElement.required()) { result.add(f);
public boolean required() { return core.required(); }
@Override public Boolean hasRequiredMarker(AnnotatedMember m) { XmlElement elem = m.getAnnotation(XmlElement.class); if (elem != null) { if (elem.required()) { return true; } } JsonProperty jsonProperty = m.getAnnotation(JsonProperty.class); if (jsonProperty != null) { if (jsonProperty.required()) { return true; } } Schema ann = m.getAnnotation(Schema.class); if (ann != null) { if (ann.required()) { return ann.required(); } } ArraySchema arraySchema = m.getAnnotation(ArraySchema.class); if (arraySchema != null) { if (arraySchema.schema().required()) { return arraySchema.schema().required(); } } return null; }
if (nav().isSameType(type, nav().ref(XmlElement.DEFAULT.class))) type = getIndividualType(); if((!nav().isPrimitive(type) || isCollection()) && !item.required()) isRequired = false; types.add(createTypeRef(name, type, item.nillable(), getDefaultValue(item.defaultValue()) ));
public Long getWrapperPartMinOccurs(MessagePartInfo mpi) { Annotation[] a = (Annotation[])mpi.getProperty(ReflectionServiceFactoryBean.PARAM_ANNOTATION); if (a != null) { for (Annotation a2 : a) { if (a2 instanceof XmlElement) { XmlElement e = (XmlElement)a2; if (e.required()) { return 1L; } } } } return null; }
@Override public Boolean hasRequiredMarker(AnnotatedMember m) { // 17-Oct-2017, tatu: [modules-base#32] // Before 2.9.3, was handling `true` correctly, // but otherwise used confusing logic (probably in attempt to try to avoid // reporting not-required for default value case XmlAttribute attr = m.getAnnotation(XmlAttribute.class); if (attr != null) { return attr.required(); } XmlElement elem = m.getAnnotation(XmlElement.class); if (elem != null) { return elem.required(); } return null; }
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = false; if (xmlElement != null) { required = xmlElement.required(); } return required; }
// iterate over the fields in the required class. check if the annotatino is present if (inputField.isAnnotationPresent(XmlElement.class)) { XmlElement xmlElementAnnotation = inputField.getAnnotation(XmlElement.class); // get 'required' value if(xmlElementAnnotation.required()) { // logic } }
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = false; if (xmlElement != null) { required = xmlElement.required(); } return required; }
public boolean required() { return core.required(); }
if (nav().isSameType(type, nav().ref(XmlElement.DEFAULT.class))) type = getIndividualType(); if((!nav().isPrimitive(type) || isCollection()) && !item.required()) isRequired = false; types.add(createTypeRef(name, type, item.nillable(), getDefaultValue(item.defaultValue()) ));
static class JaxbUtil { static <T> T copy(Class<T> cls, T obj) throws InstantiationException, IllegalAccessException{ T copy = cls.newInstance(); for(Field f:cls.getDeclaredFields()){ XmlElement annotation = f.getAnnotation(XmlElement.class); if(annotation != null && annotation.required()){ f.setAccessible(true); f.set(copy, f.get(obj)); } } return copy; } }
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = BeanValidationUtils.isNotNull(this); if (xmlElement != null && !required) { required = xmlElement.required(); } return required; }
@Override public Boolean hasRequiredMarker(AnnotatedMember m) { XmlElement annotation = m.getAnnotation(XmlElement.class); return annotation == null ? null : Boolean.valueOf(annotation.required()); }
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = BeanValidationUtils.isNotNull(this); if (xmlElement != null && !required) { required = xmlElement.required(); } return required; }
@Override public Boolean hasRequiredMarker(AnnotatedMember m) { XmlElement annotation = m.getAnnotation(XmlElement.class); return annotation == null ? null : Boolean.valueOf(annotation.required()); }
public Long getWrapperPartMinOccurs(MessagePartInfo mpi) { Annotation[] a = (Annotation[])mpi.getProperty(ReflectionServiceFactoryBean.PARAM_ANNOTATION); if (a != null) { for (Annotation a2 : a) { if (a2 instanceof XmlElement) { XmlElement e = (XmlElement)a2; if (e.required()) { return 1L; } } } } return null; }
av0.visit("required", el.required()); av0.visit("namespace", el.namespace()); av0.visit("defaultValue", el.defaultValue());
/** * The min occurs of this parameter as a child element. * * @return 1 if primitive. 0 otherwise. */ public int getMinOccurs() { DecoratedTypeMirror paramType = (DecoratedTypeMirror) getType(); XmlElement xmlElement = delegate.getAnnotation(XmlElement.class); boolean required = xmlElement!=null ? xmlElement.required() : false; return (paramType.isPrimitive() || required || BeanValidationUtils.isNotNull(this) ) ? 1 : 0; }