本文整理汇总了Java中com.google.inject.internal.Annotations.memberValueString方法的典型用法代码示例。如果您正苦于以下问题:Java Annotations.memberValueString方法的具体用法?Java Annotations.memberValueString怎么用?Java Annotations.memberValueString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.inject.internal.Annotations
的用法示例。
在下文中一共展示了Annotations.memberValueString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import com.google.inject.internal.Annotations; //导入方法依赖的package包/类
@Override
public String toString() {
return "@"
+ Assisted.class.getName()
+ "(value="
+ Annotations.memberValueString("")
+ ")";
}
示例2: toString
import com.google.inject.internal.Annotations; //导入方法依赖的package包/类
@Override
public String toString() {
return "@"
+ javax.inject.Named.class.getName()
+ "(value="
+ Annotations.memberValueString(value)
+ ")";
}
示例3: toString
import com.google.inject.internal.Annotations; //导入方法依赖的package包/类
@Override
public String toString() {
return "@" + Named.class.getName() + "(value=" + Annotations.memberValueString(value) + ")";
}
示例4: testMissingBindings
import com.google.inject.internal.Annotations; //导入方法依赖的package包/类
public void testMissingBindings() {
try {
Guice.createInjector(
// We put each binding in a separate module so the order of the error messages doesn't
// depend on line numbers
new AbstractModule() {
@Override
public void configure() {
getProvider(Runnable.class);
}
},
new AbstractModule() {
@Override
public void configure() {
bind(Comparator.class);
}
},
new AbstractModule() {
@Override
public void configure() {
requireBinding(Key.get(new TypeLiteral<Callable<String>>() {}));
}
},
new AbstractModule() {
@Override
public void configure() {
bind(Date.class).annotatedWith(Names.named("date"));
}
});
fail("Expected CreationException");
} catch (CreationException e) {
assertEquals(4, e.getErrorMessages().size());
String segment1 = "No implementation for java.lang.Runnable was bound.";
String segment2 = "No implementation for " + Comparator.class.getName() + " was bound.";
String segment3 =
"No implementation for java.util.concurrent.Callable<java.lang.String> was" + " bound.";
String segment4 =
"No implementation for java.util.Date annotated with @"
+ Named.class.getName()
+ "(value="
+ Annotations.memberValueString("date")
+ ") was bound.";
String atSegment = "at " + getClass().getName();
String sourceFileName = getDeclaringSourcePart(getClass());
assertContains(
e.getMessage(),
segment1,
atSegment,
sourceFileName,
segment2,
atSegment,
sourceFileName,
segment3,
atSegment,
sourceFileName,
segment4,
atSegment,
sourceFileName);
}
}