use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.
the class NullableVariableUtil_Test method isNullableElement_NoOptionalAnnotation_Test.
@Test
public void isNullableElement_NoOptionalAnnotation_Test() {
final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.db.lang.References", null), new Ds3Annotation("com.spectralogic.util.db.lang.CascadeDelete", null));
assertFalse(isNullableElement("MyType", annotations));
assertTrue(isNullableElement("java.lang.Integer", annotations));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.
the class Element method toDs3Element.
public Ds3Element toDs3Element() {
final ImmutableList<Ds3Annotation> ds3Annotations = toDs3Annotations();
final Ds3Element ds3Element = new Ds3Element(name, type, componentType, ds3Annotations, isNullableElement(type, ds3Annotations));
return ds3Element;
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElement_EnumElement_Test.
@Test
public void toElement_EnumElement_Test() {
final Ds3Element ds3Element = new Ds3Element("TestElement", "java.lang.Integer", null, ImmutableList.of(new Ds3Annotation("com.spectralogic.util.bean.lang.Optional", null)), true);
final NetNullableVariable result = generator.toElement(ds3Element, ImmutableMap.of());
assertThat(result.getName(), is("TestElement"));
assertThat(result.getNetType(), is("int?"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method containsOptionalAnnotation_WithoutOptional_Test.
@Test
public void containsOptionalAnnotation_WithoutOptional_Test() {
final ImmutableList<Ds3Annotation> annotations = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", null), new Ds3Annotation("com.spectralogic.util.marshal.ExcludeFromMarshaler", null));
assertFalse(containsOptionalAnnotation(annotations));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toXmlNotation_LowerCasedAnnotations_Test.
@Test
public void toXmlNotation_LowerCasedAnnotations_Test() {
final Ds3Element lowerCasedElement = new Ds3Element("lowerCasedElement", "Type", "", ImmutableList.of(new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", ImmutableList.of(new Ds3AnnotationElement("CollectionValue", "lowerCasedOuterTag", "java.lang.String"), new Ds3AnnotationElement("Value", "lowerCasedInnerTag", "java.lang.String")))), false);
final String result = generator.toXmlNotation(lowerCasedElement);
assertThat(result, is("xml:\"LowerCasedOuterTag>LowerCasedInnerTag\""));
}
Aggregations