Package weka.core.xml
Class PropertyHandler
java.lang.Object
weka.core.xml.PropertyHandler
- All Implemented Interfaces:
RevisionHandler
This class stores information about properties to ignore or properties that
are allowed for a certain class.
- Version:
- $Revision: 11247 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllowed
(Class<?> c, String displayName) adds the given property (display name) to the list of allowed properties for the specified class.void
addIgnored
(Class<?> c, String displayName) adds the given class with the display name of a property to the ignore list.void
addIgnored
(String displayName) adds the given display name of a property to the ignore list.allowed()
returns an enumeration of the classnames for which only certain properties (display names) are allowedReturns the revision string.ignored()
returns an enumeration of the stored display names and classes of properties to ignore.
NOTE: String and Class Objects are mixed in this enumeration, depending whether it is a global property to ignore or just one for a certain class!boolean
returns whether the given property (display name) is allowed for the given class.boolean
returns whether the given property (display name) is allowed for the given object .boolean
checks whether the given display name of a certain class is an ignored property.boolean
checks whether the given display name of a given object is an ignored property.boolean
checks whether the given display name is an ignored propertyboolean
removeAllowed
(Class<?> c, String displayName) removes the given property (display name) for the specified class from the list of allowed properties.boolean
removeIgnored
(Class<?> c, String displayName) removes the given display name from the ignore list of the class.boolean
removeIgnored
(String displayName) removes the given display name from the ignore list.
-
Constructor Details
-
PropertyHandler
public PropertyHandler()initializes the handling
-
-
Method Details
-
ignored
returns an enumeration of the stored display names and classes of properties to ignore.
NOTE: String and Class Objects are mixed in this enumeration, depending whether it is a global property to ignore or just one for a certain class!- Returns:
- the display names and classes
- See Also:
-
m_Ignored
-
addIgnored
adds the given display name of a property to the ignore list. Can either be a complete path (e.g.__root__.options
) or only a property name (e.g.options
). In the latter case it matches all occurences of this display name.- Parameters:
displayName
- the property to ignore- See Also:
-
m_Ignored
-
addIgnored
adds the given class with the display name of a property to the ignore list. I.e. this property is only ignored for this class.- Parameters:
c
- the class for which a property is to be ignoreddisplayName
- the property to ignore- See Also:
-
m_Ignored
-
removeIgnored
removes the given display name from the ignore list. returns whether the removing was succesful, i.e. whether the display name was in the list.- Parameters:
displayName
- the property to remove from the ignore list- Returns:
- whether the ignore list contained the specified property
- See Also:
-
m_Ignored
-
removeIgnored
removes the given display name from the ignore list of the class. returns whether the removing was succesful, i.e. whether the display name was in the list.- Parameters:
c
- the class to remove the property fromdisplayName
- the property to remove from the ignore list- Returns:
- whether the ignore list contained the specified property
- See Also:
-
m_Ignored
-
isIgnored
checks whether the given display name is an ignored property- Parameters:
displayName
- the property to check whether it is on the ignore list- Returns:
- whether the property is in the ignored list
- See Also:
-
m_Ignored
-
isIgnored
checks whether the given display name of a certain class is an ignored property. It only checks for this certain class and no derivative classes. If you also want to check for derivative classes, useisIgnored(Object,String)
.- Parameters:
c
- the class to check the property fordisplayName
- the property to check whether it is on the ignore list- Returns:
- whether the property is in the ignored list
- See Also:
-
m_Ignored
isIgnored(Object, String)
-
isIgnored
checks whether the given display name of a given object is an ignored property. The object is checked for each stored class whether it is aninstanceof
. If the class is not stored then it will default tofalse
, since there are no restrictions for this class.- Parameters:
o
- the object to check the property fordisplayName
- the property to check whether it is on the ignore list- Returns:
- whether the property is in the ignored list
- See Also:
-
m_Ignored
-
allowed
returns an enumeration of the classnames for which only certain properties (display names) are allowed- Returns:
- the classnames with restriction to properties
-
addAllowed
adds the given property (display name) to the list of allowed properties for the specified class.- Parameters:
c
- the class to add a property fordisplayName
- the property to allow for the class- See Also:
-
m_Allowed
-
removeAllowed
removes the given property (display name) for the specified class from the list of allowed properties.- Parameters:
c
- the class to remove the property fordisplayName
- the property to remove- Returns:
- whether the property was found
- See Also:
-
m_Allowed
-
isAllowed
returns whether the given property (display name) is allowed for the given class. It only checks for this certain class and no derivative classes. If you also want to check for derivative classes, useisAllowed(Object,String)
.- Parameters:
c
- the class to check the property fordisplayName
- the property (display name) to check- Returns:
- whether the property is allowed in that context
- See Also:
-
m_Allowed
isAllowed(Object, String)
-
isAllowed
returns whether the given property (display name) is allowed for the given object . The object is checked for each stored class whether it is aninstanceof
. If the class is not stored then it will default totrue
, since there are no restrictions for this class.- Parameters:
o
- the object to check the property fordisplayName
- the property (display name) to check- Returns:
- whether the property is allowed in that context
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-