本文整理汇总了Java中org.apache.tapestry5.ValueEncoder类的典型用法代码示例。如果您正苦于以下问题:Java ValueEncoder类的具体用法?Java ValueEncoder怎么用?Java ValueEncoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueEncoder类属于org.apache.tapestry5包,在下文中一共展示了ValueEncoder类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEncoder
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public ValueEncoder getEncoder()
{
return new ValueEncoder<TestBean>()
{
public String toClient(TestBean value)
{
return value.getTestProperty();
}
public TestBean toValue(String keyAsString)
{
return new TestBean(keyAsString);
}
};
}
示例2: getEncoder
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public ValueEncoder getEncoder()
{
return new ValueEncoder<TestBean>()
{
public String toClient(TestBean value)
{
return value.getTestProperty();
}
public TestBean toValue(String keyAsString)
{
// not thread safe
return new TestBean(keyAsString);
}
};
}
示例3: getVdrEncoder
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
public ValueEncoder<JonglistoVdr> getVdrEncoder() {
return new ValueEncoder<JonglistoVdr>() {
@Override
public String toClient(JonglistoVdr value) {
return value.getUuid();
}
@Override
public JonglistoVdr toValue(String clientValue) {
return setup.getAvailableVdr().stream().filter(s -> s.getUuid().equals(clientValue)).findFirst().get();
}
};
}
示例4: getViewEncoder
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
public ValueEncoder<JonglistoView> getViewEncoder() {
return new ValueEncoder<JonglistoView>() {
@Override
public String toClient(JonglistoView value) {
return value.getUuid();
}
@Override
public JonglistoView toValue(String clientValue) {
return setup.getAvailableViews().stream().filter(s -> s.getUuid().equals(clientValue)).findFirst().get();
}
};
}
示例5: create
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
@Override
public ValueEncoder<Channel> create(Class<Channel> type) {
return this;
}
示例6: create
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
@Override
public ValueEncoder<VDR> create(Class<VDR> type) {
return this;
}
示例7: get
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
/**
* Lookup a {@link ValueEncoder} and convert the string to an object.
*/
public <T> T get(Class<T> type, int index) {
ValueEncoder<T> encoder = valueEncoderSource.getValueEncoder(type);
return encoder.toValue(strings.get(index));
}
示例8: create
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
public ValueEncoder<Page> create(Class<Page> type) {
return this;
}
示例9: create
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
public ValueEncoder<User> create(Class<User> type) {
return this;
}
示例10: provideEncoder
import org.apache.tapestry5.ValueEncoder; //导入依赖的package包/类
@Contribute(ValueEncoderSource.class)
public static void provideEncoder(MappedConfiguration<Class, ValueEncoder> configuration){
configuration.addInstance(OAuthClient.class, ClientValueEncoder.class);
}