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


Java NoNameCoder类代码示例

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


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

示例1: mapEnvelope

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
private XStream mapEnvelope() {
    XStream xstream = new XStream(new DomDriver("UTF-8", new NoNameCoder()));

    xstream.alias("data", CommcareRequestData.class);
    xstream.useAttributeFor(CommcareRequestData.class, "xmlns");
    xstream.aliasField("case", CommcareRequestData.class, "ccCase");

    xstream.alias("meta", MetaElement.class);
    xstream.useAttributeFor(MetaElement.class, "xmlns");
    xstream.useAttributeFor(CaseRequest.class, "caseId");
    xstream.aliasField("case_id", CaseRequest.class, "caseId");
    xstream.useAttributeFor(CaseRequest.class, "userId");
    xstream.aliasField("user_id", CaseRequest.class, "userId");
    xstream.useAttributeFor(CaseRequest.class, "xmlns");
    xstream.useAttributeFor(CaseRequest.class, "dateModified");
    xstream.aliasField("date_modified", CaseRequest.class, "dateModified");

    return xstream;
}
 
开发者ID:motech,项目名称:modules,代码行数:20,代码来源:CaseTaskXmlConverter.java

示例2: getXStream

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
private XStream getXStream() {
    if (supportedClasses.isEmpty()) {
        init();
    }

    NameCoder replacer = new NoNameCoder();
    final XStream xStream = new XStream(new XppDriver(replacer)) {
        @Override
        protected MapperWrapper wrapMapper(final MapperWrapper next) {
            return new MapperWrapper(next) {
                @Override
                public boolean shouldSerializeMember(final Class definedIn, final String fieldName) {
                    if (definedIn == Object.class) {
                        return false;
                    }
                    return super.shouldSerializeMember(definedIn, fieldName);
                }
            };
        }
    };
    xStream.registerConverter(new NullDoubleConverter());
    xStream.registerConverter(new NullLongConverter());
    xStream.processAnnotations(supportedClasses.toArray(new Class[supportedClasses.size()]));
    return xStream;
}
 
开发者ID:SoftTeco,项目名称:st-toolset,代码行数:26,代码来源:AbstractXmlProcessor.java

示例3: createReader

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
/**
 * Creates a {@link HierarchicalStreamReader} using the given inputMessage.
 *
 * @param inputMessage
 *            The {@link HttpInputMessage} to create the reader from.
 * @return A Fully constructed {@link HierarchicalStreamReader}.
 * @throws IllegalStateException
 *             Thrown if errors occur during the creation of the
 *             {@link HierarchicalStreamReader}.
 * @since 1.0.0
 */
public static HierarchicalStreamReader createReader(final HttpInputMessage inputMessage) {
	XmlPullParserFactory factory;
	try {
		factory = XmlPullParserFactory.newInstance();
		final XppReader reader = new XppReader(new InputStreamReader(inputMessage.getBody()),
				factory.newPullParser(), new NoNameCoder());
		return new PathTrackingReader(reader, new PathTracker());
	} catch (XmlPullParserException | IOException e) {
		LOGGER.error("Marshalling failure; unable to create stream reader to process HTTP response");
	}
	throw new IllegalStateException("Unable to create HierarchicalStreamReader");
}
 
开发者ID:stevensimmons,项目名称:restalm,代码行数:24,代码来源:MarshallingUtils.java

示例4: createReader

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
private HierarchicalStreamReader createReader(final Reader reader) {
	XmlPullParserFactory factory;
	try {
		factory = XmlPullParserFactory.newInstance();
		return new XppReader(reader, factory.newPullParser(), new NoNameCoder());
	} catch (final XmlPullParserException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	throw new IllegalStateException("Unable to create HierarchicalStreamReader");
}
 
开发者ID:stevensimmons,项目名称:restalm,代码行数:12,代码来源:MarshallingUtilsTest.java

示例5: openReader

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
private static XppReader openReader(final String text, final boolean checkForContent) throws PyDebuggerException {
  final XppReader reader = new XppReader(new StringReader(text), new MXParser(), new NoNameCoder());
  if (checkForContent && !reader.hasMoreChildren()) {
    throw new PyDebuggerException("Empty frame: " + text);
  }
  return reader;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProtocolParser.java

示例6: initialValue

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
@Override
protected XStream initialValue() {
    // use NoNameCoder to avoid escaping __ in custom field names
    // and CompactWriter to avoid pretty printing
    XStream result = new XStream(new XppDriver(new NoNameCoder()) {
        @Override
        public HierarchicalStreamWriter createWriter(Writer out) {
            return new CompactWriter(out, getNameCoder());
        }

    });
    XStreamUtils.addDefaultPermissions(result);
    result.registerConverter(new JodaTimeConverter());
    return result;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:XmlRestProcessor.java

示例7: convertToFormXml

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public String convertToFormXml(FormXml form) {
    XStream xstream = new XStream(new DomDriver("UTF-8", new NoNameCoder()));

    xstream.registerConverter(new FormElementConverter());
    xstream.alias("data", FormXml.class);

    return XML_START_TAG + xstream.toXML(form);
}
 
开发者ID:motech,项目名称:modules,代码行数:9,代码来源:FormXmlConverter.java

示例8: AbstractDriver

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
/**
 * Creates an AbstractDriver with a NameCoder that does nothing.
 */
public AbstractDriver() {
    this(new NoNameCoder());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:AbstractDriver.java

示例9: AbstractReader

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
protected AbstractReader()
{
  this(new NoNameCoder());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:AbstractReader.java

示例10: AbstractJsonWriter

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public AbstractJsonWriter()
{
  this(new NoNameCoder());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:AbstractJsonWriter.java

示例11: Format

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public Format(char[] paramArrayOfChar1, char[] paramArrayOfChar2, int paramInt)
{
  this(paramArrayOfChar1, paramArrayOfChar2, paramInt, new NoNameCoder());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:JsonWriter.java

示例12: AbstractDriver

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public AbstractDriver()
{
  this(new NoNameCoder());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:AbstractDriver.java

示例13: AbstractWriter

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
protected AbstractWriter()
{
  this(new NoNameCoder());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:AbstractWriter.java

示例14: generatorStream

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public static XStream generatorStream() {
    XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver(new NoNameCoder()));
    xstream.setMode(XStream.NO_REFERENCES);
    xstream.processAnnotations(GeneratorPolicy.class);
    return xstream;
}
 
开发者ID:delving,项目名称:x3ml,代码行数:7,代码来源:X3ML.java

示例15: x3mlStream

import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public static XStream x3mlStream() {
    XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver(new NoNameCoder()));
    xstream.setMode(XStream.NO_REFERENCES);
    xstream.processAnnotations(RootElement.class);
    return xstream;
}
 
开发者ID:delving,项目名称:x3ml,代码行数:7,代码来源:X3ML.java


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