public class SyntaxRules extends Object
| Constructor and Description |
|---|
SyntaxRules(SyntaxStyle defaultSyntaxStyle)
Creates a new set of syntax rules.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(String component,
String version,
SyntaxStyle syntaxStyle)
Adds a rule.
|
SyntaxStyle |
getDefaultSyntaxStyle()
Gets the the syntax style to use when it can't be determined what the
data stream uses.
|
SyntaxStyle |
getSyntaxStyle(String component,
String versionValue)
Gets the syntax style to use for a given component.
|
boolean |
hasSyntaxRules(String component)
Determines if this object contains rules for the given component.
|
static SyntaxRules |
iCalendar()
Creates a set of rules for iCalendar data.
|
void |
setDefaultSyntaxStyle(SyntaxStyle defaultSyntaxStyle)
Sets the syntax style to use when it can't be determined what the data
stream uses.
|
static SyntaxRules |
vcard()
Creates a set of rules for vCard data.
|
public SyntaxRules(SyntaxStyle defaultSyntaxStyle)
defaultSyntaxStyle - the syntax style to use when it can't be
determined what the data stream usespublic SyntaxStyle getDefaultSyntaxStyle()
public void setDefaultSyntaxStyle(SyntaxStyle defaultSyntaxStyle)
defaultSyntaxStyle - the default syntax style (cannot be null)public boolean hasSyntaxRules(String component)
component - the component name (e.g. "VCARD")public SyntaxStyle getSyntaxStyle(String component, String versionValue)
component - the component name (e.g. "VCARD")versionValue - the value of the component's VERSION property (e.g.
"2.1")public void addRule(String component, String version, SyntaxStyle syntaxStyle)
component - the name of the component that contains the VERSION
property (e.g. "VCARD"), or null if the VERSION property will not be
inside of any componentsversion - the value of the VERSION propertysyntaxStyle - the syntax style to use when a VERSION property with
the given value, and under the given component, is encounteredpublic static SyntaxRules iCalendar()
public static SyntaxRules vcard()
Copyright © 2016–2018 Michael Angstadt. All rights reserved.