Class StoreAnonymizerXmlHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.jalios.jstore.tools.anonymizer.impl.sax.DefaultStoreAnonymizerXmlHandler
-
- com.jalios.jstore.tools.anonymizer.impl.sax.StoreAnonymizerXmlHandler
-
- All Implemented Interfaces:
StoreConstants
,StoreAnonymizerConstants
,org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class StoreAnonymizerXmlHandler extends DefaultStoreAnonymizerXmlHandler
Processes an XML file, and rewrites it to an outputStream usingstartElement(String, String, String, Attributes)
.- Since:
- jcms-10.0.8
- Author:
- Sylvain Devaux
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>
AUTHORIZED_MEMBER_KV_ATTRIBUTES
protected static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>>
AUTHORIZED_TAG_KV_ATTRIBUTES
-
Fields inherited from class com.jalios.jstore.tools.anonymizer.impl.sax.DefaultStoreAnonymizerXmlHandler
MGR
-
Fields inherited from interface com.jalios.jstore.tools.anonymizer.StoreAnonymizerConstants
CLASSNAME_PATTERN, CLOSE_WRAPPER, DATA_CLASSNAME_PATTERN, DB_DATAID_PATTERN, JSTORE_DATAID_PATTERN, OBFUSCATED, OPEN_WRAPPER
-
Fields inherited from interface com.jalios.jstore.StoreConstants
ARRAY_FLAG, CLEANING_STATE, COLLECTION_FLAG, CREATE_OP, DELETE_OP, IDLE_STATE, INNER_LOGS, INNER_MILESTONE, INNER_PREFIX, INNER_SYNC, ITEM_ESCAPE_CHAR, ITEM_SEPARATOR, LOADING_STATE, LOG_DIR_LOG_PREFIX, LOG_DIR_LOG_WORK, MAP_ASSIGN, MAP_CHARS_TO_ESCAPE, MAP_CLASS_SEPARATOR, MAP_FLAG, NAMESPACE, SH_SUFFIX, STORING_STATE, UPDATE_OP
-
-
Constructor Summary
Constructors Constructor Description StoreAnonymizerXmlHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StoreAnonymizerResult
anonymizeStore(java.lang.String inputFilePath, StoreAnonymizerParameters params)
java.lang.String
anonymizeString(java.lang.String attributeValue)
void
endDocument()
void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
java.lang.String
getAnonymizedAttributeValue(java.lang.String tagName, java.lang.String attributeName, java.lang.String attributeValue)
java.lang.String
getAnonymizedAttributeValueMap(java.lang.String attributeValue)
java.util.Collection<java.lang.String>
getAuthorizedAttributes()
java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getAuthorizedTagAttributes()
protected StoreAnonymizerParameters
getParams()
boolean
isAuthorizedAttribute(java.lang.String attributeName)
boolean
isAuthorizedAttributeValue(java.lang.String value)
Allows values being: empty number boolean jcmsId empty array or collection IDs array or collectionboolean
isAuthorizedTagAttribute(java.lang.String tagName, java.lang.String attributeName)
boolean
isAuthorizedTagAttributeNameValuePair(java.lang.String tagName, java.lang.String attributeName, java.lang.String attributeValue)
void
startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
java.lang.String
toString()
-
Methods inherited from class com.jalios.jstore.tools.anonymizer.impl.sax.DefaultStoreAnonymizerXmlHandler
clearInputStream, clearOutputStream, getInputFilePath, getInputStream, getLineCount, getMultiInputStream, getOutputFilePath, getOutputStream, getSAXParser, setInputFilePath, setLineCount, setOutputFilePath
-
-
-
-
Field Detail
-
AUTHORIZED_MEMBER_KV_ATTRIBUTES
protected static java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> AUTHORIZED_MEMBER_KV_ATTRIBUTES
-
AUTHORIZED_TAG_KV_ATTRIBUTES
protected static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>> AUTHORIZED_TAG_KV_ATTRIBUTES
-
-
Method Detail
-
anonymizeStore
public StoreAnonymizerResult anonymizeStore(java.lang.String inputFilePath, StoreAnonymizerParameters params) throws StoreAnonymizerException
- Throws:
StoreAnonymizerException
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException
- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endDocument
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
anonymizeString
public java.lang.String anonymizeString(java.lang.String attributeValue)
-
getAnonymizedAttributeValue
public java.lang.String getAnonymizedAttributeValue(java.lang.String tagName, java.lang.String attributeName, java.lang.String attributeValue)
-
getAnonymizedAttributeValueMap
public java.lang.String getAnonymizedAttributeValueMap(java.lang.String attributeValue)
-
isAuthorizedAttribute
public boolean isAuthorizedAttribute(java.lang.String attributeName)
-
isAuthorizedTagAttribute
public boolean isAuthorizedTagAttribute(java.lang.String tagName, java.lang.String attributeName)
-
isAuthorizedTagAttributeNameValuePair
public boolean isAuthorizedTagAttributeNameValuePair(java.lang.String tagName, java.lang.String attributeName, java.lang.String attributeValue)
-
isAuthorizedAttributeValue
public boolean isAuthorizedAttributeValue(java.lang.String value)
Allows values being:- empty
- number
- boolean
- jcmsId
- empty array or collection
- IDs array or collection
-
getAuthorizedAttributes
public java.util.Collection<java.lang.String> getAuthorizedAttributes()
-
getAuthorizedTagAttributes
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAuthorizedTagAttributes()
-
getParams
protected StoreAnonymizerParameters getParams()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-