Android Open Source - Spidermine Xml






From Project

Back to project page Spidermine.

License

The source code is released under:

Copyright ? 2014 PEMapModder This software is open-source and everyone is welcome to share redistributions or modifications, as long as it is clearly specified that this project's original source is ...

If you think the Android project Spidermine 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

package pemapmodder.easymod.xml;
/* w  w w. j  ava  2 s. co m*/
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;

public class Xml {
  private final static int STATUS_RAW_CONTENT=0x0;
  private final static int STATUS_ELEMENT_NAME=0x1;
  private final static int STATUS_ATTRIBUTE_NAME=0x2;
  private final static int STATUS_ATTRIBUTE_VAL_ONE=0x3;
  private final static int STATUS_ATTRIBUTE_VAL_SGL_QUOTE=0x4;
  private final static int STATUS_ATTRIBUTE_VAL_DBL_QUOTE=0x5;
  private final static int STATUS_COMMENT=0x6;
  Element[] elements={};
  @SuppressWarnings("unused")
  private Xml(String src) throws XmlLangException{
    int nestTags=0;
    String[] nests={};
    int memory=-1;
    int status=STATUS_RAW_CONTENT;
    String[] buffer={
        "","","","","","","","","",""
    };
    int line=0;
    for(int i=0; i<src.length(); i++){
      char tc=src.charAt(i);
      if(i==0&&tc!='<')
        throw new XmlLangException(line);
      if(tc=='\n'){
        line++;
        continue;
      }
      switch(status){
      case STATUS_RAW_CONTENT:
        if(tc=='<'){
          status=STATUS_ELEMENT_NAME;
          continue;
        }
        //TODO
        break;
      case STATUS_ELEMENT_NAME:
        if(tc==' '){
          nestTags++;
          
          status=STATUS_ATTRIBUTE_NAME;
          continue;
        }
        buffer[1]+=tc;
        break;
      case STATUS_ATTRIBUTE_NAME:
        
        break;
      case STATUS_ATTRIBUTE_VAL_ONE:
        break;
      case STATUS_ATTRIBUTE_VAL_SGL_QUOTE:
      case STATUS_ATTRIBUTE_VAL_DBL_QUOTE:
        break;
      case STATUS_COMMENT:
        break;
      }
    }
  }
  
  public static Xml parse(File f)
      throws IOException, XmlLangException{
    return new Xml(readFile(f));
  }

  public static String readFile(File f)throws IOException{
    BufferedReader br=new BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f)));
    String ret="";
    try{
      String line;
      while((line = br.readLine()) != null)
        ret += (line+"\n");
    }catch(IOException e){
      br.close();
      throw e;
    }
    br.close();
    return ret;
  }

}




Java Source Code List

pemapmodder.StdObj.java
pemapmodder.easymod.EasyMod.java
pemapmodder.easymod.xml.Attribute.java
pemapmodder.easymod.xml.Element.java
pemapmodder.easymod.xml.XmlLangException.java
pemapmodder.easymod.xml.Xml.java
pemapmodder.old_spidermine.ConsoleChangeListener.java
pemapmodder.old_spidermine.ConsoleInputListener.java
pemapmodder.old_spidermine.ServerRunner.java
pemapmodder.old_spidermine.SpiderServer.java
pemapmodder.old_spidermine.managers.CmdManager.java
pemapmodder.old_spidermine.managers.EntityManager.java
pemapmodder.old_spidermine.managers.Manager.java
pemapmodder.old_spidermine.managers.ServerManager.java
pemapmodder.old_spidermine.managers.TileManager.java
pemapmodder.old_spidermine.managers.UserManager.java
pemapmodder.old_spidermine.managers.WorldManager.java
pemapmodder.old_spidermine.network.Networker.java
pemapmodder.old_spidermine.objects.ChestTile.java
pemapmodder.old_spidermine.objects.Command.java
pemapmodder.old_spidermine.objects.Entity.java
pemapmodder.old_spidermine.objects.SignTile.java
pemapmodder.old_spidermine.objects.Tile.java
pemapmodder.old_spidermine.objects.User.java
pemapmodder.old_spidermine.utils.io.IOUtils.java
pemapmodder.old_spidermine.utils.io.MyReader.java
pemapmodder.old_spidermine.utils.math.Location.java
pemapmodder.old_spidermine.utils.math.MathUtils.java
pemapmodder.old_spidermine.utils.math.PCoord.java
pemapmodder.old_spidermine.utils.math.Position.java
pemapmodder.old_spidermine.world.Block.java
pemapmodder.old_spidermine.world.Chunk.java
pemapmodder.old_spidermine.world.World.java
pemapmodder.old_spidermine.world.populator.WorldPopulator.java
pemapmodder.spidermine.Console.java
pemapmodder.spidermine.SpiderServer.java
pemapmodder.spidermine.Utils.java
pemapmodder.spidermine.android.ConsolePanel.java
pemapmodder.spidermine.android.CreateNewServerActivity.java
pemapmodder.spidermine.android.LauncherActivity.java
pemapmodder.spidermine.android.ServerMainControlPanel.java
pemapmodder.spidermine.client.Client.java
pemapmodder.spidermine.events.EventHandler.java
pemapmodder.spidermine.events.EventResult.java
pemapmodder.spidermine.events.Event.java
pemapmodder.spidermine.events.server.ServerStopEvent.java
pemapmodder.spidermine.exceptions.SocketAddressUsedException.java
pemapmodder.spidermine.managers.ClientManager.java
pemapmodder.spidermine.managers.CommandHandler.java
pemapmodder.spidermine.managers.EventManager.java
pemapmodder.spidermine.managers.Manager.java
pemapmodder.spidermine.managers.ServerManager.java
pemapmodder.spidermine.network.NetworkHandler.java
pemapmodder.spidermine.network.packet.PacketParser.java
pemapmodder.spidermine.network.packet.Packet.java
pemapmodder.spidermine.network.packet.ProtocolInfo.java
pemapmodder.spidermine.objects.CommandIssuer.java
pemapmodder.spidermine.objects.Command.java
pemapmodder.spidermine.objects.Interfaces.java
pemapmodder.spidermine.world.World.java
pemapmodder.utils.io.Saveable.java
pemapmodder.utils.php.functions.P.java