当前位置: 首页>>代码示例>>Java>>正文


Java Transform类代码示例

本文整理汇总了Java中org.simpleframework.xml.transform.Transform的典型用法代码示例。如果您正苦于以下问题:Java Transform类的具体用法?Java Transform怎么用?Java Transform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Transform类属于org.simpleframework.xml.transform包,在下文中一共展示了Transform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: match

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
public Transform match(Class type) throws Exception {
    Transform transform = super.match(type);
    if (transform == null) {
        if (Type.class.isAssignableFrom(type))
            transform = TypeTransform.getInstance();
        else if (Throwable.class.isAssignableFrom(type))
            transform = SerializableTransform.getInstance();
        else if (Charset.class.isAssignableFrom(type))
            return super.match(Charset.class);
        // bind(type, transform);
    }
    // LOG.info("Transform " + type + " using " + transform, new Exception());
    return transform;
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:17,代码来源:PersisterFactory.java

示例2: match

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Transform<?> match(Class type) throws Exception {
    if(Condition.class.isAssignableFrom(type)){
        return new Transform<Condition>() {
            @Override
            public Condition read(String s) throws Exception {
                return Condition.makeCondition(s);
            }

            @Override
            public String write(Condition condition) throws Exception {
                return condition.toString();
            }
        };
    }
    return null;
}
 
开发者ID:ericleib,项目名称:blindtale,代码行数:18,代码来源:TaleParser.java

示例3: match

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Transform<?> match(Class type) throws Exception {
	if (type.equals(Coordinate.class))			return new CoordinateTransformer();
	else if (type.equals(Coordinates.class))	return new CoordinatesTransformer();
	return null;
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:8,代码来源:Serializer.java

示例4: createPersister

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
public static Persister createPersister(final Account account) {
    return new Persister(new Matcher() {
        @Override
        public Transform match(Class type) throws Exception {
            if (Date.class.isAssignableFrom(type)) {
                return new DateTransform(account);
            } else if (Uri.class.isAssignableFrom(type)) {
                return new UriTransform(account);
            }

            return null;
        }
    });
}
 
开发者ID:dyweb,项目名称:gitlab-android,代码行数:15,代码来源:SimpleXmlProvider.java

示例5: match

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Transform match(Class type) throws Exception {
    if (type.equals(Integer.class)) {
        return new IntegerTransformer();
    }

    return null;
}
 
开发者ID:miniME89,项目名称:PassBeam,代码行数:9,代码来源:TransformMatcher.java

示例6: addTransformers

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
private static void addTransformers(@Nonnull RegistryMatcher matcher, @Nonnull Serializer serializer, @Nonnull Iterable<? extends TransformFactory> factories) {
    for (TransformFactory factory : factories) {
        // LOG.info("Factory " + factory);
        for (Map.Entry<? extends Class<?>, ? extends Transform<?>> e : factory.newTransforms()) {
            // LOG.info("Register " + e.getKey() + " -> " + e.getValue());
            try {
                matcher.bind(e.getKey(), e.getValue());
            } catch (Exception ex) {
                LOG.error("Failed to bind " + e.getKey() + " to " + e.getValue(), ex);
            }
        }
    }
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:14,代码来源:PersisterFactory.java

示例7: newTransforms

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Iterable<? extends Map.Entry<? extends Class<?>, ? extends Transform<?>>> newTransforms() {
    return Arrays.asList(
            Maps.immutableEntry(Type.class, this),
            Maps.immutableEntry(Class.class, this)
    );
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:8,代码来源:TypeTransform.java

示例8: newTransforms

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Iterable<? extends Entry<? extends Class<?>, ? extends Transform<?>>> newTransforms() {
    return Arrays.asList(
            Maps.immutableEntry(InetAddress.class, this),
            Maps.immutableEntry(Inet4Address.class, this),
            Maps.immutableEntry(Inet6Address.class, this));
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:9,代码来源:InetAddressTransform.java

示例9: newRegistryMatcher

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Nonnull
private static RegistryMatcher newRegistryMatcher() {
    RegistryMatcher matcher = new RegistryMatcher() {
        @Override
        public Transform match(Class type) throws Exception {
            if (Type.class.isAssignableFrom(type))
                return TypeTransform.getInstance();
            return super.match(type);
        }
    };
    return matcher;
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:13,代码来源:TypeConverterTest.java

示例10: unUnloaded

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public void unUnloaded() {
	SerializeHelper sh = SerializeHelper.get();
	for(Entry<Class<?>, Class<? extends Transform<?>>> entry : matcherMap.entrySet()) {
		sh.removeTransformMapping(entry.getKey());
	}
	matcherMap.clear();
}
 
开发者ID:Angerona,项目名称:angerona-framework,代码行数:9,代码来源:AngeronaPluginAdapter.java

示例11: match

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Transform match(Class type) throws Exception {
    if (Date.class.equals(type)) {
        return new AbcDateTransform();
    }
    return null;
}
 
开发者ID:aviewdevs,项目名称:aview,代码行数:9,代码来源:AbcDateMatcher.java

示例12: newTransforms

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Iterable<? extends Map.Entry<? extends Class<?>, ? extends Transform<?>>> newTransforms() {
    return Collections.singletonList(Maps.immutableEntry(InterfaceAddress.class, this));
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:5,代码来源:InterfaceAddressTransform.java

示例13: newTransforms

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Iterable<? extends Map.Entry<? extends Class<?>, ? extends Transform<?>>> newTransforms() {
    return Collections.singletonList(Maps.immutableEntry(NetworkAddress.class, this));
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:5,代码来源:NetworkAddressTransform.java

示例14: newTransforms

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Iterable<? extends Map.Entry<? extends Class<?>, ? extends Transform<?>>> newTransforms() {
    return Collections.singletonList(Maps.immutableEntry(HardwareAddress.class, this));
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:5,代码来源:HardwareAddressTransform.java

示例15: newTransforms

import org.simpleframework.xml.transform.Transform; //导入依赖的package包/类
@Override
public Iterable<? extends Entry<? extends Class<?>, ? extends Transform<?>>> newTransforms() {
    return Collections.singleton(Maps.immutableEntry(double[].class, this));
}
 
开发者ID:shevek,项目名称:simple-xml-serializers,代码行数:5,代码来源:DoubleArrayTransform.java


注:本文中的org.simpleframework.xml.transform.Transform类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。