APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.provider

public Class PolicyParser

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .Reader, .StreamTokenizer, java.security.GeneralSecurityException, java.util.Collection, .HashMap, .Locale, .Map, .TreeMap, sun.security.util.PropertyExpander, .LocalizedMessage

Configuration data that specifies the keystores in a DKS keystore. A keystore domain is a collection of keystores that are presented as a single logical keystore. The configuration data is used during KeyStore load and store operations. The following syntax is supported for configuration data: domain [ ...] { keystore [ ...] ; ... }; ...
Authors
Roland Schemers, Ram Marti
Since
1.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
PolicyParser.DomainEntry

Each domain entry in the keystore domain configuration file is represented by a DomainEntry object.

pack-priv static class
PolicyParser.KeyStoreEntry

Each keystore entry in the keystore domain configuration file is represented by a KeyStoreEntry object.

public static class

Field Summary

Modifier and TypeField and Description
private Map<String, PolicyParser.DomainEntry>
private boolean
private int
private StreamTokenizer

Constructor Summary

AccessConstructor and Description
public
PolicyParser(boolean expandProp)

Creates a PolicyParser object.

Method Summary

Modifier and TypeMethod and Description
private String
expand(String value)

private String
expand(String value, boolean encodeURL)

public Collection<PolicyParser.DomainEntry>
private String
match(String expect)

private PolicyParser.DomainEntry
parseDomainEntry()

parse a domain entry

private Map<String, String>
parseProperties(String terminator)

private boolean
peek(String expect)

private boolean
public void
read(Reader
the policy Reader object.
policy
)

Reads a policy configuration into the Policy object using a Reader object.

private void
skipEntry()

skip all tokens for this entry leaving the delimiter ";" in the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

domainEntriesback to summary
private Map<String, PolicyParser.DomainEntry> domainEntries
expandPropback to summary
private boolean expandProp
lookaheadback to summary
private int lookahead
stback to summary
private StreamTokenizer st

Constructor Detail

PolicyParserback to summary
public PolicyParser(boolean expandProp)

Creates a PolicyParser object.

Method Detail

expandback to summary
private String expand(String value) throws ExpandException
expandback to summary
private String expand(String value, boolean encodeURL) throws ExpandException
getDomainEntriesback to summary
public Collection<PolicyParser.DomainEntry> getDomainEntries()
matchback to summary
private String match(String expect) throws ParsingException, IOException
parseDomainEntryback to summary
private PolicyParser.DomainEntry parseDomainEntry() throws ParsingException, IOException

parse a domain entry

parsePropertiesback to summary
private Map<String, String> parseProperties(String terminator) throws ParsingException, IOException
peekback to summary
private boolean peek(String expect)
peekAndMatchback to summary
private boolean peekAndMatch(String expect) throws ParsingException, IOException
readback to summary
public void read(Reader policy) throws ParsingException, IOException

Reads a policy configuration into the Policy object using a Reader object.

Parameters
policy:Reader

the policy Reader object.

Exceptions
ParsingException:
if the policy configuration contains a syntax error.
IOException:
if an error occurs while reading the policy configuration.
skipEntryback to summary
private void skipEntry() throws ParsingException, IOException

skip all tokens for this entry leaving the delimiter ";" in the stream.

sun.security.provider back to summary

pack-priv Class PolicyParser.DomainEntry

extends Object
Class Inheritance

Each domain entry in the keystore domain configuration file is represented by a DomainEntry object.

Field Summary

Modifier and TypeField and Description
private final Map<String, PolicyParser.KeyStoreEntry>
private final String
private final Map<String, String>

Constructor Summary

AccessConstructor and Description
pack-priv
DomainEntry(String name, Map<String, String> properties)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv Collection<PolicyParser.KeyStoreEntry>
pack-priv String
pack-priv Map<String, String>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

entriesback to summary
private final Map<String, PolicyParser.KeyStoreEntry> entries
nameback to summary
private final String name
propertiesback to summary
private final Map<String, String> properties

Constructor Detail

DomainEntryback to summary
pack-priv DomainEntry(String name, Map<String, String> properties)

Method Detail

addback to summary
pack-priv void add(PolicyParser.KeyStoreEntry entry) throws ParsingException
getEntriesback to summary
pack-priv Collection<PolicyParser.KeyStoreEntry> getEntries()
getNameback to summary
pack-priv String getName()
getPropertiesback to summary
pack-priv Map<String, String> getProperties()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
sun.security.provider back to summary

pack-priv Class PolicyParser.KeyStoreEntry

extends Object
Class Inheritance

Each keystore entry in the keystore domain configuration file is represented by a KeyStoreEntry object.

Field Summary

Modifier and TypeField and Description
private final String
private final Map<String, String>

Constructor Summary

AccessConstructor and Description
pack-priv
KeyStoreEntry(String name, Map<String, String> properties)

Method Summary

Modifier and TypeMethod and Description
pack-priv String
pack-priv Map<String, String>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name
propertiesback to summary
private final Map<String, String> properties

Constructor Detail

KeyStoreEntryback to summary
pack-priv KeyStoreEntry(String name, Map<String, String> properties)

Method Detail

getNameback to summary
pack-priv String getName()
getPropertiesback to summary
pack-priv Map<String, String> getProperties()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
sun.security.provider back to summary

public Class PolicyParser.ParsingException

extends GeneralSecurityException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private String
private LocalizedMessage
private static final long
private Object[]

Constructor Summary

AccessConstructor and Description
public
ParsingException(String
the detail message.
msg
)

Constructs a ParsingException with the specified detail message.

public
ParsingException(String msg, LocalizedMessage localizedMsg, Object[] source)

public
ParsingException(int line, String msg)

public
ParsingException(int line, String expect, String actual)

Method Summary

Modifier and TypeMethod and Description
public String

Field Detail

i18nMessageback to summary
private String i18nMessage
localizedMsgback to summary
private LocalizedMessage localizedMsg
Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.GeneralSecurityException.serialVersionUID.

Annotations
@Serial
sourceback to summary
private Object[] source
Annotations
@SuppressWarnings:serial

Constructor Detail

ParsingExceptionback to summary
public ParsingException(String msg)

Constructs a ParsingException with the specified detail message. A detail message is a String that describes this particular exception, which may, for example, specify which algorithm is not available.

Parameters
msg:String

the detail message.

ParsingExceptionback to summary
public ParsingException(String msg, LocalizedMessage localizedMsg, Object[] source)
ParsingExceptionback to summary
public ParsingException(int line, String msg)
ParsingExceptionback to summary
public ParsingException(int line, String expect, String actual)

Method Detail

getNonlocalizedMessageback to summary
public String getNonlocalizedMessage()