Package org.opencms.jsp.jsonpart
Class CmsJsonPart
- java.lang.Object
-
- org.opencms.jsp.jsonpart.CmsJsonPart
-
public class CmsJsonPart extends java.lang.Object
Helper class used to translate key/value pairs from and to the format which can be processed by the CmsJsonPartFilter.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
END
The terminator used for JSON parts.
-
Constructor Summary
Constructors Constructor Description CmsJsonPart(java.lang.String key, java.lang.String value)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getHeader(java.lang.String key)
Gets the header section for a named JSON part.java.lang.String
getKey()
Returns the key.java.lang.String
getValue()
Returns the value.static java.util.List<CmsJsonPart>
parseJsonParts(java.lang.String text)
Parses the encoded JSON parts from the given string and puts them in a list.
-
-
-
Field Detail
-
END
public static final java.lang.String END
The terminator used for JSON parts.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsJsonPart
public CmsJsonPart(java.lang.String key, java.lang.String value)
Creates a new instance.- Parameters:
key
- the keyvalue
- the value
-
-
Method Detail
-
getHeader
public static final java.lang.String getHeader(java.lang.String key)
Gets the header section for a named JSON part.- Parameters:
key
- the JSON key for the part- Returns:
- the header section for the given key
-
parseJsonParts
public static java.util.List<CmsJsonPart> parseJsonParts(java.lang.String text)
Parses the encoded JSON parts from the given string and puts them in a list.- Parameters:
text
- the text containing the encoded JSON parts- Returns:
- the decoded JSON parts
-
getKey
public java.lang.String getKey()
Returns the key.- Returns:
- the key
-
getValue
public java.lang.String getValue()
Returns the value.- Returns:
- the value
-
-