|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.binaryfantasy.murq.source.SourceKey
public final class SourceKey
An immutable internal class that manages the translation between content's
public id, locale and possibly it's internal binary id and it's
String source key. SourceKey also handles
the finding of internationalized candidates for a given piece of content.
| Field Summary | |
|---|---|
static String |
SEPARATOR_BINARY
Character used to separate the optional binary id from the content id and/or the locale. |
static String |
SEPARATOR_LOCALE
Character used to separate locale from content id. |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
String |
getBinaryId()
Returns the identifier for a piece of binary data belonging to the content holding this key's contentId. |
static List<SourceKey> |
getCandidates(String contentId,
Locale locale)
Returns SourceKey local candidates using the method
described in
ResourceBundle.getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader). |
String |
getContentId()
Returns the base id for this key. |
Locale |
getLocale()
Returns this key's specific locale, or null if it
represents default content. |
static SourceKey |
getSourceKey(IContent content)
Returns a SourceKey represented by the specified
IContent. |
static SourceKey |
getSourceKey(String sourceKey)
Returns a SourceKey represented by the specified
String. |
static SourceKey |
getSourceKey(String contentId,
Locale locale,
String binaryId)
Returns a SourceKey representing the
contentId and the optional locale and
binaryId. |
int |
hashCode()
|
boolean |
isBinary()
Return true if this key points to binary data. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SEPARATOR_LOCALE
public static final String SEPARATOR_BINARY
| Method Detail |
|---|
public static SourceKey getSourceKey(String sourceKey)
SourceKey represented by the specified
String.
sourceKey - String representation of the
SourceKey requested.
SourceKey represented by the specified
String.
IllegalArgumentException - if sourceKey is null.public static SourceKey getSourceKey(IContent content)
SourceKey represented by the specified
IContent.
content - content to get a source key for.
SourceKey represented by the specified
IContent.
IllegalArgumentException - if content or the contentId of
the content is null.
public static SourceKey getSourceKey(String contentId,
Locale locale,
String binaryId)
SourceKey representing the
contentId and the optional locale and
binaryId.
Note: The binaryId argument does not relate to
IBinaryContent.
SourceKeys with a binaryId point to binary
data that is to be recombined with other deserialized data to reform a
IContent object.
contentId - contentId to base the SourceKey on.locale - specific locale for the key, or null if
default.binaryId - the identifier for binary data that makes up part of an
IContent.
SourceKey representing the
contentId and the optional locale
and binaryId.
IllegalArgumentException - if the contentId is null.
public static List<SourceKey> getCandidates(String contentId,
Locale locale)
SourceKey local candidates using the method
described in
ResourceBundle.getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader).
contentId - the id to get candidates for.locale - the specific locale desired, from which alternate candidates
will be generated.
SourceKey local candidates using the method
described in
ResourceBundle.getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader).public String getContentId()
public Locale getLocale()
null if it
represents default content.
null if it
represents default content.public String getBinaryId()
contentId.
contentId.public boolean isBinary()
true if this key points to binary data.
true if this key points to binary data.public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||