public class SerializedPhpParser extends Object
Deserializes a serialized PHP data structure into corresponding Java objects.
It supports the integer, float, boolean, string primitives that are mapped to
their Java equivalent, plus arrays that are parsed into Map
instances and objects that are represented by
SerializedPhpParser.PhpObject instances.
Example of use:
String input = "O:8:"TypeName":1:{s:3:"foo";s:3:"bar";}";
SerializedPhpParser serializedPhpParser = new SerializedPhpParser(input);
Object result = serializedPhpParser.parse();
The result object will be a PhpObject with the name
"TypeName" and the attribute "foo" = "bar".
| Modifier and Type | Class and Description |
|---|---|
static class |
SerializedPhpParser.PhpObject
Represents an object that has a name and a map of attributes
|
| Constructor and Description |
|---|
SerializedPhpParser(String input) |
SerializedPhpParser(String input,
boolean assumeUTF8) |
public static final Object NULL
public SerializedPhpParser(String input)
public SerializedPhpParser(String input, boolean assumeUTF8)
public Object parse() throws SerializedPhpParserException
SerializedPhpParserExceptionpublic void setAcceptedAttributeNameRegex(String acceptedAttributeNameRegex)
Copyright © 2015. All rights reserved.