Package repast.simphony.parameter.xml
Class ParameterSweepParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.xml.sax.ext.DefaultHandler2
repast.simphony.parameter.xml.ParameterSweepParser
- All Implemented Interfaces:
- ContentHandler,- DTDHandler,- EntityResolver,- ErrorHandler,- DeclHandler,- EntityResolver2,- LexicalHandler
Parses a parameters xml file and creates ParameterTreeSweeper based on that.
 Additional ParameterSetterCreators can be registered for dealing with
 additional parameter types using the registerSetterCreator method.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
- 
Constructor SummaryConstructorsConstructorDescriptionParameterSweepParser(URL paramsURL) Creates a ParameterSweepParser to parse the specified URL.ParameterSweepParser(ParameterTreeSweeper sweeper, URL paramsURL) Creates a ParameterSweeper parser to use the specified sweeper and to parse the specified URL.
- 
Method SummaryModifier and TypeMethodDescriptionvoidendElement(String uri, String localName, String qName) voidMethod writes out string content to a batch xml file used for temporary data storage.protected booleanprotected booleanprotected booleanprotected booleanparse()Parse the url and return the created ParameterTreeSweeper.Method reads file URL and size (based on content) and returns a string representation of that content.voidregisterConstantCreator(String constantTypeID, ParameterSetterCreator creator) Register a setter creator to be used for constant setters during sweeper creation.voidregisterStepperCreator(String typeID, ParameterSetterCreator creator) Register a setter creator to be used during sweeper creation.voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.ext.DefaultHandler2attributeDecl, comment, elementDecl, endCDATA, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity, startCDATA, startDTD, startEntityMethods inherited from class org.xml.sax.helpers.DefaultHandlercharacters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandlerdeclaration
- 
Constructor Details- 
ParameterSweepParserCreates a ParameterSweepParser to parse the specified URL.- Parameters:
- paramsURL-
 
- 
ParameterSweepParser
- 
ParameterSweepParserCreates a ParameterSweeper parser to use the specified sweeper and to parse the specified URL.- Parameters:
- sweeper-
- paramsURL-
 
 
- 
- 
Method Details- 
parsepublic Pair<Parameters,ParameterTreeSweeper> parse() throws ParserConfigurationException, SAXException, IOExceptionParse the url and return the created ParameterTreeSweeper.- Returns:
- the created ParameterTreeSweeper.
- Throws:
- ParserConfigurationException
- SAXException
- IOException
 
- 
inputFileMethod writes out string content to a batch xml file used for temporary data storage.- Parameters:
- input- the input string to write out
- Throws:
- IOException
 
- 
readFileMethod reads file URL and size (based on content) and returns a string representation of that content.- Parameters:
- url- the file url
- size- the size of the file
- Returns:
- a string representation of the parameters
- Throws:
- IOException
 
- 
registerStepperCreatorRegister a setter creator to be used during sweeper creation. When a parameter element whose "type" attribute is equal to the specified typeID is encountered, the specified creator will be used to create the ParameterSetter. The attributes of that element will be passed to the creator so that it can create the setter.- Parameters:
- typeID-
- creator-
 
- 
registerConstantCreatorRegister a setter creator to be used for constant setters during sweeper creation. When a parameter element whose "constant type" attribute is equal to the specified typeID is encountered, the specified creator will be used to create the ParameterSetter. The attributes of that element will be passed to the creator so that it can create the constant setter.- Parameters:
- constantTypeID- matches agains the constant_type attribute.
- creator-
 
- 
startElementpublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
- startElementin interface- ContentHandler
- Overrides:
- startElementin class- DefaultHandler
- Throws:
- SAXException
 
- 
endElement- Specified by:
- endElementin interface- ContentHandler
- Overrides:
- endElementin class- DefaultHandler
- Throws:
- SAXException
 
- 
isDouble
- 
isLong
- 
isFloat
- 
isInt
 
-