com.google.inject.ImplementedBy Java Examples

The following examples show how to use com.google.inject.ImplementedBy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReflectiveParserManifest.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected void configure() {
    final ImplementedBy implementedBy = type.getRawType().getAnnotation(ImplementedBy.class);

    bind(parserKey).toInstance(new ReflectiveParserImpl(
        implementedBy != null ? implementedBy.value() : this.baseClass,
        Members.annotations(Parseable.Property.class, Methods.declaredMethodsInAncestors(type.getRawType()))
               .merge(this::createProperty)
               .collect(Collectors.toImmutableList())
    ));
}
 
Example #2
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testParameterizedAnnotationOnType_01() throws Exception {
	final String text = "@com.google.inject.ImplementedBy(typeof(String)) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == String.class);
}
 
Example #3
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testParameterizedAnnotationOnType_02() throws Exception {
	final String text = "@com.google.inject.ImplementedBy(String) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == String.class);
}
 
Example #4
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testParameterizedAnnotationOnType_03() throws Exception {
	final String text = "@com.google.inject.ImplementedBy(java.lang.String) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == String.class);
}
 
Example #5
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testParameterizedAnnotationOnType_04() throws Exception {
	final String text = "@com.google.inject.ImplementedBy(java.util.Map.Entry) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == Map.Entry.class);
}
 
Example #6
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testParameterizedAnnotationOnType_05() throws Exception {
	final String text = "@com.google.inject.ImplementedBy(java.util.Map$Entry) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == Map.Entry.class);
}
 
Example #7
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testKeyValueParameterizedAnnotationOnType_01() throws Exception {
	final String text = "@com.google.inject.ImplementedBy( value = typeof(String)) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == String.class);
}
 
Example #8
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testKeyValueParameterizedAnnotationOnType_02() throws Exception {
	final String text = "@com.google.inject.ImplementedBy( value = String) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == String.class);
}
 
Example #9
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testKeyValueParameterizedAnnotationOnType_03() throws Exception {
	final String text = "@com.google.inject.ImplementedBy( value = java.lang.String) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == String.class);
}
 
Example #10
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testKeyValueParameterizedAnnotationOnType_04() throws Exception {
	final String text = "@com.google.inject.ImplementedBy( value = java.util.Map.Entry) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == Map.Entry.class);
}
 
Example #11
Source File: AnnotationsCompilerTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testKeyValueParameterizedAnnotationOnType_05() throws Exception {
	final String text = "@com.google.inject.ImplementedBy( value = java.util.Map$Entry) class Foo {}";
	ImplementedBy implementedBy = getAnnotationOnClass(text, ImplementedBy.class);
	assertTrue(implementedBy.value() == Map.Entry.class);
}