java.lang.Object
io.sf.carte.doc.style.css.property.ShorthandDatabase
Database of shorthand-related property information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ShorthandDatabaseGets an instance of this class.static ShorthandDatabasegetInstance(ClassLoader loader) Gets an instance of this class that uses the given classloader.String[]getLonghandProperties(String shorthandName) Get an array with the names of the longhand subproperties forshorthandName.getShorthand(String subproperty) Gets the shorthand for this subproperty, if any.String[]getShorthandSubproperties(String shorthandName) Get the subproperties of the given shorthand.booleanhasKnownIdentifierValues(String propertyName) Determines if the given property has known identifier values that could be checked withisIdentifierValue(String, String).booleanisIdentifierValue(String propertyName, String value) Determines if the given value is an identifier for the given property name.booleanisShorthand(String name) Is this a shorthand property?booleanisShorthandSubproperty(String name) Is this the subproperty of a shorthand property?booleanisShorthandSubpropertyOf(String shorthand, String subpName) Is the given property name a subproperty of the given shorthand property ?
-
Constructor Details
-
ShorthandDatabase
Deprecated.Construct a shorthand database that uses the givenClassLoaderto load files from classpath.- Parameters:
loader- the loader.
-
-
Method Details
-
getInstance
Gets an instance of this class.- Returns:
- an instance of ShorthandDatabase.
-
getInstance
Gets an instance of this class that uses the given classloader.- Parameters:
loader- the loader.- Returns:
- an instance of ShorthandDatabase.
-
isShorthand
Is this a shorthand property?- Parameters:
name- the name of the property.- Returns:
trueif is a shorthand,falseotherwise.
-
isShorthandSubproperty
Is this the subproperty of a shorthand property?- Parameters:
name- the name of the property.- Returns:
trueif is a shorthand subproperty,falseotherwise.
-
getShorthand
Gets the shorthand for this subproperty, if any.- Parameters:
subproperty- the subproperty name.- Returns:
- the name of the shorthand for this subproperty, or
nullifsubpropertyis not a recognized subproperty.
-
isShorthandSubpropertyOf
Is the given property name a subproperty of the given shorthand property ?- Parameters:
shorthand- the name of the shorthand property to test.subpName- the name of the possible subproperty.- Returns:
trueif subpName is a subproperty of the given shorthand, false otherwise.
-
getShorthandSubproperties
Get the subproperties of the given shorthand.The subproperties may be, in turn, shorthands.
- Parameters:
shorthandName- the shorthand name.- Returns:
- the array of subproperties, or
nullif the shorthand name is not known.
-
getLonghandProperties
Get an array with the names of the longhand subproperties forshorthandName.For convenience of the library's internals, the array is incomplete for the
fontshorthand, due tofont-varianthandling, and also forborderdue to interaction withborder-image.- Parameters:
shorthandName- the shorthand name.- Returns:
- an array with the names of the longhand subproperties, or
nullif the shorthand name is not known.
-
isIdentifierValue
Determines if the given value is an identifier for the given property name.Generic identifiers such as
inheritornoneare not checked.If the property name ends with '-color', the value is checked for a valid color value identifier, regardless of the property name being known or not.
- Parameters:
propertyName- the lowercase name of the property.value- the value that has to be tested to be an identifier for propertyName.- Returns:
trueifvalueis recognized as an identifier ofpropertyName,falseotherwise.
-
hasKnownIdentifierValues
Determines if the given property has known identifier values that could be checked withisIdentifierValue(String, String).- Parameters:
propertyName- the lowercase name of the property.- Returns:
trueifpropertyNamehas identifiers known to this database.
-
getInstance(ClassLoader)