target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void nameWithDot() { assertEquals("FunImpl", Names.typeName("lib.Fun", "Impl")); }
public static String typeName(String... name) { if (name.length == 1 && isBlank(name[0])) { return "Root"; } List<String> values = new ArrayList<>(); int i = 0; for (String s : name) { String value = buildPart(i, s, NameFixer.CAMEL_UPPER); values.add(value); i++; } return Joiner.on("").join(values); }
Names { public static String typeName(String... name) { if (name.length == 1 && isBlank(name[0])) { return "Root"; } List<String> values = new ArrayList<>(); int i = 0; for (String s : name) { String value = buildPart(i, s, NameFixer.CAMEL_UPPER); values.add(value); i++; } return Joiner.on("").join(values); } }
Names { public static String typeName(String... name) { if (name.length == 1 && isBlank(name[0])) { return "Root"; } List<String> values = new ArrayList<>(); int i = 0; for (String s : name) { String value = buildPart(i, s, NameFixer.CAMEL_UPPER); values.add(value); i++; } return Joiner.on("").join(values); } private ...
Names { public static String typeName(String... name) { if (name.length == 1 && isBlank(name[0])) { return "Root"; } List<String> values = new ArrayList<>(); int i = 0; for (String s : name) { String value = buildPart(i, s, NameFixer.CAMEL_UPPER); values.add(value); i++; } return Joiner.on("").join(values); } private ...
Names { public static String typeName(String... name) { if (name.length == 1 && isBlank(name[0])) { return "Root"; } List<String> values = new ArrayList<>(); int i = 0; for (String s : name) { String value = buildPart(i, s, NameFixer.CAMEL_UPPER); values.add(value); i++; } return Joiner.on("").join(values); } private ...
@Test public void scalarType() throws Exception { PojoToRamlImpl pojoToRaml = new PojoToRamlImpl(FieldClassParser.factory(), AdjusterFactory.NULL_FACTORY); Result types = pojoToRaml.classToRaml(String.class); Api api = createApi(types); List<TypeDeclaration> buildTypes = api.types(); assertEquals(0, buildTypes.size());...
@Override public Result classToRaml(final Class<?> clazz) { RamlType type = RamlTypeFactory.forType(clazz, classParserFactory.createParser(clazz), adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return new Result(null, Collections.<String, TypeDeclarationBuilder>emptyMap()); } Map<String, Type...
PojoToRamlImpl implements PojoToRaml { @Override public Result classToRaml(final Class<?> clazz) { RamlType type = RamlTypeFactory.forType(clazz, classParserFactory.createParser(clazz), adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return new Result(null, Collections.<String, TypeDeclaration...
PojoToRamlImpl implements PojoToRaml { @Override public Result classToRaml(final Class<?> clazz) { RamlType type = RamlTypeFactory.forType(clazz, classParserFactory.createParser(clazz), adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return new Result(null, Collections.<String, TypeDeclaration...
PojoToRamlImpl implements PojoToRaml { @Override public Result classToRaml(final Class<?> clazz) { RamlType type = RamlTypeFactory.forType(clazz, classParserFactory.createParser(clazz), adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return new Result(null, Collections.<String, TypeDeclaration...
PojoToRamlImpl implements PojoToRaml { @Override public Result classToRaml(final Class<?> clazz) { RamlType type = RamlTypeFactory.forType(clazz, classParserFactory.createParser(clazz), adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return new Result(null, Collections.<String, TypeDeclaration...
@Test public void className() { RenamePlugin plugin = new RenamePlugin(Arrays.asList("One", "OneImplementation")); ClassName cn = plugin.className((ObjectPluginContext) null, null, ClassName.bestGuess("fun.com.Allo"), EventType.INTERFACE); assertEquals("fun.com.One", cn.toString()); cn = plugin.className((ObjectPluginC...
@Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); }
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } }
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); }
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); @Override ClassName class...
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); @Override ClassName class...
@Test public void classNameWithDefaultImpl() { RenamePlugin plugin = new RenamePlugin(Arrays.asList("One")); ClassName cn = plugin.className((ObjectPluginContext) null, null, ClassName.bestGuess("fun.com.Allo"), EventType.INTERFACE); assertEquals("fun.com.One", cn.toString()); cn = plugin.className((ObjectPluginContext...
@Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); }
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } }
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); }
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); @Override ClassName class...
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); @Override ClassName class...
@Test public void boxOnNotRequired() { when(integerDeclaration.required()).thenReturn(false); BoxWhenNotRequired boxWhenNotRequired = new BoxWhenNotRequired(null); TypeName tn = boxWhenNotRequired.typeName(null, integerDeclaration, TypeName.INT); assertEquals(TypeName.INT.box(), tn); }
@Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } }
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } }
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNotRequired(List...
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNotRequired(List...
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNotRequired(List...
@Test public void noBoxOnRequired() { when(integerDeclaration.required()).thenReturn(true); BoxWhenNotRequired boxWhenNotRequired = new BoxWhenNotRequired(null); TypeName tn = boxWhenNotRequired.typeName(null, integerDeclaration, TypeName.INT); assertEquals(TypeName.INT, tn); }
@Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } }
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } }
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNotRequired(List...
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNotRequired(List...
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNotRequired(List...
@Test public void className() { JaxbUnionExtension jaxb = new JaxbUnionExtension(); ClassName typeName = ClassName.bestGuess("foo.Union"); TypeName calculatedTypeName = jaxb.className(null, null, typeName, null); assertSame(typeName, calculatedTypeName); }
@Override public ClassName className(UnionPluginContext unionPluginContext, UnionTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return currentSuggestion; }
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public ClassName className(UnionPluginContext unionPluginContext, UnionTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return currentSuggestion; } }
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public ClassName className(UnionPluginContext unionPluginContext, UnionTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return currentSuggestion; } }
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public ClassName className(UnionPluginContext unionPluginContext, UnionTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return currentSuggestion; } @Override ClassName className(UnionPluginContext unionPluginContext, UnionTyp...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public ClassName className(UnionPluginContext unionPluginContext, UnionTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return currentSuggestion; } @Override ClassName className(UnionPluginContext unionPluginContext, UnionTyp...
@Test public void classCreated() { JaxbUnionExtension jaxb = new JaxbUnionExtension(); TypeSpec.Builder classBuilder = TypeSpec.classBuilder("my.BuiltClass"); TypeSpec.Builder builder = jaxb.classCreated(null, unionTypeDeclaration, classBuilder, EventType.INTERFACE); TypeSpec buildClass = builder.build(); TypeSpecAsser...
@Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##default"; String name = type.xml() != null && type.xml()...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
@Test public void implementationClassCreated() { JaxbUnionExtension jaxb = new JaxbUnionExtension(); TypeSpec.Builder classBuilder = TypeSpec.classBuilder("my.BuiltClass"); TypeSpec.Builder builder = jaxb.classCreated(null, unionTypeDeclaration, classBuilder, EventType.IMPLEMENTATION); TypeSpec buildClass = builder.bui...
@Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##default"; String name = type.xml() != null && type.xml()...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public TypeSpec.Builder classCreated(UnionPluginContext unionPluginContext, UnionTypeDeclaration type, TypeSpec.Builder builder, EventType eventType) { String namespace = type.xml() != null && type.xml().namespace() != null ? type.xml().namespace() : "##d...
@Test public void anyFieldCreated() { }
@Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(XmlElements.class); for (TypeDeclaration typeDeclaration : union.of()...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(XmlElements.cl...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(XmlElements.cl...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(XmlElements.cl...
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(XmlElements.cl...
@Test public void forInteger() throws Exception { setupNumberFacets(); Jsr303Extension ext = new Jsr303Extension(); FieldSpec.Builder builder = FieldSpec.builder(ClassName.get(Integer.class), "champ", Modifier.PUBLIC); ext.fieldBuilt(objectPluginContext, number, builder, EventType.IMPLEMENTATION); assertForIntegerNumbe...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forBigInt() throws Exception { setupNumberFacets(); Jsr303Extension ext = new Jsr303Extension(); FieldSpec.Builder builder = FieldSpec.builder(ClassName.get(BigInteger.class), "champ", Modifier.PUBLIC); ext.fieldBuilt(objectPluginContext, number, builder, EventType.IMPLEMENTATION); assertForIntegerNum...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void name() throws Exception { PojoToRamlImpl pojoToRaml = new PojoToRamlImpl(FieldClassParser.factory(), AdjusterFactory.NULL_FACTORY); TypeBuilder builder = pojoToRaml.name(Fun.class.getMethod("stringMethod").getGenericReturnType()); ObjectNode node = builder.buildNode(); assertEquals("type: array", node...
@Override public TypeBuilder name(Class<?> clazz) { RamlAdjuster adjuster = this.adjusterFactory.createAdjuster(clazz); ClassParser parser = classParserFactory.createParser(clazz); RamlType type = RamlTypeFactory.forType(clazz, parser, adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return typ...
PojoToRamlImpl implements PojoToRaml { @Override public TypeBuilder name(Class<?> clazz) { RamlAdjuster adjuster = this.adjusterFactory.createAdjuster(clazz); ClassParser parser = classParserFactory.createParser(clazz); RamlType type = RamlTypeFactory.forType(clazz, parser, adjusterFactory).or(new RamlTypeSupplier(claz...
PojoToRamlImpl implements PojoToRaml { @Override public TypeBuilder name(Class<?> clazz) { RamlAdjuster adjuster = this.adjusterFactory.createAdjuster(clazz); ClassParser parser = classParserFactory.createParser(clazz); RamlType type = RamlTypeFactory.forType(clazz, parser, adjusterFactory).or(new RamlTypeSupplier(claz...
PojoToRamlImpl implements PojoToRaml { @Override public TypeBuilder name(Class<?> clazz) { RamlAdjuster adjuster = this.adjusterFactory.createAdjuster(clazz); ClassParser parser = classParserFactory.createParser(clazz); RamlType type = RamlTypeFactory.forType(clazz, parser, adjusterFactory).or(new RamlTypeSupplier(claz...
PojoToRamlImpl implements PojoToRaml { @Override public TypeBuilder name(Class<?> clazz) { RamlAdjuster adjuster = this.adjusterFactory.createAdjuster(clazz); ClassParser parser = classParserFactory.createParser(clazz); RamlType type = RamlTypeFactory.forType(clazz, parser, adjusterFactory).or(new RamlTypeSupplier(claz...
@Test public void forObject() throws Exception { Jsr303Extension ext = new Jsr303Extension(); FieldSpec.Builder builder = FieldSpec.builder(ClassName.get(Double.class), "champ", Modifier.PUBLIC); ext.fieldBuilt(objectPluginContext, object, builder, EventType.IMPLEMENTATION); assertEquals(1, builder.build().annotations....
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forUnion() throws Exception { Jsr303Extension ext = new Jsr303Extension(); TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(ClassName.get("xx.bb", "Foo")); FieldSpec.Builder builder = FieldSpec.builder(ClassName.get(Double.class), "champ", Modifier.PUBLIC); ext.anyFieldCreated(unionPluginContext, ...
@Override public FieldSpec.Builder anyFieldCreated( UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { FacetValidation.addFacetsForBuilt(new AnnotationAdder() { @Override public TypeName typeName() { return anyType.build().type; } @Overri...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder anyFieldCreated( UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { FacetValidation.addFacetsForBuilt(new AnnotationAdder() { @Override public TypeName type...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder anyFieldCreated( UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { FacetValidation.addFacetsForBuilt(new AnnotationAdder() { @Override public TypeName type...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder anyFieldCreated( UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { FacetValidation.addFacetsForBuilt(new AnnotationAdder() { @Override public TypeName type...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder anyFieldCreated( UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { FacetValidation.addFacetsForBuilt(new AnnotationAdder() { @Override public TypeName type...
@Test public void forDouble() throws Exception { setupNumberFacets(); Jsr303Extension ext = new Jsr303Extension(); FieldSpec.Builder builder = FieldSpec.builder(ClassName.get(Double.class), "champ", Modifier.PUBLIC); ext.fieldBuilt(objectPluginContext, object, builder, EventType.IMPLEMENTATION); assertEquals(1, builder...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forArrays() throws Exception { when(array.minItems()).thenReturn(3); when(array.maxItems()).thenReturn(5); FieldSpec.Builder builder = FieldSpec.builder(ParameterizedTypeName.get(List.class, String.class), "champ", Modifier.PUBLIC); Jsr303Extension ext = new Jsr303Extension(); ext.fieldBuilt(objectPlu...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forArraysOfStrings() throws Exception { when(array.minItems()).thenReturn(null); when(array.maxItems()).thenReturn(null); FieldSpec.Builder builder = FieldSpec.builder(ParameterizedTypeName.get(List.class, String.class), "champ", Modifier.PUBLIC); Jsr303Extension ext = new Jsr303Extension(); ext.field...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forArraysOfObject() throws Exception { when(array.minItems()).thenReturn(null); when(array.maxItems()).thenReturn(null); when(array.items()).thenReturn(object); FieldSpec.Builder builder = FieldSpec.builder(ParameterizedTypeName.get(List.class, String.class), "champ", Modifier.PUBLIC); Jsr303Extension...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forArraysOfUnion() throws Exception { when(array.minItems()).thenReturn(null); when(array.maxItems()).thenReturn(null); when(array.items()).thenReturn(union); FieldSpec.Builder builder = FieldSpec.builder(ParameterizedTypeName.get(List.class, String.class), "champ", Modifier.PUBLIC); Jsr303Extension e...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forArraysMaxOnly() throws Exception { when(array.minItems()).thenReturn(null); when(array.maxItems()).thenReturn(5); FieldSpec.Builder builder = FieldSpec.builder(ParameterizedTypeName.get(List.class, String.class), "champ", Modifier.PUBLIC); Jsr303Extension ext = new Jsr303Extension(); ext.fieldBuilt...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void forArraysNotNull() throws Exception { when(array.minItems()).thenReturn(null); when(array.maxItems()).thenReturn(null); when(array.required()).thenReturn(true); FieldSpec.Builder builder = FieldSpec.builder(ParameterizedTypeName.get(List.class, String.class), "champ", Modifier.PUBLIC); Jsr303Extension...
@Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSpec.build().type; } @Override public void addAnn...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder fieldBuilt(ObjectPluginContext objectPluginContext, TypeDeclaration typeDeclaration, FieldSpec.Builder fieldSpec, EventType eventType) { AnnotationAdder adder = new AnnotationAdder() { @Override public TypeName typeName() { return fieldSp...
@Test public void javaClassReferenceWithString() { when(referencePlugin.typeName(any(ReferencePluginContext.class), any(TypeDeclaration.class), eq(ParameterizedTypeName.get(List.class, String.class)))).thenReturn(ParameterizedTypeName.get(List.class, String.class)); when(referencePlugin.typeName(any(ReferencePluginCont...
@Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items().type(); } if ("object".equals(itemTypeN...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
@Test public void forScalars() throws Exception { RamlType type = RamlTypeFactory.forType(Fun.class.getDeclaredField("one").getGenericType(), null, null).orNull(); assertEquals("string", type.getRamlSyntax().id()); }
public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())) { if ( parameter...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
@Test public void javaClassReferenceWithListOfSomething() { when(referencePlugin.typeName(any(ReferencePluginContext.class), any(TypeDeclaration.class), eq(ParameterizedTypeName.get(List.class, String.class)))).thenReturn(ParameterizedTypeName.get(ClassName.get(List.class), ClassName.bestGuess("foo.Something"))); when(...
@Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items().type(); } if ("object".equals(itemTypeN...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
@Test public void javaClassReferenceWithSomethingAsList() { when(arrayTypeHandlerPlugin.className(any(ArrayPluginContext.class), any(ArrayTypeDeclaration.class), (ClassName) eq(null), eq(EventType.INTERFACE))).thenReturn(ClassName.get("foo", "Something")); when(itemType.name()).thenReturn("Something"); when(itemType.ty...
@Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items().type(); } if ("object".equals(itemTypeN...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
ArrayTypeHandler implements TypeHandler { @Override public TypeName javaClassReference(GenerationContext generationContext, EventType type) { if ( name.contains("[") || name.equals("array")) { String itemTypeName = typeDeclaration.items().name(); if ("object".equals(itemTypeName)) { itemTypeName = typeDeclaration.items...
@Test public void fromTypes() throws Exception { when(api.types()).thenReturn(Arrays.asList(t1, t2, t3)); TypeDeclaration typeDeclaration = TypeFetchers.fromTypes().fetchType(api, "t1"); assertSame(t1, typeDeclaration); }
public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredicate(name)).or(...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
@Test(expected = GenerationException.class) public void fromTypesFail() throws Exception { when(api.types()).thenReturn(Arrays.asList(t4, t5, t6)); when(api.uses()).thenReturn(Arrays.asList(l1, l2)); when(l1.uses()).thenReturn(Collections.singletonList(l3)); when(l1.types()).thenReturn(Collections.singletonList(t1)); w...
public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredicate(name)).or(...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMatch(namedPredi...
@Test public void fromLibraries() throws Exception { when(api.uses()).thenReturn(Arrays.asList(l1, l2)); when(l1.uses()).thenReturn(Collections.singletonList(l3)); when(l1.types()).thenReturn(Collections.singletonList(t1)); when(l2.types()).thenReturn(Collections.singletonList(t2)); when(l3.types()).thenReturn(Collecti...
public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new ArrayList<TypeDecl...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
@Test public void fromAnywhere() throws Exception { when(api.types()).thenReturn(Arrays.asList(t4, t5, t6)); when(api.uses()).thenReturn(Arrays.asList(l1, l2)); when(l1.uses()).thenReturn(Collections.singletonList(l3)); when(l1.types()).thenReturn(Collections.singletonList(t1)); when(l2.types()).thenReturn(Collections....
public static TypeFetcher fromAnywhere() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(FluentIterable.from(api.types()).append(Utils.go...
TypeFetchers { public static TypeFetcher fromAnywhere() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(FluentIterable.from(api.types())....
TypeFetchers { public static TypeFetcher fromAnywhere() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(FluentIterable.from(api.types())....
TypeFetchers { public static TypeFetcher fromAnywhere() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(FluentIterable.from(api.types())....
TypeFetchers { public static TypeFetcher fromAnywhere() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(FluentIterable.from(api.types())....
@Test(expected = GenerationException.class) public void failFromLibraries() throws Exception { when(api.types()).thenReturn(Arrays.asList(t4, t5, t6)); when(api.uses()).thenReturn(Arrays.asList(l1, l2)); when(l1.uses()).thenReturn(Collections.singletonList(l3)); when(l1.types()).thenReturn(Collections.singletonList(t1)...
public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new ArrayList<TypeDecl...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
TypeFetchers { public static TypeFetcher fromLibraries() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(Utils.goThroughLibraries(new Arr...
@Test public void inTypes() { when(api.types()).thenReturn(Arrays.asList(t1, t2, t3)); Iterable<TypeDeclaration> it = TypeFinders.inTypes().findTypes(api); assertThat(it, contains(equalTo(t1), equalTo(t2), equalTo(t3))); }
public static TypeFinder inTypes() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return api.types(); } }; }
TypeFinders { public static TypeFinder inTypes() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return api.types(); } }; } }
TypeFinders { public static TypeFinder inTypes() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return api.types(); } }; } }
TypeFinders { public static TypeFinder inTypes() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return api.types(); } }; } static TypeFinder inTypes(); static TypeFinder inLibraries(); static TypeFinder everyWhere(); static TypeFinder inResources(); }
TypeFinders { public static TypeFinder inTypes() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return api.types(); } }; } static TypeFinder inTypes(); static TypeFinder inLibraries(); static TypeFinder everyWhere(); static TypeFinder inResources(); }
@Test public void inLibraries() { when(api.uses()).thenReturn(Arrays.asList(l1, l2)); when(l1.uses()).thenReturn(Collections.singletonList(l3)); when(l1.types()).thenReturn(Collections.singletonList(t1)); when(l2.types()).thenReturn(Collections.singletonList(t2)); when(l3.types()).thenReturn(Collections.singletonList(t...
public static TypeFinder inLibraries() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { List<TypeDeclaration> foundTypes = new ArrayList<>(); Utils.goThroughLibraries(foundTypes, new HashSet<String>(), api.uses()); return foundTypes; } }; }
TypeFinders { public static TypeFinder inLibraries() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { List<TypeDeclaration> foundTypes = new ArrayList<>(); Utils.goThroughLibraries(foundTypes, new HashSet<String>(), api.uses()); return foundTypes; } }; } }
TypeFinders { public static TypeFinder inLibraries() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { List<TypeDeclaration> foundTypes = new ArrayList<>(); Utils.goThroughLibraries(foundTypes, new HashSet<String>(), api.uses()); return foundTypes; } }; } }
TypeFinders { public static TypeFinder inLibraries() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { List<TypeDeclaration> foundTypes = new ArrayList<>(); Utils.goThroughLibraries(foundTypes, new HashSet<String>(), api.uses()); return foundTypes; } }; } static TypeFinder inT...
TypeFinders { public static TypeFinder inLibraries() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { List<TypeDeclaration> foundTypes = new ArrayList<>(); Utils.goThroughLibraries(foundTypes, new HashSet<String>(), api.uses()); return foundTypes; } }; } static TypeFinder inT...
@Test public void everyWhere() { when(api.types()).thenReturn(Arrays.asList(t4, t5, t6)); when(api.uses()).thenReturn(Arrays.asList(l1, l2)); when(l1.uses()).thenReturn(Collections.singletonList(l3)); when(l1.types()).thenReturn(Collections.singletonList(t1)); when(l2.types()).thenReturn(Collections.singletonList(t2));...
public static TypeFinder everyWhere() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return FluentIterable.from(api.types()) .append(resourceTypes(api.resources())) .append(Utils.goThroughLibraries(new ArrayList<TypeDeclaration>(), new HashSet<String>(), api.uses())); } }; }
TypeFinders { public static TypeFinder everyWhere() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return FluentIterable.from(api.types()) .append(resourceTypes(api.resources())) .append(Utils.goThroughLibraries(new ArrayList<TypeDeclaration>(), new HashSet<String>(), api.us...
TypeFinders { public static TypeFinder everyWhere() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return FluentIterable.from(api.types()) .append(resourceTypes(api.resources())) .append(Utils.goThroughLibraries(new ArrayList<TypeDeclaration>(), new HashSet<String>(), api.us...
TypeFinders { public static TypeFinder everyWhere() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return FluentIterable.from(api.types()) .append(resourceTypes(api.resources())) .append(Utils.goThroughLibraries(new ArrayList<TypeDeclaration>(), new HashSet<String>(), api.us...
TypeFinders { public static TypeFinder everyWhere() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return FluentIterable.from(api.types()) .append(resourceTypes(api.resources())) .append(Utils.goThroughLibraries(new ArrayList<TypeDeclaration>(), new HashSet<String>(), api.us...
@Test public void forComposed() throws Exception { when(adjusterFactory.createAdjuster(SubFun.class)).thenReturn(adjuster); when(adjuster.adjustTypeName(SubFun.class, "SubFun")).thenReturn("foo"); RamlType type = RamlTypeFactory.forType(Fun.class.getDeclaredField("sub").getGenericType(), classParser, adjusterFactory).o...
public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())) { if ( parameter...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
@Test public void simple() throws Exception { Foo foo = (Foo) Proxy.newProxyInstance(AugmenterTest.class.getClassLoader(), new Class[] {Foo.class}, new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.getName(); } }); Boo b = Augmenter.aug...
public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) { throw new I...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
@Test public void factory() throws Exception { SubFoo subFoo = (SubFoo) Proxy.newProxyInstance(AugmenterTest.class.getClassLoader(), new Class[] {SubFoo.class}, new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.getName(); } }); Augmente...
public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) { throw new I...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFactory == null ) {...
@Test public void response() { Api api = document() .baseUri("http: .title("doc") .version("one") .mediaType("foo/fun") .withResources( resource("/foo") .withMethods(MethodBuilder.method("get") .withResponses(ResponseBuilder.response(200) .withBodies(BodyBuilder.body("application/json").ofType(TypeBuilder.type("integer...
static public ResponseBuilder response(int code) { return new ResponseBuilder(code); }
ResponseBuilder extends KeyValueNodeBuilder<ResponseBuilder> implements NodeBuilder, AnnotableBuilder<ResponseBuilder> { static public ResponseBuilder response(int code) { return new ResponseBuilder(code); } }
ResponseBuilder extends KeyValueNodeBuilder<ResponseBuilder> implements NodeBuilder, AnnotableBuilder<ResponseBuilder> { static public ResponseBuilder response(int code) { return new ResponseBuilder(code); } private ResponseBuilder(int code); }
ResponseBuilder extends KeyValueNodeBuilder<ResponseBuilder> implements NodeBuilder, AnnotableBuilder<ResponseBuilder> { static public ResponseBuilder response(int code) { return new ResponseBuilder(code); } private ResponseBuilder(int code); static ResponseBuilder response(int code); ResponseBuilder withBodies(BodyBu...
ResponseBuilder extends KeyValueNodeBuilder<ResponseBuilder> implements NodeBuilder, AnnotableBuilder<ResponseBuilder> { static public ResponseBuilder response(int code) { return new ResponseBuilder(code); } private ResponseBuilder(int code); static ResponseBuilder response(int code); ResponseBuilder withBodies(BodyBu...
@Test public void resourceBuilder() { Api api = document() .baseUri("http: .title("doc") .version("one") .mediaType("foo/fun") .withResources( resource("/foo") .description("happy") ) .buildModel(); assertEquals("/foo", api.resources().get(0).displayName().value()); assertEquals("/foo", api.resources().get(0).resourceP...
private ResourceBuilder(String name) { super(name); }
ResourceBuilder extends KeyValueNodeBuilder<ResourceBuilder> implements NodeBuilder { private ResourceBuilder(String name) { super(name); } }
ResourceBuilder extends KeyValueNodeBuilder<ResourceBuilder> implements NodeBuilder { private ResourceBuilder(String name) { super(name); } private ResourceBuilder(String name); }
ResourceBuilder extends KeyValueNodeBuilder<ResourceBuilder> implements NodeBuilder { private ResourceBuilder(String name) { super(name); } private ResourceBuilder(String name); static ResourceBuilder resource(String name); @Override KeyValueNode buildNode(); ResourceBuilder displayName(String displayName); ResourceBu...
ResourceBuilder extends KeyValueNodeBuilder<ResourceBuilder> implements NodeBuilder { private ResourceBuilder(String name) { super(name); } private ResourceBuilder(String name); static ResourceBuilder resource(String name); @Override KeyValueNode buildNode(); ResourceBuilder displayName(String displayName); ResourceBu...
@Test public void simpleType() { Api api = document() .baseUri("http: .title("doc") .version("one") .mediaType("foo/fun") .withTypes( TypeDeclarationBuilder.typeDeclaration("Mom") .ofType(TypeBuilder.type("boolean"))) .buildModel(); assertEquals("Mom", api.types().get(0).name()); assertEquals("boolean", api.types().get...
static public TypeBuilder type(String type) { return new TypeBuilder(type); }
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } }
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); }
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); String id(); static TypeBuilder typ...
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); String id(); static TypeBuilder typ...
@Test public void unionType() { Api api = document() .baseUri("http: .title("doc") .version("one") .mediaType("foo/fun") .withTypes( TypeDeclarationBuilder.typeDeclaration("Mom") .ofType(TypeBuilder.type("string | integer") ) ) .buildModel(); assertEquals("Mom", api.types().get(0).name()); assertEquals("string | intege...
static public TypeBuilder type(String type) { return new TypeBuilder(type); }
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } }
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); }
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); String id(); static TypeBuilder typ...
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); String id(); static TypeBuilder typ...
@Test public void emit() throws Exception { when(api.getNode()).thenReturn(node); when(node.getChildren()).thenReturn(Arrays.asList(child1, child2)); Emitter emitter = new Emitter(list) { @Override protected YamlEmitter createEmitter(Writer w) { assertSame(w, writer); return yamlEmitter; } }; emitter.emit(api, writer);...
public void emit(Api api) throws IOException { emit(api, new OutputStreamWriter(System.out)); }
Emitter { public void emit(Api api) throws IOException { emit(api, new OutputStreamWriter(System.out)); } }
Emitter { public void emit(Api api) throws IOException { emit(api, new OutputStreamWriter(System.out)); } Emitter(HandlerList list); Emitter(); }
Emitter { public void emit(Api api) throws IOException { emit(api, new OutputStreamWriter(System.out)); } Emitter(HandlerList list); Emitter(); void emit(Api api); void emit(Api api, Writer w); }
Emitter { public void emit(Api api) throws IOException { emit(api, new OutputStreamWriter(System.out)); } Emitter(HandlerList list); Emitter(); void emit(Api api); void emit(Api api, Writer w); }
@Test public void handles() throws Exception { when(nodeHandler1.handles(node)).thenReturn(true); HandlerList list = new HandlerList(Arrays.<NodeHandler<? extends Node>>asList(nodeHandler1, nodeHandler2)); assertTrue(list.handles(node)); verify(nodeHandler2, never()).handles(any(Node.class)); }
@Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); }
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } }
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
@Test public void handlesNone() throws Exception { when(nodeHandler1.handles(node)).thenReturn(false); when(nodeHandler2.handles(node)).thenReturn(false); HandlerList list = new HandlerList(Arrays.<NodeHandler<? extends Node>>asList(nodeHandler1, nodeHandler2)); assertFalse(list.handles(node)); }
@Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); }
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } }
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
@Test public void actuallyHandleSafely() throws Exception { when(nodeHandler1.handles(node)).thenReturn(false); when(nodeHandler2.handles(node)).thenReturn(true); when(nodeHandler2.handle(node, emitter)).thenReturn(true); HandlerList list = new HandlerList(Arrays.<NodeHandler<? extends Node>>asList(nodeHandler1, nodeHa...
@Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); }
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } }
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); } }); } Handle...
@Test public void forCollectionsOfScalars() throws Exception { RamlType type = RamlTypeFactory.forType(Fun.class.getDeclaredField("listOfStrings").getGenericType(), null, null).orNull(); assertTrue(type instanceof CollectionRamlType); assertEquals("array", type.getRamlSyntax().id()); }
public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())) { if ( parameter...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
@Test public void handles() throws Exception { ReferenceNodeHandler handler = new ReferenceNodeHandler(); assertFalse(handler.handles(badNode)); assertTrue(handler.handles(goodNode)); }
@Override public boolean handles(Node node) { return node instanceof ReferenceNode; }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handles(Node node) { return node instanceof ReferenceNode; } }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handles(Node node) { return node instanceof ReferenceNode; } }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handles(Node node) { return node instanceof ReferenceNode; } @Override boolean handles(Node node); @Override boolean handleSafely(ReferenceNode node, YamlEmitter emitter); }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handles(Node node) { return node instanceof ReferenceNode; } @Override boolean handles(Node node); @Override boolean handleSafely(ReferenceNode node, YamlEmitter emitter); }
@Test public void handleSafely() throws Exception { when(goodNode.getRefName()).thenReturn("ref.value"); ReferenceNodeHandler rnh = new ReferenceNodeHandler(); rnh.handleSafely(goodNode, emitter); verify(emitter).writeObjectValue("ref.value"); }
@Override public boolean handleSafely(ReferenceNode node, YamlEmitter emitter) throws IOException { emitter.writeObjectValue(node.getRefName()); return true; }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handleSafely(ReferenceNode node, YamlEmitter emitter) throws IOException { emitter.writeObjectValue(node.getRefName()); return true; } }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handleSafely(ReferenceNode node, YamlEmitter emitter) throws IOException { emitter.writeObjectValue(node.getRefName()); return true; } }
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handleSafely(ReferenceNode node, YamlEmitter emitter) throws IOException { emitter.writeObjectValue(node.getRefName()); return true; } @Override boolean handles(Node node); @Override boolean handleSafely(ReferenceNode node, YamlEmitter ...
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handleSafely(ReferenceNode node, YamlEmitter emitter) throws IOException { emitter.writeObjectValue(node.getRefName()); return true; } @Override boolean handles(Node node); @Override boolean handleSafely(ReferenceNode node, YamlEmitter ...
@Test public void handles() throws Exception { TypeDeclarationNodeHandler tdnh = new TypeDeclarationNodeHandler(list); assertFalse(tdnh.handles(badNode)); assertTrue(tdnh.handles(goodNode)); }
@Override public boolean handles(Node node) { return node instanceof TypeDeclarationNode; }
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handles(Node node) { return node instanceof TypeDeclarationNode; } }
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handles(Node node) { return node instanceof TypeDeclarationNode; } TypeDeclarationNodeHandler(HandlerList handlerList); }
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handles(Node node) { return node instanceof TypeDeclarationNode; } TypeDeclarationNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(TypeDeclarationNode node, YamlEmitte...
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handles(Node node) { return node instanceof TypeDeclarationNode; } TypeDeclarationNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(TypeDeclarationNode node, YamlEmitte...
@Test public void handleSafely() throws Exception { when(goodNode.getChildren()).thenReturn(Collections.<Node>singletonList(keyValueNode)); TypeDeclarationNodeHandler handler = new TypeDeclarationNodeHandler(list); handler.handleSafely(goodNode, emitter); verify(list).handle(keyValueNode, emitter); }
@Override public boolean handleSafely(TypeDeclarationNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { handlerList.handle(child, emitter); } return true; }
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handleSafely(TypeDeclarationNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { handlerList.handle(child, emitter); } return true; } }
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handleSafely(TypeDeclarationNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { handlerList.handle(child, emitter); } return true; } TypeDeclarationNodeHandler(HandlerList handlerList)...
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handleSafely(TypeDeclarationNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { handlerList.handle(child, emitter); } return true; } TypeDeclarationNodeHandler(HandlerList handlerList)...
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handleSafely(TypeDeclarationNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { handlerList.handle(child, emitter); } return true; } TypeDeclarationNodeHandler(HandlerList handlerList)...
@Test public void handles() throws Exception { ArrayNodeHandler handler = new ArrayNodeHandler(list); assertFalse(handler.handles(badNode)); assertTrue(handler.handles(goodNode)); }
@Override public boolean handles(Node node) { return node instanceof ArrayNode; }
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handles(Node node) { return node instanceof ArrayNode; } }
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handles(Node node) { return node instanceof ArrayNode; } ArrayNodeHandler(HandlerList handlerList); }
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handles(Node node) { return node instanceof ArrayNode; } ArrayNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(ArrayNode node, YamlEmitter emitter); }
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handles(Node node) { return node instanceof ArrayNode; } ArrayNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(ArrayNode node, YamlEmitter emitter); }
@Test public void handleSafelyEmpty() throws Exception { ArrayNodeHandler handler = new ArrayNodeHandler(list); handler.handleSafely(goodNode, emitter); verify(emitter).writeSyntaxElement("["); verify(emitter).writeSyntaxElement("]"); verifyNoMoreInteractions(emitter); }
@Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList.handle(children.get(a), emitter); if (a < childre...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
@Test public void handleSafelyTwoScalarElements() throws Exception { when(goodNode.getChildren()).thenReturn(Arrays.<Node>asList(scalar1, scalar2)); ArrayNodeHandler handler = new ArrayNodeHandler(list); handler.handleSafely(goodNode, emitter); verify(emitter).writeSyntaxElement("["); verify(emitter).writeSyntaxElement...
@Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList.handle(children.get(a), emitter); if (a < childre...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
@Test public void handleSafelyTwoNonScalarElements() throws Exception { when(goodNode.getChildren()).thenReturn(Arrays.asList(object1, object2)); when(emitter.indent()).thenReturn(subEmitter); when(subEmitter.bulletListArray()).thenReturn(bullet); ArrayNodeHandler handler = new ArrayNodeHandler(list); handler.handleSaf...
@Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList.handle(children.get(a), emitter); if (a < childre...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handleSafely(ArrayNode node, YamlEmitter emitter) throws IOException { List<Node> children = node.getChildren(); if ( childrenAreAllScalarTypes(children)) { emitter.writeSyntaxElement("["); for (int a = 0; a < children.size(); a++) { handlerList...
@Test public void handles() throws Exception { KeyValueNodeHandler handler = new KeyValueNodeHandler(list); assertFalse(handler.handles(notKeyNode)); assertTrue(handler.handles(keyNode)); }
@Override public boolean handles(Node node) { return node instanceof KeyValueNode; }
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handles(Node node) { return node instanceof KeyValueNode; } }
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handles(Node node) { return node instanceof KeyValueNode; } KeyValueNodeHandler(HandlerList handlerList); }
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handles(Node node) { return node instanceof KeyValueNode; } KeyValueNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(KeyValueNode node, YamlEmitter emitter); }
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handles(Node node) { return node instanceof KeyValueNode; } KeyValueNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(KeyValueNode node, YamlEmitter emitter); }
@Test public void handleSafelyScalar() throws Exception { when(keyNode.getValue()).thenReturn(simpleNode); when(keyNode.getKey()).thenReturn(new StringNodeImpl("hello")); KeyValueNodeHandler handler = new KeyValueNodeHandler(list); assertTrue(handler.handleSafely(keyNode, emitter)); verify(emitter).writeTag("hello"); v...
@Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else { emitter.writeTag(node.getKey().toString()); handlerList...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
@Test public void forCollectionsOfScalarsFromArray() throws Exception { when(adjusterFactory.createAdjuster(Fun.class)).thenReturn(RamlAdjuster.NULL_ADJUSTER); RamlType type = RamlTypeFactory.forType(Fun.class.getDeclaredField("arrayOfInts").getGenericType(), null, adjusterFactory).orNull(); assertTrue(type instanceof ...
public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())) { if ( parameter...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
@Test public void handleSafelyObject() throws Exception { when(keyNode.getValue()).thenReturn(objectNode); when(emitter.indent()).thenReturn(subEmitter); when(keyNode.getKey()).thenReturn(new StringNodeImpl("hello")); KeyValueNodeHandler handler = new KeyValueNodeHandler(list); assertTrue(handler.handleSafely(keyNode, ...
@Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else { emitter.writeTag(node.getKey().toString()); handlerList...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emitter); } else {...
@Test public void fallsThrough() throws Exception { when(subNodeHandler.handle(node, emitter)).thenReturn(false); SubclassedNodeHandler<ObjectNode> on = new SubclassedNodeHandler<ObjectNode>(ObjectNode.class, subNodeHandler) { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOExceptio...
@Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } }
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } }
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass, HandlerList ...
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass, HandlerList ...
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass, HandlerList ...
@Test public void sublistHandles() throws Exception { when(subNodeHandler.handle(node, emitter)).thenReturn(true); SubclassedNodeHandler<ObjectNode> on = new SubclassedNodeHandler<ObjectNode>(ObjectNode.class, subNodeHandler) { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOExcepti...
@Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } }
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } }
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass, HandlerList ...
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass, HandlerList ...
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass, HandlerList ...
@Test public void handles() throws Exception { TypeExpressionNodeHandler handler = new TypeExpressionNodeHandler(list); assertFalse(handler.handles(badNode)); assertTrue(handler.handles(goodNode)); }
@Override public boolean handles(Node node) { return node instanceof TypeExpressionNode; }
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handles(Node node) { return node instanceof TypeExpressionNode; } }
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handles(Node node) { return node instanceof TypeExpressionNode; } TypeExpressionNodeHandler(HandlerList handlerList); }
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handles(Node node) { return node instanceof TypeExpressionNode; } TypeExpressionNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(TypeExpressionNode node, YamlE...
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handles(Node node) { return node instanceof TypeExpressionNode; } TypeExpressionNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(TypeExpressionNode node, YamlE...
@Test public void handleSafely() throws Exception { when(goodNode.getTypeExpressionText()).thenReturn("JustReference"); TypeExpressionNodeHandler handler = new TypeExpressionNodeHandler(list); handler.handle(goodNode, emitter); verify(emitter).writeObjectValue("JustReference"); }
@Override public boolean handleSafely(TypeExpressionNode node, YamlEmitter emitter) throws IOException { List<LibraryRefNode> descs = node.findDescendantsWith(LibraryRefNode.class); if ( descs.size() != 0 && descs.get(0) != null ) { emitter.writeObjectValue(descs.get(0).getRefName() + "." +node.getTypeExpressionText())...
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handleSafely(TypeExpressionNode node, YamlEmitter emitter) throws IOException { List<LibraryRefNode> descs = node.findDescendantsWith(LibraryRefNode.class); if ( descs.size() != 0 && descs.get(0) != null ) { emitter.w...
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handleSafely(TypeExpressionNode node, YamlEmitter emitter) throws IOException { List<LibraryRefNode> descs = node.findDescendantsWith(LibraryRefNode.class); if ( descs.size() != 0 && descs.get(0) != null ) { emitter.w...
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handleSafely(TypeExpressionNode node, YamlEmitter emitter) throws IOException { List<LibraryRefNode> descs = node.findDescendantsWith(LibraryRefNode.class); if ( descs.size() != 0 && descs.get(0) != null ) { emitter.w...
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handleSafely(TypeExpressionNode node, YamlEmitter emitter) throws IOException { List<LibraryRefNode> descs = node.findDescendantsWith(LibraryRefNode.class); if ( descs.size() != 0 && descs.get(0) != null ) { emitter.w...
@Test public void handleSafely() throws Exception { when(objectNode.getChildren()).thenReturn(Collections.<Node>singletonList(child)); ObjectNodeHandler on = new ObjectNodeHandler(list); on.handleSafely(objectNode, emitter); verify(list).handle(child, emitter); }
@Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { handlerList.handle(child, emitter); } } return true; }
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
@Test public void handleSafelyScalar() throws Exception { when(objectNode.getChildren()).thenReturn(Collections.<Node>singletonList(scalarNode)); ObjectNodeHandler on = new ObjectNodeHandler(list); on.handleSafely(objectNode, emitter); verify(emitter).writeObjectValue("foo"); }
@Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { handlerList.handle(child, emitter); } } return true; }
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scalar); } else { h...
@Test public void handles() throws Exception { NullNodeHandler handler = new NullNodeHandler(); assertFalse(handler.handles(notNullNode)); assertTrue(handler.handles(nullNode)); }
@Override public boolean handles(Node node) { return node instanceof NullNode; }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handles(Node node) { return node instanceof NullNode; } }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handles(Node node) { return node instanceof NullNode; } NullNodeHandler(); }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handles(Node node) { return node instanceof NullNode; } NullNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(NullNode node, YamlEmitter emitter); }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handles(Node node) { return node instanceof NullNode; } NullNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(NullNode node, YamlEmitter emitter); }
@Test public void handleSafely() throws Exception { NullNodeHandler nul = new NullNodeHandler(); nul.handleSafely(nullNode, emitter); verifyNoMoreInteractions(emitter); }
@Override public boolean handleSafely(NullNode node, YamlEmitter emitter) throws IOException { return true; }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handleSafely(NullNode node, YamlEmitter emitter) throws IOException { return true; } }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handleSafely(NullNode node, YamlEmitter emitter) throws IOException { return true; } NullNodeHandler(); }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handleSafely(NullNode node, YamlEmitter emitter) throws IOException { return true; } NullNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(NullNode node, YamlEmitter emitter); }
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handleSafely(NullNode node, YamlEmitter emitter) throws IOException { return true; } NullNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(NullNode node, YamlEmitter emitter); }
@Test public void handles() throws Exception { SimpleTypeNodeHandler handler = new SimpleTypeNodeHandler(); assertFalse(handler.handles(badNode)); assertTrue(handler.handles(goodNode)); }
@Override public boolean handles(Node node) { return node instanceof SimpleTypeNode; }
SimpleTypeNodeHandler extends NodeHandler<SimpleTypeNode<?>> { @Override public boolean handles(Node node) { return node instanceof SimpleTypeNode; } }
SimpleTypeNodeHandler extends NodeHandler<SimpleTypeNode<?>> { @Override public boolean handles(Node node) { return node instanceof SimpleTypeNode; } SimpleTypeNodeHandler(); }
SimpleTypeNodeHandler extends NodeHandler<SimpleTypeNode<?>> { @Override public boolean handles(Node node) { return node instanceof SimpleTypeNode; } SimpleTypeNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(SimpleTypeNode<?> node, YamlEmitter emitter); }
SimpleTypeNodeHandler extends NodeHandler<SimpleTypeNode<?>> { @Override public boolean handles(Node node) { return node instanceof SimpleTypeNode; } SimpleTypeNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(SimpleTypeNode<?> node, YamlEmitter emitter); }
@Test public void forListOfComposed() throws Exception { when(adjusterFactory.createAdjuster(SubFun.class)).thenReturn(RamlAdjuster.NULL_ADJUSTER); when(adjuster.adjustTypeName(SubFun.class, "SubFun")).thenReturn("foo"); RamlType type = RamlTypeFactory.forType(Fun.class.getDeclaredField("listOfSubs").getGenericType(), ...
public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())) { if ( parameter...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
RamlTypeFactory { public static Optional<RamlType> forType(Type type, final ClassParser parser, final AdjusterFactory adjusterFactory) { if ( type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if ( Collection.class.isAssignableFrom((Class)parameterizedType.getRawType())...
@Test public void deserializeGeneric() throws Exception { ArrayList<ContentValues> highlightsReturn = Highlight.deserializeToContentValues(serialized1,pagId,0); ArrayList<ContentValues> highlightsGiven = new ArrayList<>(); ContentValues contentValues = new ContentValues(); contentValues.put(UserDataDBContract.Highlight...
@NonNull public static ArrayList<ContentValues> deserializeToContentValues(@NonNull String serialized, PageInfo pageInfo, int bookId) { Matcher matcher = HIGHLIGHT_PATTERN.matcher(serialized); if (matcher.matches()) { String[] serializedHighlights = serialized.split("\\|"); ArrayList<ContentValues> highlights = new Arr...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<ContentValues> deserializeToContentValues(@NonNull String serialized, PageInfo pageInfo, int bookId) { Matcher matcher = HIGHLIGHT_PATTERN.matcher(serialized); if (matcher.matches()) { String[] serializedHighlights = serializ...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<ContentValues> deserializeToContentValues(@NonNull String serialized, PageInfo pageInfo, int bookId) { Matcher matcher = HIGHLIGHT_PATTERN.matcher(serialized); if (matcher.matches()) { String[] serializedHighlights = serializ...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<ContentValues> deserializeToContentValues(@NonNull String serialized, PageInfo pageInfo, int bookId) { Matcher matcher = HIGHLIGHT_PATTERN.matcher(serialized); if (matcher.matches()) { String[] serializedHighlights = serializ...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<ContentValues> deserializeToContentValues(@NonNull String serialized, PageInfo pageInfo, int bookId) { Matcher matcher = HIGHLIGHT_PATTERN.matcher(serialized); if (matcher.matches()) { String[] serializedHighlights = serializ...
@Test public void deserialize() throws Exception { ArrayList<Highlight> highlightsRerurn = Highlight.deserialize(serialized1,pagId,0); ArrayList<Highlight> highlightsGiven = new ArrayList<>(); highlightsGiven.add(new Highlight("dcdcdc ", 2, "highlight3", 0, pagId, "note",0)); highlightsGiven.add(new Highlight("cdcdc ",...
@NonNull public static ArrayList<Highlight> deserialize(@NonNull String serialized, PageInfo pageInfo, int bookId) { final Pattern pattern = Pattern.compile("^type:(\\w+)(?:\\|(\\d+)\\$(\\d+)\\$(\\d+)\\$(\\w+)\\$(\\d*)\\$([^|]+))+$"); Matcher matcher = pattern.matcher(serialized); if (matcher.matches()) { String[] seri...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<Highlight> deserialize(@NonNull String serialized, PageInfo pageInfo, int bookId) { final Pattern pattern = Pattern.compile("^type:(\\w+)(?:\\|(\\d+)\\$(\\d+)\\$(\\d+)\\$(\\w+)\\$(\\d*)\\$([^|]+))+$"); Matcher matcher = patte...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<Highlight> deserialize(@NonNull String serialized, PageInfo pageInfo, int bookId) { final Pattern pattern = Pattern.compile("^type:(\\w+)(?:\\|(\\d+)\\$(\\d+)\\$(\\d+)\\$(\\w+)\\$(\\d*)\\$([^|]+))+$"); Matcher matcher = patte...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<Highlight> deserialize(@NonNull String serialized, PageInfo pageInfo, int bookId) { final Pattern pattern = Pattern.compile("^type:(\\w+)(?:\\|(\\d+)\\$(\\d+)\\$(\\d+)\\$(\\w+)\\$(\\d*)\\$([^|]+))+$"); Matcher matcher = patte...
Highlight extends UserNote implements Comparable<Highlight> { @NonNull public static ArrayList<Highlight> deserialize(@NonNull String serialized, PageInfo pageInfo, int bookId) { final Pattern pattern = Pattern.compile("^type:(\\w+)(?:\\|(\\d+)\\$(\\d+)\\$(\\d+)\\$(\\w+)\\$(\\d*)\\$([^|]+))+$"); Matcher matcher = patte...
@Test public void handleTatweela() throws Exception { assertEquals(ArabicUtilities.handleTatweela("بـــــــــــــــــــسم"), "بسم"); assertEquals(ArabicUtilities.handleTatweela("هـ"), "هـ"); }
public static String handleTatweela(@NonNull String s) { Matcher matcher4 = TATWEELA_PATTERN.matcher(s); StringBuffer sb2 = new StringBuffer(); while (matcher4.find()) { matcher4.appendReplacement(sb2, "$1$3"); } matcher4.appendTail(sb2); return sb2.toString(); }
ArabicUtilities { public static String handleTatweela(@NonNull String s) { Matcher matcher4 = TATWEELA_PATTERN.matcher(s); StringBuffer sb2 = new StringBuffer(); while (matcher4.find()) { matcher4.appendReplacement(sb2, "$1$3"); } matcher4.appendTail(sb2); return sb2.toString(); } }
ArabicUtilities { public static String handleTatweela(@NonNull String s) { Matcher matcher4 = TATWEELA_PATTERN.matcher(s); StringBuffer sb2 = new StringBuffer(); while (matcher4.find()) { matcher4.appendReplacement(sb2, "$1$3"); } matcher4.appendTail(sb2); return sb2.toString(); } }
ArabicUtilities { public static String handleTatweela(@NonNull String s) { Matcher matcher4 = TATWEELA_PATTERN.matcher(s); StringBuffer sb2 = new StringBuffer(); while (matcher4.find()) { matcher4.appendReplacement(sb2, "$1$3"); } matcher4.appendTail(sb2); return sb2.toString(); } static String cleanTashkeel(@NonNull ...
ArabicUtilities { public static String handleTatweela(@NonNull String s) { Matcher matcher4 = TATWEELA_PATTERN.matcher(s); StringBuffer sb2 = new StringBuffer(); while (matcher4.find()) { matcher4.appendReplacement(sb2, "$1$3"); } matcher4.appendTail(sb2); return sb2.toString(); } static String cleanTashkeel(@NonNull ...
@Test public void cleanTextForSearchingIndexing() throws Exception { assertEquals(ArabicUtilities.cleanTextForSearchingIndexing(testCase), "هذا المستدرك ثم بعد ان جمعت فتاوي ورسائل مفتي الديار السعوديه ورئيس قضائها والشئون الاسلاميه سماحه الشيخ محمد بن ابراهيم ال الشيخ بامر جلاله الملك فيصل بن عبد العزيز ال سعود رحمه ا...
public static String cleanTextForSearchingIndexing(String s) { return cleanTextForSearchingQuery(cleanHtml(s)); }
ArabicUtilities { public static String cleanTextForSearchingIndexing(String s) { return cleanTextForSearchingQuery(cleanHtml(s)); } }
ArabicUtilities { public static String cleanTextForSearchingIndexing(String s) { return cleanTextForSearchingQuery(cleanHtml(s)); } }
ArabicUtilities { public static String cleanTextForSearchingIndexing(String s) { return cleanTextForSearchingQuery(cleanHtml(s)); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull String s); static String ...
ArabicUtilities { public static String cleanTextForSearchingIndexing(String s) { return cleanTextForSearchingQuery(cleanHtml(s)); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull String s); static String ...
@Test public void cleanHtml() throws Exception { assertEquals(ArabicUtilities.cleanHtml(testCase), "هذا المستدرك\nثم بعد أن جمعت فتاوى ورسائل مفتي الديار السعودية ورئيس قضائها والشئون الإسلامية سماحة الشيخ محمد بن إبراهيم آل الشيخ بأمر جلالة الملك فيصل بن عبد العزيز آل سعود رحمه الله وطبعت في مطبعة الحكومة بمكة المكرمة...
@NonNull public static String cleanHtml(String htmlText) { Document doc = Jsoup.parse(htmlText); Elements footnotes = doc.select("a[title].comment"); StringBuilder htmlTextBuilder = new StringBuilder(htmlText); for (Element footnote : footnotes) { htmlTextBuilder.append("\n").append(footnote.attr("title")); } String en...
ArabicUtilities { @NonNull public static String cleanHtml(String htmlText) { Document doc = Jsoup.parse(htmlText); Elements footnotes = doc.select("a[title].comment"); StringBuilder htmlTextBuilder = new StringBuilder(htmlText); for (Element footnote : footnotes) { htmlTextBuilder.append("\n").append(footnote.attr("tit...
ArabicUtilities { @NonNull public static String cleanHtml(String htmlText) { Document doc = Jsoup.parse(htmlText); Elements footnotes = doc.select("a[title].comment"); StringBuilder htmlTextBuilder = new StringBuilder(htmlText); for (Element footnote : footnotes) { htmlTextBuilder.append("\n").append(footnote.attr("tit...
ArabicUtilities { @NonNull public static String cleanHtml(String htmlText) { Document doc = Jsoup.parse(htmlText); Elements footnotes = doc.select("a[title].comment"); StringBuilder htmlTextBuilder = new StringBuilder(htmlText); for (Element footnote : footnotes) { htmlTextBuilder.append("\n").append(footnote.attr("tit...
ArabicUtilities { @NonNull public static String cleanHtml(String htmlText) { Document doc = Jsoup.parse(htmlText); Elements footnotes = doc.select("a[title].comment"); StringBuilder htmlTextBuilder = new StringBuilder(htmlText); for (Element footnote : footnotes) { htmlTextBuilder.append("\n").append(footnote.attr("tit...
@Test public void cleanTashkeel() throws Exception { String testStringWithTashkeel = "فَكَمْ نَدْ رَأَيْنَا مِنْ رِجَالٍ وَدَوْلَةٍ ... فَبَادُوا جَمِيعًا مُسْرِعِينَ وَزَالُوا"; String testStringWithTashkeel2 = "خِلَافٌ يَصِحُّ تَخْرِيجُهُ عَلَى هَذِهِ الْقَاعِدَةِ لِأَنَّ قَوْلَهُ حَرَامٌ مُطْلَقٌ دَالٌّ عَلَى مُطْلَ...
public static String cleanTashkeel(@NonNull String s) { Matcher matcher = CLEANING_TASHKEEL.matcher(s); return matcher.replaceAll(""); }
ArabicUtilities { public static String cleanTashkeel(@NonNull String s) { Matcher matcher = CLEANING_TASHKEEL.matcher(s); return matcher.replaceAll(""); } }
ArabicUtilities { public static String cleanTashkeel(@NonNull String s) { Matcher matcher = CLEANING_TASHKEEL.matcher(s); return matcher.replaceAll(""); } }
ArabicUtilities { public static String cleanTashkeel(@NonNull String s) { Matcher matcher = CLEANING_TASHKEEL.matcher(s); return matcher.replaceAll(""); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull St...
ArabicUtilities { public static String cleanTashkeel(@NonNull String s) { Matcher matcher = CLEANING_TASHKEEL.matcher(s); return matcher.replaceAll(""); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull St...
@Test public void cleanTextForSearchingWthStingBuilder() throws Exception { }
@NonNull public static String cleanTextForSearchingWthStingBuilder(String s) { StringBuilder sb = new StringBuilder(s); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if ((c < HAMZAH || c > YEH) & !Character.isSpace(c)) { sb.deleteCharAt(i); i--; } else if (Character.isSpace(c)) { sb.setCharAt(i, ' '); ...
ArabicUtilities { @NonNull public static String cleanTextForSearchingWthStingBuilder(String s) { StringBuilder sb = new StringBuilder(s); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if ((c < HAMZAH || c > YEH) & !Character.isSpace(c)) { sb.deleteCharAt(i); i--; } else if (Character.isSpace(c)) { sb.s...
ArabicUtilities { @NonNull public static String cleanTextForSearchingWthStingBuilder(String s) { StringBuilder sb = new StringBuilder(s); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if ((c < HAMZAH || c > YEH) & !Character.isSpace(c)) { sb.deleteCharAt(i); i--; } else if (Character.isSpace(c)) { sb.s...
ArabicUtilities { @NonNull public static String cleanTextForSearchingWthStingBuilder(String s) { StringBuilder sb = new StringBuilder(s); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if ((c < HAMZAH || c > YEH) & !Character.isSpace(c)) { sb.deleteCharAt(i); i--; } else if (Character.isSpace(c)) { sb.s...
ArabicUtilities { @NonNull public static String cleanTextForSearchingWthStingBuilder(String s) { StringBuilder sb = new StringBuilder(s); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if ((c < HAMZAH || c > YEH) & !Character.isSpace(c)) { sb.deleteCharAt(i); i--; } else if (Character.isSpace(c)) { sb.s...
@Test public void startsWithDefiniteArticle() throws Exception { assertEquals(ArabicUtilities.startsWithDefiniteArticle("البخاري"), true); assertEquals(ArabicUtilities.startsWithDefiniteArticle("اللبن"), true); assertEquals(ArabicUtilities.startsWithDefiniteArticle("اللحم"), true); }
public static boolean startsWithDefiniteArticle(@NonNull String string) { return string.startsWith("ال"); }
ArabicUtilities { public static boolean startsWithDefiniteArticle(@NonNull String string) { return string.startsWith("ال"); } }
ArabicUtilities { public static boolean startsWithDefiniteArticle(@NonNull String string) { return string.startsWith("ال"); } }
ArabicUtilities { public static boolean startsWithDefiniteArticle(@NonNull String string) { return string.startsWith("ال"); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull String s); static String handle...
ArabicUtilities { public static boolean startsWithDefiniteArticle(@NonNull String string) { return string.startsWith("ال"); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull String s); static String handle...
@Test public void testFromFile() throws IOException { ConfigHelper helper = ConfigHelper.fromFile("src/test/resources/base-config.properties"); Assert.assertEquals("Base Property 1", helper.getRaw("prop1")); Assert.assertEquals("Base Property 2", helper.getRaw("prop2")); }
public static ConfigHelper fromFile(String file) throws IOException { return new ConfigHelper(file); }
ConfigHelper { public static ConfigHelper fromFile(String file) throws IOException { return new ConfigHelper(file); } }
ConfigHelper { public static ConfigHelper fromFile(String file) throws IOException { return new ConfigHelper(file); } ConfigHelper(); ConfigHelper(Properties properties); @Inject ConfigHelper(List<ConfigHelper> configuration); private ConfigHelper(String configFilename); private ConfigHelper(File configFile); priva...
ConfigHelper { public static ConfigHelper fromFile(String file) throws IOException { return new ConfigHelper(file); } ConfigHelper(); ConfigHelper(Properties properties); @Inject ConfigHelper(List<ConfigHelper> configuration); private ConfigHelper(String configFilename); private ConfigHelper(File configFile); priva...
ConfigHelper { public static ConfigHelper fromFile(String file) throws IOException { return new ConfigHelper(file); } ConfigHelper(); ConfigHelper(Properties properties); @Inject ConfigHelper(List<ConfigHelper> configuration); private ConfigHelper(String configFilename); private ConfigHelper(File configFile); priva...
@Test public void shouldSkipValidationOfUnreferencedProperties() { Properties properties = new Properties(); properties.put("property", "false"); ConfigHelper configHelper = new ConfigHelper(properties); PropertyTypeValidator validator = new PropertyTypeValidator(null, null); validator.validate(configHelper); }
@Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desiredType == Object.class) { continue; } String propertyValue ...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
@Test public void shouldSkipValidationOfPropertiesWithDefaultType() { Properties properties = new Properties(); properties.put("property", "false"); MappedConfiguration<String, Object> configuration = Mockito.mock(MappedConfiguration.class); ConfigHelper configHelper = new ConfigHelper(properties); configHelper.add("pr...
@Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desiredType == Object.class) { continue; } String propertyValue ...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
@Test public void shouldUseTypeCoercerWithValueFromSymbolSourceToValidatePropertyType() { Properties properties = new Properties(); properties.put("property", "${symbol}"); MappedConfiguration<String, Object> configuration = Mockito.mock(MappedConfiguration.class); TypeCoercer typeCoercer = Mockito.mock(TypeCoercer.cla...
@Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desiredType == Object.class) { continue; } String propertyValue ...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
PropertyTypeValidator implements ConfigHelperValidator { @Override public void validate(ConfigHelper configHelper) throws RuntimeException { for (String propertyName : configHelper.getPropertyNames()) { Class<?> desiredType = configHelper.getPropertyType(propertyName); if (desiredType == null) { continue; } if (desired...
@Test public void testGetClassNameForTable() throws Exception { Assert.assertEquals("ManagedSuperClassJoined", provider.getClassNameForTable(getTable("MANAGEDSUPERCLASSJOINED"))); Assert.assertEquals("SubEntityJoined1", provider.getClassNameForTable(getTable("SUB_ENTITY_JOINED_1"))); Assert.assertEquals("SubEntityJoine...
@Override public String getClassNameForTable(Table table) { ManagedType managedType = managedTypesByTableName.get(table.getName().toUpperCase()); return managedType != null ? managedType.getJavaType().getSimpleName() : fallbackNameProvider.getClassNameForTable(table); }
JpaMetamodelRedGProvider implements NameProvider, DataTypeProvider { @Override public String getClassNameForTable(Table table) { ManagedType managedType = managedTypesByTableName.get(table.getName().toUpperCase()); return managedType != null ? managedType.getJavaType().getSimpleName() : fallbackNameProvider.getClassNam...
JpaMetamodelRedGProvider implements NameProvider, DataTypeProvider { @Override public String getClassNameForTable(Table table) { ManagedType managedType = managedTypesByTableName.get(table.getName().toUpperCase()); return managedType != null ? managedType.getJavaType().getSimpleName() : fallbackNameProvider.getClassNam...
JpaMetamodelRedGProvider implements NameProvider, DataTypeProvider { @Override public String getClassNameForTable(Table table) { ManagedType managedType = managedTypesByTableName.get(table.getName().toUpperCase()); return managedType != null ? managedType.getJavaType().getSimpleName() : fallbackNameProvider.getClassNam...
JpaMetamodelRedGProvider implements NameProvider, DataTypeProvider { @Override public String getClassNameForTable(Table table) { ManagedType managedType = managedTypesByTableName.get(table.getName().toUpperCase()); return managedType != null ? managedType.getJavaType().getSimpleName() : fallbackNameProvider.getClassNam...
@Test public void testBuilder_ClassPrivate() { expectedException.expect(RuntimeException.class); expectedException.expectMessage("Could not instantiate RedG instance"); AbstractRedG redG = new RedGBuilder<>(PrivateRedG.class).build(); }
public T build() { final T inst = instance; instance = null; return inst; }
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } }
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); }
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); RedGBuilder<T> withDefaultValueStrategy(final DefaultValueStrategy strategy); RedGBuilder<T> withPreparedStatementParameterSetter(final PreparedSta...
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); RedGBuilder<T> withDefaultValueStrategy(final DefaultValueStrategy strategy); RedGBuilder<T> withPreparedStatementParameterSetter(final PreparedSta...
@Test public void testBuilder_DefaultConstructor() throws Exception { try { AbstractRedG redG = new RedGBuilder<>().build(); } catch (RuntimeException e) { assertEquals("Could not load default RedG class", e.getMessage()); } final ClassLoader classLoader = this.getClass().getClassLoader(); final Method defineClassMetho...
public T build() { final T inst = instance; instance = null; return inst; }
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } }
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); }
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); RedGBuilder<T> withDefaultValueStrategy(final DefaultValueStrategy strategy); RedGBuilder<T> withPreparedStatementParameterSetter(final PreparedSta...
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); RedGBuilder<T> withDefaultValueStrategy(final DefaultValueStrategy strategy); RedGBuilder<T> withPreparedStatementParameterSetter(final PreparedSta...
@Test public void testGetDummy_reuseCachedObject() throws Exception { AbstractRedG redG = spy(AbstractRedG.class); DefaultDummyFactory factory = new DefaultDummyFactory(); assertNotNull(factory); TestRedGEntity1 entity1 = factory.getDummy(redG, TestRedGEntity1.class); assertNotNull(entity1); TestRedGEntity1 entity2 = f...
@Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache.put(dummyClass, obj); return obj; }
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
@Test public void testGetDummy_transitiveDependencies() throws Exception { AbstractRedG redG = spy(AbstractRedG.class); DefaultDummyFactory factory = new DefaultDummyFactory(); assertNotNull(factory); TestRedGEntity2 entity2 = factory.getDummy(redG, TestRedGEntity2.class); assertNotNull(entity2); assertTrue(redG.findSi...
@Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache.put(dummyClass, obj); return obj; }
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
@Test public void testGetDummy_NoFittingConstructor() throws Exception { thrown.expect(DummyCreationException.class); thrown.expectMessage("Could not find a fitting constructor"); AbstractRedG redG = spy(AbstractRedG.class); DefaultDummyFactory factory = new DefaultDummyFactory(); assertNotNull(factory); factory.getDum...
@Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache.put(dummyClass, obj); return obj; }
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
@Test public void testGetDummy_NoFittingConstructor2() throws Exception { thrown.expect(DummyCreationException.class); thrown.expectMessage("Could not find a fitting constructor"); AbstractRedG redG = spy(AbstractRedG.class); DefaultDummyFactory factory = new DefaultDummyFactory(); assertNotNull(factory); factory.getDu...
@Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache.put(dummyClass, obj); return obj; }
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
@Test public void testGetDummy_NoFittingConstructor3() throws Exception { thrown.expect(DummyCreationException.class); thrown.expectMessage("Could not find a fitting constructor"); AbstractRedG redG = spy(AbstractRedG.class); DefaultDummyFactory factory = new DefaultDummyFactory(); assertNotNull(factory); factory.getDu...
@Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache.put(dummyClass, obj); return obj; }
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
@Test public void testGetDummy_InstantiationFails() throws Exception { thrown.expect(DummyCreationException.class); thrown.expectMessage("Instantiation of the dummy failed"); AbstractRedG redG = spy(AbstractRedG.class); DefaultDummyFactory factory = new DefaultDummyFactory(); assertNotNull(factory); factory.getDummy(re...
@Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache.put(dummyClass, obj); return obj; }
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
DefaultDummyFactory implements DummyFactory { @Override public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) { if (this.dummyCache.containsKey(dummyClass)) { return dummyClass.cast(this.dummyCache.get(dummyClass)); } final T obj = createNewDummy(redG, dummyClass); this.dummyCache...
@Test public void testInsertDataIntoDatabase() throws Exception { Connection connection = getConnection("-idid"); Statement stmt = connection.createStatement(); stmt.execute("CREATE TABLE TEST (CONTENT VARCHAR2(50 CHAR))"); List<MockEntity1> gObjects = IntStream.rangeClosed(1, 20).mapToObj(i -> new MockEntity1()).colle...
public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
@Test public void testInsertDataIntoDatabase2() throws Exception { Connection connection = getConnection("-idid2"); Statement stmt = connection.createStatement(); stmt.execute("CREATE TABLE TEST (CONTENT VARCHAR2(50 CHAR))"); List<MockEntity3> gObjects = IntStream.rangeClosed(1, 20).mapToObj(i -> new MockEntity3()).col...
public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
@Test public void testGetDataTypeByName() throws Exception { TypeMappings typeMappings = new TypeMappings(); typeMappings.setTableTypeMappings(Arrays.asList( new TableTypeMapping(".+", Collections.singletonList(new ColumnTypeMapping("ACTIVE", "java.lang.Boolean"))), new TableTypeMapping("JOIN_TABLE", Collections.single...
String getDataTypeByName(String tableName, String columnName) { if (typeMappings.getTableTypeMappings() == null) { return null; } return typeMappings.getTableTypeMappings().stream() .filter(tableTypeMapping -> tableName.matches(tableTypeMapping.getTableName())) .flatMap(tableTypeMapping -> tableTypeMapping.getColumnTyp...
XmlFileDataTypeProvider implements DataTypeProvider { String getDataTypeByName(String tableName, String columnName) { if (typeMappings.getTableTypeMappings() == null) { return null; } return typeMappings.getTableTypeMappings().stream() .filter(tableTypeMapping -> tableName.matches(tableTypeMapping.getTableName())) .fla...
XmlFileDataTypeProvider implements DataTypeProvider { String getDataTypeByName(String tableName, String columnName) { if (typeMappings.getTableTypeMappings() == null) { return null; } return typeMappings.getTableTypeMappings().stream() .filter(tableTypeMapping -> tableName.matches(tableTypeMapping.getTableName())) .fla...
XmlFileDataTypeProvider implements DataTypeProvider { String getDataTypeByName(String tableName, String columnName) { if (typeMappings.getTableTypeMappings() == null) { return null; } return typeMappings.getTableTypeMappings().stream() .filter(tableTypeMapping -> tableName.matches(tableTypeMapping.getTableName())) .fla...
XmlFileDataTypeProvider implements DataTypeProvider { String getDataTypeByName(String tableName, String columnName) { if (typeMappings.getTableTypeMappings() == null) { return null; } return typeMappings.getTableTypeMappings().stream() .filter(tableTypeMapping -> tableName.matches(tableTypeMapping.getTableName())) .fla...
@Test public void testInsertDataIntoDatabase3() throws Exception { Connection connection = getConnection("-idid3"); Statement stmt = connection.createStatement(); stmt.execute("CREATE TABLE TEST (CONTENT VARCHAR2(50 CHAR))"); List<MockEntity4> gObjects = IntStream.rangeClosed(1, 20).mapToObj(i -> new MockEntity4()).col...
public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
@Test public void testInsertExistingDataIntoDatabase() throws Exception { Connection connection = getConnection("-iedid"); Statement stmt = connection.createStatement(); stmt.execute("CREATE TABLE TEST (CONTENT VARCHAR2(50 CHAR))"); stmt.execute("INSERT INTO TEST VALUES ('obj1')"); RedGDatabaseUtil.insertDataIntoDataba...
public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
@Test public void testInsertExistingDataIntoDatabase_NotExisting() throws Exception { this.thrown.expect(ExistingEntryMissingException.class); Connection connection = getConnection("-iedidm"); Statement stmt = connection.createStatement(); stmt.execute("CREATE TABLE TEST (CONTENT VARCHAR2(50 CHAR))"); RedGDatabaseUtil....
public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); }
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
RedGDatabaseUtil { public static void insertDataIntoDatabase(List<? extends RedGEntity> gObjects, final Connection connection) { insertDataIntoDatabase(gObjects, connection, new DefaultPreparedStatementParameterSetter()); } private RedGDatabaseUtil(); static void insertDataIntoDatabase(List<? extends RedGEntity> gObje...
@Test public void entitiesAreSortedByDepths() throws Exception { EntitySorter entitySorter = new EntitySorter(); Entity leafEntity1 = new Entity("leafEntity1"); Entity leafEntity2 = new Entity("leafEntity2"); Entity leafEntity3 = new Entity("leafEntity3"); Entity nonLeaf1 = new Entity("nonLeaf1", leafEntity1, leafEntit...
public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList()); }
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
@Test public void entitiesSelfReferenceTest() throws Exception { Entity root = new Entity("root"); root.addDependency(root); Entity leaf = new Entity("leaf", root); Entity leafWithSelf = new Entity("leafWithSelf", root, leaf); leafWithSelf.addDependency(leafWithSelf); List<RedGEntity> sorted = EntitySorter.sortEntities...
public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList()); }
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
@Test public void existingEntitiesFirst() throws Exception { EntitySorter entitySorter = new EntitySorter(); Entity existingEntity1 = new ExistingEntity("existingEntity1"); Entity leafEntity1 = new Entity("leafEntity1"); Entity existingEntity2 = new ExistingEntity("existingEntity2"); Entity leafEntity2 = new Entity("le...
public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList()); }
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
EntitySorter { public static List<RedGEntity> sortEntities(List<RedGEntity> entities) { Map<RedGEntity, Integer> depths = new DepthCalculator().calculateDepths(entities); return entities.stream() .sorted(Comparator.comparing(EntitySorter::isExisting).reversed().thenComparingInt(depths::get)) .collect(Collectors.toList(...
@Test public void testGetFullSqlName() throws Exception { final TableModel tm1 = new TableModel(); tm1.setSqlFullName("TEST.TABLE"); assertThat(wrapGetFullTableName(new DataExtractor(), tm1)).isEqualTo("TEST.TABLE"); final TableModel tm2 = new TableModel(); tm2.setSqlFullName("TEST.\"TABLE\""); assertThat(wrapGetFullTa...
public void setSqlSchemaName(String sqlSchemaName) { this.sqlSchemaName = sqlSchemaName; }
DataExtractor { public void setSqlSchemaName(String sqlSchemaName) { this.sqlSchemaName = sqlSchemaName; } }
DataExtractor { public void setSqlSchemaName(String sqlSchemaName) { this.sqlSchemaName = sqlSchemaName; } }
DataExtractor { public void setSqlSchemaName(String sqlSchemaName) { this.sqlSchemaName = sqlSchemaName; } JavaCodeRepresentationProvider getJcrProvider(); void setJcrProvider(final JavaCodeRepresentationProvider jcrProvider); Function<EntityModel, EntityInclusionMode> getEntityModeDecider(); void setEntityModeDecider...
DataExtractor { public void setSqlSchemaName(String sqlSchemaName) { this.sqlSchemaName = sqlSchemaName; } JavaCodeRepresentationProvider getJcrProvider(); void setJcrProvider(final JavaCodeRepresentationProvider jcrProvider); Function<EntityModel, EntityInclusionMode> getEntityModeDecider(); void setEntityModeDecider...
@Test @Ignore public void extractTableModelsFromSourceCode() throws Exception { TableModelExtractor.extractTableModelsFromSourceCode(Paths.get("D:\\redg\\redg-playground\\target\\generated-test-sources\\redg"), "com.btc.redg.generated", "G"); }
public static List<TableModel> extractTableModelsFromSourceCode(final Path srcDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException { LOG.debug("Starting table model extraction from source code..."); final List<TableModel> results = new ArrayList<>(); final String packageNa...
TableModelExtractor { public static List<TableModel> extractTableModelsFromSourceCode(final Path srcDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException { LOG.debug("Starting table model extraction from source code..."); final List<TableModel> results = new ArrayList<>(); ...
TableModelExtractor { public static List<TableModel> extractTableModelsFromSourceCode(final Path srcDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException { LOG.debug("Starting table model extraction from source code..."); final List<TableModel> results = new ArrayList<>(); ...
TableModelExtractor { public static List<TableModel> extractTableModelsFromSourceCode(final Path srcDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException { LOG.debug("Starting table model extraction from source code..."); final List<TableModel> results = new ArrayList<>(); ...
TableModelExtractor { public static List<TableModel> extractTableModelsFromSourceCode(final Path srcDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException { LOG.debug("Starting table model extraction from source code..."); final List<TableModel> results = new ArrayList<>(); ...