本文整理汇总了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;
}
示例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;
}
示例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");
}
示例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");
}
示例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;
}
示例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;
}
示例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);
}
示例8: AbstractDriver
import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
/**
* Creates an AbstractDriver with a NameCoder that does nothing.
*/
public AbstractDriver() {
this(new NoNameCoder());
}
示例9: AbstractReader
import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
protected AbstractReader()
{
this(new NoNameCoder());
}
示例10: AbstractJsonWriter
import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public AbstractJsonWriter()
{
this(new NoNameCoder());
}
示例11: Format
import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public Format(char[] paramArrayOfChar1, char[] paramArrayOfChar2, int paramInt)
{
this(paramArrayOfChar1, paramArrayOfChar2, paramInt, new NoNameCoder());
}
示例12: AbstractDriver
import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
public AbstractDriver()
{
this(new NoNameCoder());
}
示例13: AbstractWriter
import com.thoughtworks.xstream.io.naming.NoNameCoder; //导入依赖的package包/类
protected AbstractWriter()
{
this(new NoNameCoder());
}
示例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;
}
示例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;
}