public class ParepUtils extends Object
| Constructor and Description |
|---|
ParepUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Document |
createEmptyDocument()
Creates an empty XML document.
|
static void |
dumpInputOutputStream(InputStream is,
OutputStream os)
Dumps all bytes from an input stream to the given output stream.
|
static Element |
extractMandator(Element mandate)
Extracts the md:Mandator element from a XML mandate element.
|
static String |
extractMandatorDateOfBirth(Element mandator)
Extracts the date of birth of the mandator of a given md:Mandator element.
|
static String |
extractMandatorFullName(Element mandator)
Extracts the full name of the mandators corporate body of a given
md:Mandator element.
|
static String |
extractMandatorIdentificationType(Element mandator)
Extracts the identification type of the mandator of a given mandate.
|
static String |
extractMandatorName(Element mandator)
Extracts the name of the mandator as a string representation.
|
static String |
extractMandatorWbpk(Element mandator)
Extracts the identification value of the mandator of a given mandate.
|
static Element |
extractPersonOfMandate(Element mandate)
Extracts the
pr:PhysicalPerson or pr:CorporateBody
element from a XML mandate element. |
static Element |
extractPrPersonOfMandate(Element mandate)
Benerates the pr:Person element form a
pr:PhysicalPerson or pr:CorporateBody
element of a XML mandate element. |
static String |
extractRepresentativeID(Element mandate) |
static String |
extractText(Element mandator,
String xpath)
Extracts specific text of an element of a given md:Mandator element.
|
static String |
getIdentification(Element personElement,
String element) |
static String |
getMandateContent(Element mandate)
Extracts the textual description of the mandate.
|
static String |
getMandateIssuedDate(Element mandate)
Gets a string that represents the date a mandate was issued.
|
static String |
getMandateIssuedPlace(Element mandate)
Gets a string that represents the place a mandate was issued.
|
static String |
getRegisterString(String identificationType)
Delivers a String with the description of the register which is described
through the identification Type of a corporate body of the persondata schema
|
static Element |
HideStammZahlen(Element hideElement,
boolean businessApplication,
String target,
String registerID,
boolean blank)
Hides Stammzahlen in the given element
|
static boolean |
isEmpty(String str)
Determines whether a string is null or empty
|
static boolean |
isPhysicalPerson(Element mandator)
Tells wether a mandator is a physical person or not.
|
static boolean |
isValidatorEnabled(Element applicationSpecificParams)
Tells if the Validator of an Infobox is enabled.
|
static Document |
readDocFromIs(InputStream is)
Reads a XML document from an input stream (namespace-aware).
|
static String |
replaceAll(String s,
String search,
String replace)
Replaces each substring of string
s that matches the given
search string by the given replace string. |
static void |
saveBytesToFile(byte[] str,
File file) |
static void |
saveElementToFile(Element elem,
File file) |
static void |
saveStringToFile(String str,
File file) |
static void |
serializeElement(Element element,
OutputStream out)
Serializes a XML element to a given output stream.
|
static void |
serializeElementAsDocument(Element element,
OutputStream out) |
static void |
serializeElementWithoutEncoding(Element element,
OutputStream out) |
public static boolean isEmpty(String str)
str - the string to check.true if the string is null or empty,
false otherwise.public static Document readDocFromIs(InputStream is) throws SZRGWClientException
is - the input stream to read from.SZRGWClientException - if an error occurs reading the document from the input stream.public static String extractRepresentativeID(Element mandate) throws ValidateException
ValidateExceptionpublic static void dumpInputOutputStream(InputStream is, OutputStream os) throws IOException
is - the input stream to dump from.os - the output stream to dump to.IOException - if an error occurs while dumping.public static String getMandateIssuedDate(Element mandate) throws SZRGWClientException
mandate - the mandate to extract the issuing date from.SZRGWClientException - if an exception occurs extracting the issuing date of the
mandate.public static String getMandateIssuedPlace(Element mandate) throws SZRGWClientException
mandate - the mandate to extract the issuing place from.SZRGWClientException - if an exception occurs extracting the issuing place of the
mandate.public static String getMandateContent(Element mandate) throws SZRGWClientException
mandate - the mandate to extract the textual description from.SZRGWClientException - if an exception occurs extracting the textual description.public static Element extractMandator(Element mandate) throws ParseException
mandate - the md:Mandate element to extract the md:Mandator from.SZRGWClientException - if an error occurs extracting the md:Mandator element.ParseExceptionpublic static boolean isPhysicalPerson(Element mandator)
mandator - the XML md:Mandator element to extract from.true if the mandator is a physical person, false otherwise.public static Element extractPersonOfMandate(Element mandate) throws ParseException
pr:PhysicalPerson or pr:CorporateBody
element from a XML mandate element.mandate - the md:Mandate element to extract the person from.pr:PhysicalPerson or pr:CorporateBody element.ParseException - if an error occurs extracting the element.public static Element extractPrPersonOfMandate(Element mandate) throws ParseException
pr:PhysicalPerson or pr:CorporateBody
element of a XML mandate element.mandate - the md:Mandate element to extract the person from.pr:Person element.ParseException - if an error occurs extracting the element.public static String extractMandatorName(Element mandator)
mandator - the XML md:Mandator element to extract from.public static String extractText(Element mandator, String xpath)
mandator - the XML md:Mandator to extract from.public static String extractMandatorDateOfBirth(Element mandator)
mandator - the XML md:Mandator to extract from.public static String extractMandatorFullName(Element mandator)
mandator - the XML md:Mandator to extract from.public static String extractMandatorWbpk(Element mandator)
mandator - the XML md:Mandator element.public static String extractMandatorIdentificationType(Element mandator)
mandator - the XML md:Mandator element.public static String getIdentification(Element personElement, String element) throws ParseException
ParseExceptionpublic static void serializeElement(Element element, OutputStream out) throws IOException
element - the XML element to serialize.out - the output streamt o serialize to.IOException - if an I/O error occurs during serialization.public static void serializeElementAsDocument(Element element, OutputStream out) throws IOException
IOExceptionpublic static void serializeElementWithoutEncoding(Element element, OutputStream out) throws IOException
IOExceptionpublic static void saveStringToFile(String str, File file) throws IOException
IOExceptionpublic static void saveBytesToFile(byte[] str,
File file)
throws IOException
IOExceptionpublic static void saveElementToFile(Element elem, File file) throws IOException
IOExceptionpublic static Document createEmptyDocument() throws SZRGWClientException
SZRGWClientException - if an error occurs creating the empty document.public static boolean isValidatorEnabled(Element applicationSpecificParams) throws ConfigurationException
EnableInfoboxValidator is missing, a default value true is assumedapplicationSpecificParams - the XML element of the infobox configuration.ConfigurationException - if an error occurs reading the configuration.public static String getRegisterString(String identificationType)
identificationType - the identification type.public static Element HideStammZahlen(Element hideElement, boolean businessApplication, String target, String registerID, boolean blank) throws BuildException
hideElement - The element where Stammzahlen should be replaced.businessApplication - For decision whether to calc a bPK or wbPK.target - Target for calculating a bPK.registerID - Necessary string for calculating a wbPK (example FN+4096i).blank - Switch for behaviour.
true if Stammzahlen are blinded. All occurences will be replaced by empty strings.
false calculates (w)bPKs and changes also the pr:Identifivation/pr:Type elements.BuildExceptionpublic static String replaceAll(String s, String search, String replace)
s that matches the given
search string by the given replace string.s - The string where the replacement should take place.search - The pattern that should be replaced.replace - The string that should replace all each search
string within s.search are
replaced with replace.Copyright © 2016. All Rights Reserved.