public class Records
extends java.lang.Object
Created: November 16 2011
Modifier and Type | Class and Description |
---|---|
static class |
Records.ExposedIndentXMLWriter
An XMLWriter subclass that exposes a writeIndent() method.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.util.List<Record> |
mRecords
Our list of records.
|
Constructor and Description |
---|
Records() |
Modifier and Type | Method and Description |
---|---|
void |
addRecord(Record pRecord)
Add the specified record.
|
protected Records.ExposedIndentXMLWriter |
createXMLWriter()
Create our XMLWriter.
|
boolean |
exactlyEquals(Records pRecords)
Only equal if we have the same records in the same order.
|
java.lang.String |
getAsXMLString(ApplicationLogging pLogging)
Get our records as an XMLString.
|
protected java.lang.String |
getNameOfRecord(Record pRecord)
Get the name of the record, if any.
|
java.lang.String |
getNamePropertyName()
Returns property namePropertyName.
|
Record |
getOnlyRecordByName(java.lang.String pName)
Return the only record with the give name.
|
int |
getRecordCount()
Get the count of the number of records.
|
java.util.List<Record> |
getRecords()
Return the list of all records (with an unmodifiable copy.
|
java.util.List<Record> |
getRecordsByName(java.lang.String pName)
Get the list of records with the specified name property (as
defined by the propertyNameProperty).*
|
java.util.List<Record> |
getRecordsWithMatchingProperty(java.lang.String pPropertyName,
java.lang.String pPropertyValue)
Return all the records with the specified matching property.
|
void |
readFromXML(java.io.InputStream pInputStream)
Read from an XML file.
|
void |
removeRecord(Record pRecord)
Remove the specified record.
|
void |
setNamePropertyName(java.lang.String pNamePropertyName)
Sets property namePropertyName.
|
java.lang.String |
toString() |
void |
writeAsXML(java.io.Writer pWriter,
boolean pWriteXMLDeclaration,
boolean pPrettyPrint,
boolean pIncludeStandalone)
Write the record out as XML.
|
protected void |
writeXMLDeclaration(java.io.Writer pWriter,
java.lang.String pXMLVersion,
java.lang.String pEncoding)
Write the XML Declaration.
|
public static java.lang.String CLASS_VERSION
protected java.util.List<Record> mRecords
public void setNamePropertyName(java.lang.String pNamePropertyName)
public java.lang.String getNamePropertyName()
public void addRecord(Record pRecord)
pRecord
- the record to be added.public void removeRecord(Record pRecord)
public int getRecordCount()
public java.util.List<Record> getRecordsByName(java.lang.String pName)
pName
- the name of list of records to get.public Record getOnlyRecordByName(java.lang.String pName)
pName
- the name of the record to get.public java.util.List<Record> getRecords()
public java.util.List<Record> getRecordsWithMatchingProperty(java.lang.String pPropertyName, java.lang.String pPropertyValue)
pPropertyName
- the name of the property value to match.pPropertyValue
- the value of the property to match.protected java.lang.String getNameOfRecord(Record pRecord)
pRecord
- the record whose name to get.protected void writeXMLDeclaration(java.io.Writer pWriter, java.lang.String pXMLVersion, java.lang.String pEncoding) throws java.io.IOException
pWriter
- the writerpXMLVersion
- the XML version.pEncoding
- the character encoding.java.io.IOException
public java.lang.String getAsXMLString(ApplicationLogging pLogging)
pLogging
- the logger to use if an exception is thrown.public void writeAsXML(java.io.Writer pWriter, boolean pWriteXMLDeclaration, boolean pPrettyPrint, boolean pIncludeStandalone) throws java.io.IOException, atg.repository.search.indexing.XMLWriterException
pWriter
- the writer to write to.pWriteXMLDeclaration
- there to write an XML declaration.pPrettyPrint
- whether to do indentation.pIncludeStandalone
- whether to include the "standalone"
in the root element.java.io.IOException
atg.repository.search.indexing.XMLWriterException
public void readFromXML(java.io.InputStream pInputStream) throws java.io.IOException
pInputStream
- the input stream to read from.java.io.IOException
public boolean exactlyEquals(Records pRecords)
pRecord
- the records object to compare ourself too.protected Records.ExposedIndentXMLWriter createXMLWriter()
public java.lang.String toString()
toString
in class java.lang.Object