use of com.spectralogic.ds3autogen.net.generators.parsers.element.NullableElement in project ds3_autogen by SpectraLogic.
the class BaseTypeParserGenerator_Test method toNullableElementsList_FullList_Test.
@Test
public void toNullableElementsList_FullList_Test() {
final ImmutableList<Ds3Element> elements = ImmutableList.of(new Ds3Element("Name1", "int", "", false), new Ds3Element("Name2", "Type", "Component", false));
final ImmutableList<NullableElement> result = generator.toNullableElementsList(elements, false);
assertThat(result.size(), is(2));
assertThat(result.get(0), instanceOf(BaseNullableElement.class));
assertThat(result.get(1), instanceOf(NullableListElement.class));
}
use of com.spectralogic.ds3autogen.net.generators.parsers.element.NullableElement in project ds3_autogen by SpectraLogic.
the class BaseTypeParserGenerator_Test method toNullableElement_Test.
@Test
public void toNullableElement_Test() {
final Ds3Element element = new Ds3Element("Name", "int", "", false);
final NullableElement result = toNullableElement(element, false);
assertThat(result, instanceOf(BaseNullableElement.class));
}
use of com.spectralogic.ds3autogen.net.generators.parsers.element.NullableElement in project ds3_autogen by SpectraLogic.
the class JobListParserGenerator_Test method toJobsNullableElement_Test.
@Test
public void toJobsNullableElement_Test() {
final NullableElement result = toJobsNullableElement(getJobsElement());
assertThat(result, instanceOf(NullableListElement.class));
assertThat(result.printParseElement(), is("Jobs = element.Elements(\"Job\").Select(ParseJobList).ToList()"));
}
use of com.spectralogic.ds3autogen.net.generators.parsers.element.NullableElement in project ds3_autogen by SpectraLogic.
the class BaseTypeParserGenerator method toParseElements.
/**
* Converts a list of Ds3Elements into their .net parsing code
*/
@Override
public ImmutableList<String> toParseElements(final ImmutableList<Ds3Element> ds3Elements, final boolean isObjectsType) {
final ImmutableList<NullableElement> elements = toNullableElementsList(ds3Elements, isObjectsType);
if (isEmpty(elements)) {
return ImmutableList.of();
}
final ImmutableList.Builder<String> builder = ImmutableList.builder();
for (final NullableElement nullableElement : elements) {
builder.add(nullableElement.printParseElement());
}
return builder.build();
}
Aggregations