Examples of alias()


Examples of com.thoughtworks.xstream.XStream.alias()

   */
  public ArrayList<String> getFlexions(String partOfSpeech, String word) {
    InputStream xmlReplyStream = retreiveXMLReply(partOfSpeech, word);
    XStream xstream = XStreamHelper.createXStreamInstance();
    xstream.alias("xml", FlexionReply.class);
    xstream.alias("wordform", String.class);
    ArrayList<String> stemWithWordforms;
    try {
      Object msReply = XStreamHelper.readObject(xstream, xmlReplyStream);
      FlexionReply flexionReply = (FlexionReply) msReply;
      // set reply status to remind it
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

   * @see org.olat.core.commons.modules.glossary.morphService.FlexionServiceClient#getFlexions(java.lang.String, java.lang.String)
   */
  public ArrayList<String> getFlexions(String partOfSpeech, String word) {
    XStream xstream = XStreamHelper.createXStreamInstance();
    File replyFile = new File(PATH_TO_MS_REPLY_XML);
    xstream.alias("msreply",FlexionReply.class);
    xstream.alias("wordform", String.class);
    Object msReply = XStreamHelper.readObject(xstream,replyFile);
    FlexionReply flexionReply = (FlexionReply) msReply;
    ArrayList<String> stemWithWordforms = flexionReply.getStem();
    return stemWithWordforms;
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

   */
  public ArrayList<String> getFlexions(String partOfSpeech, String word) {
    XStream xstream = XStreamHelper.createXStreamInstance();
    File replyFile = new File(PATH_TO_MS_REPLY_XML);
    xstream.alias("msreply",FlexionReply.class);
    xstream.alias("wordform", String.class);
    Object msReply = XStreamHelper.readObject(xstream,replyFile);
    FlexionReply flexionReply = (FlexionReply) msReply;
    ArrayList<String> stemWithWordforms = flexionReply.getStem();
    return stemWithWordforms;
  }
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

          }
        };
      }
    });

    xstream.alias(XML_GLOSSARY_ITEM_NAME, GlossaryItem.class);
    glossaryItemArr = removeEmptyGlossaryItems(glossaryItemArr);
    XStreamHelper.writeObject(xstream, glossaryFile, glossaryItemArr);
  }

 
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

  @SuppressWarnings("unchecked")
  private ArrayList<GlossaryItem> loadGlossaryItemListFromFile(VFSLeaf glossaryFile) {
    ArrayList<GlossaryItem> glossaryItemList = new ArrayList<GlossaryItem>();
    if (glossaryFile == null) { return new ArrayList<GlossaryItem>(); }
    XStream xstream = XStreamHelper.createXStreamInstance();
    xstream.alias(XML_GLOSSARY_ITEM_NAME, GlossaryItem.class);
    Object glossObj = XStreamHelper.readObject(xstream, glossaryFile.getInputStream());
    if (glossObj instanceof ArrayList) {
      ArrayList<GlossaryItem> glossItemsFromFile = (ArrayList<GlossaryItem>) glossObj;
      glossaryItemList.addAll(glossItemsFromFile);
    } else {
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

    case JSON:
      Gson gson = new Gson();
      return gson.fromJson(entity, Page.class).content;
    case XML:
      XStream xstream = new XStream();
      xstream.alias("page", Page.class);
      xstream.ignoreUnknownElements();
      return ((Page) xstream.fromXML(entity)).content;
    default:
      return entity;
    }
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

    }

    protected XStream configureXStream() {
        XStream stream = new XStream();
        stream.addImplicitCollection(Page.class, "link");
        stream.alias("results", Results.class);
        stream.alias("result", Page.class);
        stream.alias("content", Page.class);
        stream.alias("link", Link.class);
        stream.useAttributeFor(Link.class, "rel");
        stream.useAttributeFor(Link.class, "href");
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

    protected XStream configureXStream() {
        XStream stream = new XStream();
        stream.addImplicitCollection(Page.class, "link");
        stream.alias("results", Results.class);
        stream.alias("result", Page.class);
        stream.alias("content", Page.class);
        stream.alias("link", Link.class);
        stream.useAttributeFor(Link.class, "rel");
        stream.useAttributeFor(Link.class, "href");
        stream.ignoreUnknownElements();
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

    protected XStream configureXStream() {
        XStream stream = new XStream();
        stream.addImplicitCollection(Page.class, "link");
        stream.alias("results", Results.class);
        stream.alias("result", Page.class);
        stream.alias("content", Page.class);
        stream.alias("link", Link.class);
        stream.useAttributeFor(Link.class, "rel");
        stream.useAttributeFor(Link.class, "href");
        stream.ignoreUnknownElements();
        return stream;
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.alias()

        XStream stream = new XStream();
        stream.addImplicitCollection(Page.class, "link");
        stream.alias("results", Results.class);
        stream.alias("result", Page.class);
        stream.alias("content", Page.class);
        stream.alias("link", Link.class);
        stream.useAttributeFor(Link.class, "rel");
        stream.useAttributeFor(Link.class, "href");
        stream.ignoreUnknownElements();
        return stream;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.