public class XmlPolicyModelUnmarshaller extends PolicyModelUnmarshaller
| Modifier and Type | Field and Description |
|---|---|
private static PolicyLogger |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
protected |
XmlPolicyModelUnmarshaller()
Creates a new instance of XmlPolicyModelUnmarshaller
|
| Modifier and Type | Method and Description |
|---|---|
private ModelNode |
addNewChildNode(NamespaceVersion nsVersion,
ModelNode parentNode,
javax.xml.stream.events.StartElement childElement) |
private void |
checkEndTagName(javax.xml.namespace.QName expected,
javax.xml.stream.events.EndElement element)
Method checks whether the actual name of the end tag is equal to the expected name - the name of currently unmarshalled
XML policy model element.
|
protected PolicySourceModel |
createSourceModel(NamespaceVersion nsVersion,
java.lang.String id,
java.lang.String name)
Allow derived classes to pass in a custom instance of PolicySourceModel.
|
private javax.xml.stream.XMLEventReader |
createXMLEventReader(java.lang.Object storage)
Method checks if the storage type is supported and transforms it to XMLEventReader instance which is then returned.
|
private javax.xml.stream.events.Attribute |
getAttributeByName(javax.xml.stream.events.StartElement element,
javax.xml.namespace.QName attributeName) |
private PolicySourceModel |
initializeNewModel(javax.xml.stream.events.StartElement element) |
private void |
parseAssertionData(NamespaceVersion nsVersion,
java.lang.String value,
ModelNode childNode,
javax.xml.stream.events.StartElement childElement) |
private boolean |
parseBooleanValue(java.lang.String value)
Return true if the value is "true" or "1".
|
private java.lang.StringBuilder |
processCharacters(ModelNode.Type currentNodeType,
javax.xml.stream.events.Characters characters,
java.lang.StringBuilder currentValueBuffer) |
PolicySourceModel |
unmarshalModel(java.lang.Object storage)
|
private java.lang.String |
unmarshalNodeContent(NamespaceVersion nsVersion,
ModelNode node,
javax.xml.namespace.QName nodeElementName,
javax.xml.stream.XMLEventReader reader) |
getXmlUnmarshallerprivate static final PolicyLogger LOGGER
protected XmlPolicyModelUnmarshaller()
public PolicySourceModel unmarshalModel(java.lang.Object storage) throws PolicyException
unmarshalModel in class PolicyModelUnmarshallerstorage - reference to underlying storage that should be used for model unmarshallingnull.PolicyException - in case of the unmarshalling problemsprotected PolicySourceModel createSourceModel(NamespaceVersion nsVersion, java.lang.String id, java.lang.String name)
nsVersion - id - name - private PolicySourceModel initializeNewModel(javax.xml.stream.events.StartElement element) throws PolicyException, javax.xml.stream.XMLStreamException
PolicyExceptionjavax.xml.stream.XMLStreamExceptionprivate ModelNode addNewChildNode(NamespaceVersion nsVersion, ModelNode parentNode, javax.xml.stream.events.StartElement childElement) throws PolicyException
PolicyExceptionprivate void parseAssertionData(NamespaceVersion nsVersion, java.lang.String value, ModelNode childNode, javax.xml.stream.events.StartElement childElement) throws java.lang.IllegalArgumentException, PolicyException
java.lang.IllegalArgumentExceptionPolicyExceptionprivate javax.xml.stream.events.Attribute getAttributeByName(javax.xml.stream.events.StartElement element,
javax.xml.namespace.QName attributeName)
private java.lang.String unmarshalNodeContent(NamespaceVersion nsVersion, ModelNode node, javax.xml.namespace.QName nodeElementName, javax.xml.stream.XMLEventReader reader) throws PolicyException
PolicyExceptionprivate javax.xml.stream.XMLEventReader createXMLEventReader(java.lang.Object storage)
throws PolicyException
storage - An XMLEventReader instance.PolicyException - If the XMLEventReader cast failed.private void checkEndTagName(javax.xml.namespace.QName expected,
javax.xml.stream.events.EndElement element)
throws PolicyException
expected - The expected element name.element - The actual element.PolicyException - If the actual element name did not match the expected element.private java.lang.StringBuilder processCharacters(ModelNode.Type currentNodeType, javax.xml.stream.events.Characters characters, java.lang.StringBuilder currentValueBuffer) throws PolicyException
PolicyExceptionprivate boolean parseBooleanValue(java.lang.String value)
throws PolicyException
value - The String representation of the value. Must not be null.PolicyException - If the value is not "true", "false", "0" or "1".