Skip to content

xml-->NSMutableArray (List<Entity>); json-->NSMutableArray (List<Entity>).

Notifications You must be signed in to change notification settings

Ericfengshi/FSXmlJsonAnalyze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FSXmlJsonAnalyze

xml-->NSMutableArray (List<Entity>); json-->NSMutableArray (List<Entity>).

Features

  • Reflection
  • Regular Expression

What you need

How to use

NSMutableArray *retVal = [FSXmlJsonAnalyze jsonToArray:xml class:Entity.class];
    
NSMutableArray *retVal = [FSXmlJsonAnalyze xmlToArray:xml class:Entity.class rowRootName:@"rowRootName"];
    

xml-->NSMutableArray (List)

/**
 * 将标准的xml(实体)转换成NSMutableArray
 * @param xml:(忽略实体属性大小写差异)
    <data xmlns="">
    <row><UserID>ff0f0704</UserID><UserName>fs</UserName></row>
    <row><UserID>ff0f0704</UserID><UserName>fs</UserName></row>
    ......
    </data>
 * @param class:
    User @property userName,userID;
 * @param rowRootName:
    row
 * @return NSMutableArray (List<User>)
 */
+(NSMutableArray*)xmlToArray:(NSString*)xml class:(Class)class rowRootName:rowRootName;

json-->NSMutableArray (List)

/**
 * 将标准的Json(实体)转换成NSMutableArray
 * @param xml:(忽略实体属性大小写差异)
    [{"UserID":"ff0f0704","UserName":"fs"},
    {"UserID":"ff0f0704","UserName":"fs"},...]
 * @param class:
    User @property userName,userID;
 * @return NSMutableArray (List<User>)
 */
+(NSMutableArray*)jsonToArray:(NSString*)json class:(Class)class;    

About

xml-->NSMutableArray (List<Entity>); json-->NSMutableArray (List<Entity>).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published