net.sf.jpkgmk.prototype
Class AbstractPrototypeEntryParser

java.lang.Object
  extended by net.sf.jpkgmk.prototype.AbstractPrototypeEntryParser
All Implemented Interfaces:
PrototypeEntryParser
Direct Known Subclasses:
AbstractPrototypeEntryDevice.AbstractPrototypeEntryDeviceParser, PrototypeEntryDirectory.PrototypeEntryDirectoryParser, PrototypeEntryFile.PrototypeEntryFileParser, PrototypeEntryInfo.PrototypeEntryInfoParser, PrototypeEntryLink.PrototypeEntryLinkParser, PrototypeEntryPipe.PrototypeEntryPipeParser, PrototypeEntrySymbolicLink.PrototypeEntrySymbolicLinkParser

public abstract class AbstractPrototypeEntryParser
extends java.lang.Object
implements PrototypeEntryParser

Since:
1.0
Version:
$Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
AbstractPrototypeEntryParser()
          Default constructor
 
Method Summary
protected  java.lang.String getArrayValue(java.lang.String[] items, int i)
           
 java.lang.String getCurrentLine()
           
 PrototypeEntry parse(java.lang.String line, PrototypeEntryCommandDefault entryCommandDefault)
           
protected abstract  PrototypeEntry parseItems(java.lang.String[] items, java.lang.Integer part, PrototypeEntryType type, int currentIndex, PrototypeEntryCommandDefault entryCommandDefault)
          Invoked by the parse(String, PrototypeEntryCommandDefault) method to parse the items of a line.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPrototypeEntryParser

public AbstractPrototypeEntryParser()
Default constructor

Method Detail

getCurrentLine

public java.lang.String getCurrentLine()
Returns:
Returns the current line being parsed. Is set when the method parse(String, PrototypeEntryCommandDefault) is entered and reset when the method is leaved.

parse

public final PrototypeEntry parse(java.lang.String line,
                                  PrototypeEntryCommandDefault entryCommandDefault)
Specified by:
parse in interface PrototypeEntryParser

getArrayValue

protected final java.lang.String getArrayValue(java.lang.String[] items,
                                               int i)

parseItems

protected abstract PrototypeEntry parseItems(java.lang.String[] items,
                                             java.lang.Integer part,
                                             PrototypeEntryType type,
                                             int currentIndex,
                                             PrototypeEntryCommandDefault entryCommandDefault)
Invoked by the parse(String, PrototypeEntryCommandDefault) method to parse the items of a line. The given array of items represents the whole line split up into strings.

Parameters:
items - All items of this line
part - The pre-parsed value for the optional "part" field
type - The pre-parsed value for the mandatory "type" character field
currentIndex - The current index located after the "type" field already parsed. This is the index where the parsing should be continued by the concrete implementations.
entryCommandDefault -
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007-2008. All Rights Reserved.