Android Open Source - JsonPullParser Complex Data






From Project

Back to project page JsonPullParser.

License

The source code is released under:

Apache License

If you think the Android project JsonPullParser listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright 2011 vvakame <vvakame@gmail.com>
 *//from w  w w.ja v a2s. c  o  m
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.vvakame.sample;

import java.util.Date;
import java.util.List;

import net.vvakame.util.jsonpullparser.annotation.JsonKey;
import net.vvakame.util.jsonpullparser.annotation.JsonModel;

/**
 * A class with fields that {@link JsonModel} attached.
 * @author vvakame
 */
@JsonModel
public class ComplexData {

  @JsonKey
  String name;

  @JsonKey
  Date date;

  @JsonKey
  List<Date> dateList;

  @JsonKey
  List<TestData> list1;

  @JsonKey
  List<? extends TestData> list2;

  @JsonKey
  List<? extends TestData> list3;

  @JsonKey
  TestData data;

  @JsonKey
  SampleEnum outerEnum;

  @JsonKey
  List<SampleEnum> outerEnumList;

  @JsonKey
  InternalEnum innerEnum;

  @JsonKey
  List<InternalEnum> innerEnumList;


  /** Statically defined {@link Enum} inside class. */
  public static enum InternalEnum {
    /** Test case 1 */
    TEST1,
    /** Test case 2 */
    TEST2
  }


  /**
   * @return the name
   * @category accessor
   */
  public String getName() {
    return name;
  }

  /**
   * @param name the name to set
   * @category accessor
   */
  public void setName(String name) {
    this.name = name;
  }

  /**
   * @return the date
   * @category accessor
   */
  public Date getDate() {
    return date;
  }

  /**
   * @param date the date to set
   * @category accessor
   */
  public void setDate(Date date) {
    this.date = date;
  }

  /**
   * @return the dateList
   * @category accessor
   */
  public List<Date> getDateList() {
    return dateList;
  }

  /**
   * @param dateList the dateList to set
   * @category accessor
   */
  public void setDateList(List<Date> dateList) {
    this.dateList = dateList;
  }

  /**
   * @return the list1
   * @category accessor
   */
  public List<TestData> getList1() {
    return list1;
  }

  /**
   * @param list1 the list1 to set
   * @category accessor
   */
  public void setList1(List<TestData> list1) {
    this.list1 = list1;
  }

  /**
   * @return the list2
   * @category accessor
   */
  public List<? extends TestData> getList2() {
    return list2;
  }

  /**
   * @param list2 the list2 to set
   * @category accessor
   */
  public void setList2(List<? extends TestData> list2) {
    this.list2 = list2;
  }

  /**
   * @return the list3
   * @category accessor
   */
  public List<? extends TestData> getList3() {
    return list3;
  }

  /**
   * @param list3 the list3 to set
   * @category accessor
   */
  public void setList3(List<? extends TestData> list3) {
    this.list3 = list3;
  }

  /**
   * @return the data
   * @category accessor
   */
  public TestData getData() {
    return data;
  }

  /**
   * @param data the data to set
   * @category accessor
   */
  public void setData(TestData data) {
    this.data = data;
  }

  /**
   * @return the outerEnum
   * @category accessor
   */
  public SampleEnum getOuterEnum() {
    return outerEnum;
  }

  /**
   * @param outerEnum the outerEnum to set
   * @category accessor
   */
  public void setOuterEnum(SampleEnum outerEnum) {
    this.outerEnum = outerEnum;
  }

  /**
   * @return the outerEnumList
   * @category accessor
   */
  public List<SampleEnum> getOuterEnumList() {
    return outerEnumList;
  }

  /**
   * @param outerEnumList the outerEnumList to set
   * @category accessor
   */
  public void setOuterEnumList(List<SampleEnum> outerEnumList) {
    this.outerEnumList = outerEnumList;
  }

  /**
   * @return the innerEnum
   * @category accessor
   */
  public InternalEnum getInnerEnum() {
    return innerEnum;
  }

  /**
   * @param innerEnum the innerEnum to set
   * @category accessor
   */
  public void setInnerEnum(InternalEnum innerEnum) {
    this.innerEnum = innerEnum;
  }

  /**
   * @return the innerEnumList
   * @category accessor
   */
  public List<InternalEnum> getInnerEnumList() {
    return innerEnumList;
  }

  /**
   * @param innerEnumList the innerEnumList to set
   * @category accessor
   */
  public void setInnerEnumList(List<InternalEnum> innerEnumList) {
    this.innerEnumList = innerEnumList;
  }
}




Java Source Code List

net.vvakame.apt.AptUtil.java
net.vvakame.jsonpullparser.android.sample.MainActivity.java
net.vvakame.sample.BaseData.java
net.vvakame.sample.BuilderData.java
net.vvakame.sample.ComplexData2.java
net.vvakame.sample.ComplexData.java
net.vvakame.sample.ContainsAnotherPackageObjectData.java
net.vvakame.sample.ConverterData.java
net.vvakame.sample.ExtendsData1.java
net.vvakame.sample.ExtendsData2.java
net.vvakame.sample.ForInnerClassData.java
net.vvakame.sample.GenToPackagePrivateData.java
net.vvakame.sample.JsonMetaToPackagePrivateValidData.java
net.vvakame.sample.MiniData.java
net.vvakame.sample.NestDepth1Data.java
net.vvakame.sample.NestDepth2Data.java
net.vvakame.sample.NestParentData.java
net.vvakame.sample.PrimitiveTypeData.java
net.vvakame.sample.PrimitiveWrapperData.java
net.vvakame.sample.PrimitiveWrapperListData.java
net.vvakame.sample.SampleEnum.java
net.vvakame.sample.SortOrderData1.java
net.vvakame.sample.SortOrderData2.java
net.vvakame.sample.StoreJsonData1.java
net.vvakame.sample.StoreJsonData2.java
net.vvakame.sample.TestData.java
net.vvakame.sample.anotherpackage.AnotherPackageClass.java
net.vvakame.sample.converter.IntFlattenConverter.java
net.vvakame.sample.converter.StringDiscardConverter.java
net.vvakame.sample.duma.ItemMapConverter.java
net.vvakame.sample.duma.Item.java
net.vvakame.sample.duma.ReadItLater.java
net.vvakame.sample.issue25.Issue25.java
net.vvakame.sample.issue28.Issue28.java
net.vvakame.sample.issue2.Child0ValueP0.java
net.vvakame.sample.issue2.Child0ValueP1.java
net.vvakame.sample.issue2.Child1ValueP0.java
net.vvakame.sample.issue2.Child1ValueP1.java
net.vvakame.sample.issue2.Grandchild0ValueC0P0.java
net.vvakame.sample.issue2.Grandchild0ValueC0P1.java
net.vvakame.sample.issue2.Grandchild0ValueC1P0.java
net.vvakame.sample.issue2.Grandchild0ValueC1P1.java
net.vvakame.sample.issue2.Grandchild1ValueC0P0.java
net.vvakame.sample.issue2.Grandchild1ValueC0P1.java
net.vvakame.sample.issue2.Grandchild1ValueC1P0.java
net.vvakame.sample.issue2.Grandchild1ValueC1P1.java
net.vvakame.sample.issue2.Parent0Value.java
net.vvakame.sample.issue2.Parent1Value.java
net.vvakame.sample.issue30.PrimitiveList.java
net.vvakame.sample.issue30.RecursiveStructure.java
net.vvakame.sample.issue31.BaseData.java
net.vvakame.sample.issue31.ExtendData.java
net.vvakame.sample.twitter.Place.java
net.vvakame.sample.twitter.Place.java
net.vvakame.sample.twitter.Tweet.java
net.vvakame.sample.twitter.Tweet.java
net.vvakame.sample.twitter.User.java
net.vvakame.sample.twitter.User.java
net.vvakame.twitter.ResultTweet.java
net.vvakame.twitter.SearchResult.java
net.vvakame.util.jsonpullparser.JsonFormatException.java
net.vvakame.util.jsonpullparser.JsonPullParser.java
net.vvakame.util.jsonpullparser.JsonSlice.java
net.vvakame.util.jsonpullparser.Stack.java
net.vvakame.util.jsonpullparser.annotation.JsonKey.java
net.vvakame.util.jsonpullparser.annotation.JsonModel.java
net.vvakame.util.jsonpullparser.annotation.StoreJson.java
net.vvakame.util.jsonpullparser.builder.JsonCoderRouter.java
net.vvakame.util.jsonpullparser.builder.JsonModelBuilder.java
net.vvakame.util.jsonpullparser.builder.JsonModelCoder.java
net.vvakame.util.jsonpullparser.builder.JsonPropertyBuilderCreator.java
net.vvakame.util.jsonpullparser.builder.JsonPropertyBuilder.java
net.vvakame.util.jsonpullparser.builder.JsonPropertyCoder.java
net.vvakame.util.jsonpullparser.builder.JsonPropertyMeta.java
net.vvakame.util.jsonpullparser.factory.JsonAnnotationProcessor.java
net.vvakame.util.jsonpullparser.factory.JsonKeyModel.java
net.vvakame.util.jsonpullparser.factory.JsonModelGenerator.java
net.vvakame.util.jsonpullparser.factory.JsonModelModel.java
net.vvakame.util.jsonpullparser.factory.Log.java
net.vvakame.util.jsonpullparser.factory.StandardTypeKindVisitor.java
net.vvakame.util.jsonpullparser.factory.StoreJsonModel.java
net.vvakame.util.jsonpullparser.factory.template.MvelTemplate.java
net.vvakame.util.jsonpullparser.factory.template.Template.java
net.vvakame.util.jsonpullparser.googleapiclient.JppFactory.java
net.vvakame.util.jsonpullparser.googleapiclient.JppGenerator.java
net.vvakame.util.jsonpullparser.googleapiclient.JppParser.java
net.vvakame.util.jsonpullparser.util.JsonArray.java
net.vvakame.util.jsonpullparser.util.JsonHash.java
net.vvakame.util.jsonpullparser.util.JsonParseUtil.java
net.vvakame.util.jsonpullparser.util.JsonSliceUtil.java
net.vvakame.util.jsonpullparser.util.JsonUtil.java
net.vvakame.util.jsonpullparser.util.OnJsonObjectAddListener.java
net.vvakame.util.jsonpullparser.util.TokenConverter.java
net.vvakame.util.jsonpullparser.util.Type.java