Class PropertyDatabase<KeyType extends FieldOrMethodDescriptor, ValueType>
java.lang.Object
edu.umd.cs.findbugs.ba.interproc.PropertyDatabase<KeyType, ValueType>
- Type Parameters:
KeyType- key type: either MethodDescriptor or FieldDescriptorValueType- value type: a value that summarizes some property of the associated key
- Direct Known Subclasses:
FieldPropertyDatabase, MethodPropertyDatabase
public abstract class PropertyDatabase<KeyType extends FieldOrMethodDescriptor, ValueType>
extends Object
Property database for interprocedural analysis.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ValueTypedecodeProperty(String propStr) Subclasses must define this to instantiate the actual property value from its string encoding.protected abstract StringencodeProperty(ValueType property) Subclasses must define this to encode a property as a string for output to a file.entrySet()getKeys()getProperty(KeyType key) Get a property.booleanisEmpty()Return whether or not the database is empty.protected abstract KeyTypeParse a key from a String.voidread(InputStream in) Read property database from an input stream.voidreadFromFile(String fileName) Read property database from given file.removeProperty(KeyType key) Remove a property.voidsetProperty(KeyType key, ValueType property) Set a property.voidwrite(OutputStream out) Write property database to an OutputStream.protected abstract voidWrite an encoded key to given Writer.voidwriteToFile(String fileName) Write property database to given file.
-
Field Details
-
propertyMap
-
-
Constructor Details
-
PropertyDatabase
protected PropertyDatabase()Constructor. Creates an empty property database.
-
-
Method Details
-
setProperty
-
getProperty
-
getKeys
-
entrySet
-
isEmpty
public boolean isEmpty()Return whether or not the database is empty.- Returns:
- true if the database is empty, false it it has at least one entry
-
removeProperty
-
readFromFile
Read property database from given file.- Parameters:
fileName- name of the database file- Throws:
IOExceptionPropertyDatabaseFormatException
-
read
Read property database from an input stream. The InputStream is guaranteed to be closed, even if an exception is thrown.- Parameters:
in- the InputStream- Throws:
IOExceptionPropertyDatabaseFormatException
-
writeToFile
Write property database to given file.- Parameters:
fileName- name of the database file- Throws:
IOException
-
write
Write property database to an OutputStream. The OutputStream is guaranteed to be closed, even if an exception is thrown.- Parameters:
out- the OutputStream- Throws:
IOException
-
parseKey
Parse a key from a String.- Parameters:
s- a String- Returns:
- the decoded key
- Throws:
PropertyDatabaseFormatException
-
writeKey
Write an encoded key to given Writer.- Parameters:
writer- the Writerkey- the key- Throws:
IOException
-
decodeProperty
Subclasses must define this to instantiate the actual property value from its string encoding.- Parameters:
propStr- String containing the encoded property- Returns:
- the property
- Throws:
PropertyDatabaseFormatException
-
encodeProperty
-