Examples of required()


Examples of com.hannesdorfmann.fragmentargs.annotation.Arg.required()

    return getVariableName(field);
  }

  private static boolean isRequired(Element element) {
    Arg annotation = element.getAnnotation(Arg.class);
    return annotation.required();
  }
}
View Full Code Here

Examples of com.sun.tools.internal.xjc.generator.annotation.spec.XmlAttributeWriter.required()

            xaw.namespace(generatedNS);
        }

        // generate required property?
        if(ap.isRequired()) {
            xaw.required(true);
        }
    }

    /**
     * Useful base class for implementing {@link FieldAccessor}.
View Full Code Here

Examples of com.sun.tools.internal.xjc.generator.annotation.spec.XmlElementRefWriter.required()

            CElement e = elements.iterator().next();
            refw.name(e.getElementName().getLocalPart())
                .namespace(e.getElementName().getNamespaceURI())
                .type(e.getType().toType(outline.parent(),IMPLEMENTATION));
            if(getOptions().target.isLaterThan(SpecVersion.V2_2))
                refw.required(rp.isRequired());
        } else
        if(elements.size()>1) {
            XmlElementRefsWriter refsw = field.annotate2(XmlElementRefsWriter.class);
            for( CElement e : elements ) {
                refw = refsw.value();
View Full Code Here

Examples of com.sun.tools.internal.xjc.generator.annotation.spec.XmlElementWriter.required()

        // generate the required() property?
        CElementPropertyInfo ep = (CElementPropertyInfo) prop;
        if(ep.isRequired() && exposedType.isReference()) {
            if(xew == null) xew = getXew(checkWrapper, field);
            xew.required(true);
        }

        // generate the type property?

        // I'm not too sure if this is the right place to handle this, but
View Full Code Here

Examples of com.sun.tools.xjc.generator.annotation.spec.XmlAttributeWriter.required()

            xaw.namespace(generatedNS);
        }

        // generate required property?
        if(ap.isRequired()) {
            xaw.required(true);
        }
    }

    /**
     * Useful base class for implementing {@link FieldAccessor}.
View Full Code Here

Examples of com.sun.tools.xjc.generator.annotation.spec.XmlElementRefWriter.required()

            CElement e = elements.iterator().next();
            refw.name(e.getElementName().getLocalPart())
                .namespace(e.getElementName().getNamespaceURI())
                .type(e.getType().toType(outline.parent(),IMPLEMENTATION));
            if(getOptions().target.isLaterThan(SpecVersion.V2_2))
                refw.required(rp.isRequired());
        } else
        if(elements.size()>1) {
            XmlElementRefsWriter refsw = field.annotate2(XmlElementRefsWriter.class);
            for( CElement e : elements ) {
                refw = refsw.value();
View Full Code Here

Examples of com.sun.tools.xjc.generator.annotation.spec.XmlElementWriter.required()

        // generate the required() property?
        CElementPropertyInfo ep = (CElementPropertyInfo) prop;
        if(ep.isRequired() && exposedType.isReference()) {
            if(xew == null) xew = getXew(checkWrapper, field);
            xew.required(true);
        }

        // generate the type property?

        // I'm not too sure if this is the right place to handle this, but
View Full Code Here

Examples of com.wordnik.swagger.annotations.ApiModelProperty.required()

                // need to get true data type
                type = getActualDataType(aClass, name);
            }

            assertEquals(aClass.toString() + " type", type, item.getType());
            assertEquals(aClass.toString() + " required", a.required(), item.isRequired());
            assertEquals(aClass.toString() + " value", a.value(), nullToEmpty(item.getDescription()));
            assertEquals(aClass.toString() + " allowableValues", stringToList(a.allowableValues(), ","), stringToList(item.getAllowableValue(), ","));
        }
    }
View Full Code Here

Examples of com.wordnik.swagger.annotations.ApiParam.required()

            for (Annotation annotation : annotations) {
                if (annotation instanceof ApiParam) {
                    ApiParam apiParam = (ApiParam) annotation;
                    parameter.put("name", apiParam.name());
                    parameter.put("description", apiParam.value());
                    parameter.put("required", apiParam.required());
                    param.setName(apiParam.name());
                    param.setDescription(apiParam.value());
                    param.setIsRequired(apiParam.required());

                    Type parameterClass = method.getGenericParameterTypes()[i];
View Full Code Here

Examples of com.wordnik.swagger.model.Parameter.required()

        assertEquals(1, parameters.size());

        Parameter documentationParameter = parameters.get(0);

        assertEquals("ownerName", documentationParameter.name());
        assertEquals(true, documentationParameter.required());
        assertEquals(ApiValues.TYPE_PATH(), documentationParameter.paramType());
        assertEquals("string", documentationParameter.dataType());
//        assertEquals(String.class.getName(), documentationParameter.getValueTypeInternal());
        assertEquals(false, documentationParameter.allowMultiple());
        assertEquals("Owner name", documentationParameter.description().get());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.