com.thoughtworks.xstream.annotations.XStreamAliasType Java Examples

The following examples show how to use com.thoughtworks.xstream.annotations.XStreamAliasType. 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: XStreamUtils.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public boolean allows(Class type) {
    if (type == null) {
        return false;
    } else {
        return type.isAnnotationPresent( XStreamAlias.class) || type.isAnnotationPresent( XStreamAliasType.class) || type.isAnnotationPresent( XStreamInclude.class);
    }
}
 
Example #2
Source File: AnnotationMapper.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void processAliasTypeAnnotation(final Class<?> type) {
    final XStreamAliasType aliasAnnotation = type.getAnnotation(XStreamAliasType.class);
    if (aliasAnnotation != null) {
        if (classAliasingMapper == null) {
            throw new InitializationException("No "
                + ClassAliasingMapper.class.getName()
                + " available");
        }
        classAliasingMapper.addTypeAlias(aliasAnnotation.value(), type);
    }
}