signature:
public class ABaseClientWS { /** * Performs an HTTP - PUT request with { @ code postfixUrlParam } .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param baseDomainParam The JSON object to submit to endpoint as PUT .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON . */
protected JSONObject putJson ( boolean checkConnectionValidParam , ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation: return this . executeJson ( HttpMethod . PUT , null , checkConnectionValidParam , baseDomainParam , ContentType . APPLICATION_JSON , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - PUT request with { @ code postfixUrlParam } .
 * @ param baseDomainParam The JSON object to submit to endpoint as PUT .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON . */
protected JSONObject putJson ( ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation:
// Create without connection check . . .
return this . putJson ( false , baseDomainParam , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Submit a JSON based HTTP request body with JSON as a response .
 * @ param httpMethodParam The HTTP method to use .
 * @ param headerNameValuesParam The additional HTTP headers .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param baseDomainParam The object to convert to JSON and submit as { @ code httpMethodParam } .
 * @ param contentTypeParam The Mime / Content type to submit as .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see HttpMethod
 * @ see JSONObject
 * @ see ContentType
 * @ see ABaseFluidJSONObject */
protected JSONObject executeJson ( HttpMethod httpMethodParam , List < HeaderNameValue > headerNameValuesParam , boolean checkConnectionValidParam , ABaseFluidJSONObject baseDomainParam , ContentType contentTypeParam , String postfixUrlParam ) { } }

implementation:
// Validate that something is set .
if ( baseDomainParam == null ) { throw new FluidClientException ( "No JSON body to post." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } String bodyJsonString = baseDomainParam . toJsonObject ( ) . toString ( ) ; return this . executeString ( httpMethodParam , headerNameValuesParam , checkConnectionValidParam , bodyJsonString , contentTypeParam , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Submit a HTML Form based HTTP request body with JSON as a response .
 * @ param httpMethodParam The HTTP method to use .
 * @ param headerNameValuesParam The additional HTTP headers .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param formNameValuesParam The Form name and value pairs .
 * @ param contentTypeParam The Mime / Content type to submit as .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see HttpMethod
 * @ see JSONObject
 * @ see ContentType
 * @ see ABaseFluidJSONObject */
protected JSONObject executeForm ( HttpMethod httpMethodParam , List < HeaderNameValue > headerNameValuesParam , boolean checkConnectionValidParam , List < FormNameValue > formNameValuesParam , ContentType contentTypeParam , String postfixUrlParam ) { } }

implementation:
// Validate Form Field and values . . .
if ( formNameValuesParam == null || formNameValuesParam . isEmpty ( ) ) { throw new FluidClientException ( "No 'Name and Value' body to post." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } StringBuilder strBuilder = new StringBuilder ( ) ; for ( FormNameValue nameValue : formNameValuesParam ) { if ( nameValue . getName ( ) == null || nameValue . getName ( ) . trim ( ) . isEmpty ( ) ) { continue ; } if ( nameValue . getValue ( ) == null ) { continue ; } strBuilder . append ( nameValue . getName ( ) ) ; strBuilder . append ( EQUALS ) ; strBuilder . append ( nameValue . getValue ( ) ) ; strBuilder . append ( AMP ) ; } String bodyJsonString = strBuilder . toString ( ) ; bodyJsonString = bodyJsonString . substring ( 0 , bodyJsonString . length ( ) - 1 ) ; return this . executeString ( httpMethodParam , headerNameValuesParam , checkConnectionValidParam , bodyJsonString , contentTypeParam , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Submit the { @ code stringParam } as HTTP request body with JSON as a response .
 * @ param httpMethodParam The HTTP method to use .
 * @ param headerNameValuesParam The additional HTTP headers .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param stringParam The Text to submit .
 * @ param contentTypeParam The Mime / Content type to submit as .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see HttpMethod
 * @ see JSONObject
 * @ see ContentType
 * @ see ABaseFluidJSONObject */
protected JSONObject executeString ( HttpMethod httpMethodParam , List < HeaderNameValue > headerNameValuesParam , boolean checkConnectionValidParam , String stringParam , ContentType contentTypeParam , String postfixUrlParam ) { } }

implementation:
String responseBody = this . executeTxtReceiveTxt ( httpMethodParam , headerNameValuesParam , checkConnectionValidParam , stringParam , contentTypeParam , postfixUrlParam ) ; if ( responseBody == null || responseBody . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "No response data from '" + this . endpointUrl . concat ( postfixUrlParam ) + "'." , FluidClientException . ErrorCode . IO_ERROR ) ; } try { JSONObject jsonOjb = new JSONObject ( responseBody ) ; if ( jsonOjb . isNull ( Error . JSONMapping . ERROR_CODE ) ) { return jsonOjb ; } int errorCode = jsonOjb . getInt ( Error . JSONMapping . ERROR_CODE ) ; if ( errorCode > 0 ) { String errorMessage = ( jsonOjb . isNull ( Error . JSONMapping . ERROR_MESSAGE ) ? "Not set" : jsonOjb . getString ( Error . JSONMapping . ERROR_MESSAGE ) ) ; throw new FluidClientException ( errorMessage , errorCode ) ; } return jsonOjb ; } catch ( JSONException jsonExcept ) { // Invalid JSON Body . . .
if ( responseBody != null && ! responseBody . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( jsonExcept . getMessage ( ) + "\n Response Body is: \n\n" + responseBody , jsonExcept , FluidClientException . ErrorCode . JSON_PARSING ) ; } throw new FluidClientException ( jsonExcept . getMessage ( ) , jsonExcept , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class ABaseClientWS { /** * Submit the { @ code stringParam } as HTTP request body with JSON as a response .
 * @ param httpMethodParam The HTTP method to use .
 * @ param headerNameValuesParam The additional HTTP headers .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param stringParam The Text to submit .
 * @ param contentTypeParam The Mime / Content type to submit as .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see HttpMethod
 * @ see JSONObject
 * @ see ContentType
 * @ see ABaseFluidJSONObject */
protected String executeTxtReceiveTxt ( HttpMethod httpMethodParam , List < HeaderNameValue > headerNameValuesParam , boolean checkConnectionValidParam , String stringParam , ContentType contentTypeParam , String postfixUrlParam ) { } }

implementation:
if ( stringParam == null || stringParam . isEmpty ( ) ) { throw new FluidClientException ( "No JSON body to post." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } // Check connection . . .
if ( checkConnectionValidParam && ! this . isConnectionValid ( ) ) { throw new FluidClientException ( "Unable to reach service at '" + this . endpointUrl . concat ( postfixUrlParam ) + "'." , FluidClientException . ErrorCode . CONNECT_ERROR ) ; } CloseableHttpClient httpclient = this . getClient ( ) ; String responseBody = null ; try { HttpUriRequest uriRequest = null ; // POST . . .
if ( httpMethodParam == HttpMethod . POST ) { // When its html Form Data . . .
if ( contentTypeParam == ContentType . APPLICATION_FORM_URLENCODED ) { RequestBuilder builder = RequestBuilder . post ( ) . setUri ( this . endpointUrl . concat ( postfixUrlParam ) ) ; builder = this . addParamsToBuildFromString ( builder , stringParam ) ; uriRequest = builder . build ( ) ; } else { // JSON or any other . . .
uriRequest = new HttpPost ( this . endpointUrl . concat ( postfixUrlParam ) ) ; } uriRequest . setHeader ( CONTENT_TYPE_HEADER , contentTypeParam . toString ( ) ) ; } else if ( httpMethodParam == HttpMethod . PUT ) { // PUT . . .
if ( contentTypeParam == ContentType . APPLICATION_FORM_URLENCODED ) { RequestBuilder builder = RequestBuilder . put ( ) . setUri ( this . endpointUrl . concat ( postfixUrlParam ) ) ; builder = this . addParamsToBuildFromString ( builder , stringParam ) ; uriRequest = builder . build ( ) ; } else { uriRequest = new HttpPut ( this . endpointUrl . concat ( postfixUrlParam ) ) ; uriRequest . setHeader ( CONTENT_TYPE_HEADER , contentTypeParam . toString ( ) ) ; } } else if ( httpMethodParam == HttpMethod . DELETE ) { // DELETE . . .
uriRequest = new HttpDelete ( this . endpointUrl . concat ( postfixUrlParam ) ) ; uriRequest . setHeader ( CONTENT_TYPE_HEADER , contentTypeParam . toString ( ) ) ; } // Check that the URI request is set .
if ( uriRequest == null ) { throw new FluidClientException ( "URI Request is not set for HTTP Method '" + httpMethodParam + "'." , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; } // Set additional headers . . .
if ( headerNameValuesParam != null && ! headerNameValuesParam . isEmpty ( ) ) { for ( HeaderNameValue headerNameVal : headerNameValuesParam ) { if ( headerNameVal . getName ( ) == null || headerNameVal . getName ( ) . trim ( ) . isEmpty ( ) ) { continue ; } if ( headerNameVal . getValue ( ) == null ) { continue ; } uriRequest . setHeader ( headerNameVal . getName ( ) , headerNameVal . getValue ( ) ) ; } } // When HttpEntity Enclosing Request Base . . .
if ( uriRequest instanceof HttpEntityEnclosingRequestBase ) { HttpEntity httpEntity = new StringEntity ( stringParam , contentTypeParam ) ; ( ( HttpEntityEnclosingRequestBase ) uriRequest ) . setEntity ( httpEntity ) ; } // Create a custom response handler
ResponseHandler < String > responseHandler = this . getJsonResponseHandler ( this . endpointUrl . concat ( postfixUrlParam ) ) ; responseBody = this . executeHttp ( httpclient , uriRequest , responseHandler , postfixUrlParam ) ; if ( responseBody == null || responseBody . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "No response data from '" + this . endpointUrl . concat ( postfixUrlParam ) + "'." , FluidClientException . ErrorCode . IO_ERROR ) ; } return responseBody ; } catch ( FluidClientException fluidClientExcept ) { // Fluid Client Exception . . .
throw fluidClientExcept ; } catch ( Exception otherExcept ) { // Other Exceptions . . .
throw new FluidClientException ( otherExcept . getMessage ( ) , otherExcept , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; }


signature:
public class ABaseClientWS { /** * Add params to the { @ code builderParam } and returns { @ code builderParam } .
 * @ param builderParam Possible existing builder .
 * @ param formDataToAddParam Form Data as Text .
 * @ return Apache HTTP commons request builder . */
private RequestBuilder addParamsToBuildFromString ( RequestBuilder builderParam , String formDataToAddParam ) { } }

implementation: String [ ] nameValuePairs = formDataToAddParam . split ( REGEX_AMP ) ; if ( nameValuePairs . length > 0 ) { for ( String nameValuePair : nameValuePairs ) { String [ ] nameValuePairArr = nameValuePair . split ( REGEX_EQUALS ) ; if ( nameValuePairArr . length > 1 ) { String name = nameValuePairArr [ 0 ] ; String value = nameValuePairArr [ 1 ] ; builderParam = builderParam . addParameter ( name , value ) ; } } } return builderParam ;


signature:
public class ABaseClientWS { /** * Translates a string into { @ code application / x - www - form - urlencoded }
 * format using a specific encoding scheme . This method uses the
 * supplied encoding scheme to obtain the bytes for unsafe
 * characters .
 * @ param textParam The text to URL encode .
 * @ return Encoded text from { @ code textParam } .
 * @ see URLEncoder # encode ( String , String ) */
public static String encodeParam ( String textParam ) { } }

implementation: if ( textParam == null ) { return null ; } try { return URLEncoder . encode ( textParam , ENCODING_UTF_8 ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } return null ;


signature:
public class ABaseClientWS { /** * Performs a HTTP Get against the connection test Web Service to
 * confirm whether the connection is valid .
 * @ return Whether the connection is valid or not . */
public boolean isConnectionValid ( ) { } }

implementation:
// Init the session to get the salt . . .
try { this . getJson ( false , WS . Path . Test . Version1 . testConnection ( ) ) ; } catch ( FluidClientException flowJobExcept ) { // Connect problem . . .
if ( flowJobExcept . getErrorCode ( ) == FluidClientException . ErrorCode . CONNECT_ERROR ) { return false ; } throw flowJobExcept ; } return true ;


signature:
public class ABaseClientWS { /** * Inspects the { @ code baseDomainParam } to confirm whether
 * the base domain is of type { @ code Error } .
 * @ param baseDomainParam The domain object to inspect .
 * @ return Whether the { @ code baseDomainParam } is of type { @ code Error } or error code is greater than 0.
 * @ see ABaseFluidJSONObject
 * @ see Error */
protected boolean isError ( ABaseFluidJSONObject baseDomainParam ) { } }

implementation:
if ( baseDomainParam == null ) { return false ; } // Must be subclass of error and error code greater than 0 . . .
if ( baseDomainParam instanceof Error && ( ( Error ) baseDomainParam ) . getErrorCode ( ) > 0 ) { return true ; } return false ;


signature:
public class ABaseClientWS { /** * Creates a new Http client .
 * If part of a test run , the Http client will accept
 * self signed certificates .
 * See flag { @ code IS _ IN _ JUNIT _ TEST _ MODE } . En
 * @ return CloseableHttpClient that may or may not accept
 * self signed certificates .
 * @ since v1.1 */
private CloseableHttpClient getClient ( ) { } }

implementation:
if ( this . closeableHttpClient != null ) { return this . closeableHttpClient ; } // Only accept self signed certificate if in Junit test case .
String pathToFluidTrustStore = this . getPathToFluidSpecificTrustStore ( ) ; // Test mode . . .
if ( IS_IN_JUNIT_TEST_MODE || pathToFluidTrustStore != null ) { SSLContextBuilder builder = new SSLContextBuilder ( ) ; try { // builder . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) ) ;
if ( pathToFluidTrustStore == null ) { builder . loadTrustMaterial ( new SSLTrustAll ( ) ) ; } else { String password = this . getFluidSpecificTrustStorePassword ( ) ; if ( password == null ) { password = UtilGlobal . EMPTY ; } if ( IS_IN_JUNIT_TEST_MODE ) { builder . loadTrustMaterial ( new File ( pathToFluidTrustStore ) , password . toCharArray ( ) , new SSLTrustAll ( ) ) ; } else { builder . loadTrustMaterial ( new File ( pathToFluidTrustStore ) , password . toCharArray ( ) ) ; } } SSLContext sslContext = builder . build ( ) ; this . closeableHttpClient = HttpClients . custom ( ) . setSSLSocketFactory ( new SSLConnectionSocketFactory ( sslContext ) ) . build ( ) ; } catch ( NoSuchAlgorithmException e ) { // Changed for Java 1.6 compatibility . . .
throw new FluidClientException ( "NoSuchAlgorithm: Unable to load self signed trust material. " + e . getMessage ( ) , e , FluidClientException . ErrorCode . CRYPTOGRAPHY ) ; } catch ( KeyManagementException e ) { throw new FluidClientException ( "KeyManagement: Unable to load self signed trust material. " + e . getMessage ( ) , e , FluidClientException . ErrorCode . CRYPTOGRAPHY ) ; } catch ( KeyStoreException e ) { throw new FluidClientException ( "KeyStore: Unable to load self signed trust material. " + e . getMessage ( ) , e , FluidClientException . ErrorCode . CRYPTOGRAPHY ) ; } catch ( CertificateException e ) { throw new FluidClientException ( "Certificate: Unable to load self signed trust material. " + e . getMessage ( ) , e , FluidClientException . ErrorCode . CRYPTOGRAPHY ) ; } catch ( IOException ioError ) { throw new FluidClientException ( "IOError: Unable to load self signed trust material. " + ioError . getMessage ( ) , ioError , FluidClientException . ErrorCode . CRYPTOGRAPHY ) ; } } else { // Default HTTP Client . . .
this . closeableHttpClient = HttpClients . createDefault ( ) ; } return this . closeableHttpClient ;


signature:
public class ABaseClientWS { /** * Retrieves the system property for the Fluid specific trust store .
 * @ return The { @ code fluid . httpclient . truststore } system property value .
 * @ see System
 * @ see java . util . Properties */
private String getPathToFluidSpecificTrustStore ( ) { } }

implementation: String fluidSystemTrustStore = System . getProperty ( SYSTEM_PROP_FLUID_TRUST_STORE ) ; if ( fluidSystemTrustStore == null || fluidSystemTrustStore . trim ( ) . isEmpty ( ) ) { return null ; } File certFile = new File ( fluidSystemTrustStore ) ; if ( certFile . exists ( ) && certFile . isFile ( ) ) { return fluidSystemTrustStore ; } return null ;


signature:
public class ABaseClientWS { /** * Close the SQL and ElasticSearch Connection , but not in
 * a separate { @ code Thread } . */
protected void closeConnectionNonThreaded ( ) { } }

implementation: if ( this . closeableHttpClient != null ) { try { this . closeableHttpClient . close ( ) ; } catch ( IOException e ) { throw new FluidClientException ( "Unable to close Http Client connection. " + e . getMessage ( ) , e , FluidClientException . ErrorCode . IO_ERROR ) ; } } this . closeableHttpClient = null ;


signature:
public class ABaseSQLUtil { /** * Close the SQL Connection . */
public void closeConnection ( ) { } }

implementation: if ( this . connection == null ) { return ; } try { if ( this . connection . isClosed ( ) ) { return ; } this . connection . close ( ) ; } catch ( SQLException sqlExcept ) { throw new FluidSQLException ( sqlExcept ) ; }


signature:
public class ABaseSQLUtil { /** * Retrieves SQLType from the local { @ code Connection } .
 * @ return The { @ code SQLType } from the { @ code Connection } . */
public SQLServerType getSQLTypeFromConnection ( ) { } }

implementation:
try { if ( this . databaseMetaData == null ) { this . databaseMetaData = this . getConnection ( ) . getMetaData ( ) ; } return SQLServerType . getSQLTypeFromProductName ( this . databaseMetaData . getDatabaseProductName ( ) ) ; } catch ( SQLException sqlExcept ) { // Unable to retrieve the product name .
throw new FluidSQLException ( sqlExcept ) ; }


signature:
public class ABaseSQLUtil { /** * Closes the { @ code preparedStatementParam } and { @ code resultSetParam } .
 * @ param preparedStatementParam The SQL Prepared Statement .
 * @ param resultSetParam The SQL ResultSet .
 * @ see PreparedStatement
 * @ see ResultSet */
protected void closeStatement ( PreparedStatement preparedStatementParam , ResultSet resultSetParam ) { } }

implementation: if ( resultSetParam == null ) { this . closeStatement ( preparedStatementParam ) ; return ; } try { resultSetParam . close ( ) ; this . closeStatement ( preparedStatementParam ) ; } catch ( SQLException sqlExcept ) { throw new FluidSQLException ( sqlExcept ) ; }


signature:
public class ABaseSQLUtil { /** * Closes the { @ code preparedStatementParam } .
 * @ param preparedStatementParam The SQL Prepared Statement .
 * @ see PreparedStatement */
protected void closeStatement ( PreparedStatement preparedStatementParam ) { } }

implementation: if ( preparedStatementParam == null ) { return ; } try { preparedStatementParam . close ( ) ; } catch ( SQLException sqlExcept ) { throw new FluidSQLException ( sqlExcept ) ; }


signature:
public class FlowItemClient { /** * Retrieves the Form Container by Primary key .
 * @ param formIdParam The Form primary key .
 * @ return Form by Primary key . */
public FluidItem getFluidItemByFormId ( Long formIdParam ) { } }

implementation: Form form = new Form ( formIdParam ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new FluidItem ( this . postJson ( form , WS . Path . FlowItem . Version1 . getByForm ( ) ) ) ;


signature:
public class FlowItemClient { /** * Creates a new Fluid Item that will be sent to the { @ code flowJobItemParam }
 * Flow .
 * @ param flowJobItemParam The Fluid Item to create and send to Workflow .
 * @ param flowNameParam The name of the Flow where the Item must be sent .
 * @ return The created Fluid item . */
public FluidItem createFlowItem ( FluidItem flowJobItemParam , String flowNameParam ) { } }

implementation:
if ( flowJobItemParam != null && this . serviceTicket != null ) { flowJobItemParam . setServiceTicket ( this . serviceTicket ) ; } // Flow Job Item Step etc . . .
if ( flowJobItemParam != null ) { flowJobItemParam . setFlow ( flowNameParam ) ; } try { return new FluidItem ( this . putJson ( flowJobItemParam , WS . Path . FlowItem . Version1 . flowItemCreate ( ) ) ) ; } catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class FlowItemClient { /** * Retrieves items for the provided JobView .
 * @ param jobViewParam The { @ link JobView } to retrieve items from .
 * @ param queryLimitParam The query limit .
 * @ param offsetParam The offset .
 * @ param sortFieldParam The sort field .
 * @ param sortOrderParam The sort order .
 * @ return The Fluid items for the { @ code jobViewParam } . */
public FluidItemListing getFluidItemsForView ( JobView jobViewParam , int queryLimitParam , int offsetParam , String sortFieldParam , String sortOrderParam ) { } }

implementation:
if ( this . serviceTicket != null && jobViewParam != null ) { jobViewParam . setServiceTicket ( this . serviceTicket ) ; } try { return new FluidItemListing ( this . postJson ( jobViewParam , WS . Path . FlowItem . Version1 . getByJobView ( queryLimitParam , offsetParam , sortFieldParam , sortOrderParam ) ) ) ; } // rethrow as a Fluid Client exception .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class FlowItemClient { /** * Send a workflow item currently in an { @ code Assignment } step to
 * @ param flowJobItemParam The Fluid Item to { @ code " Send On " } in the workflow process .
 * @ param allowCollaboratorToSendOnParam All a collaborator user to also send on .
 * @ return The Fluid item that was sent on . */
public FluidItem sendFlowItemOn ( FluidItem flowJobItemParam , boolean allowCollaboratorToSendOnParam ) { } }

implementation: if ( flowJobItemParam != null && this . serviceTicket != null ) { flowJobItemParam . setServiceTicket ( this . serviceTicket ) ; } try { return new FluidItem ( this . postJson ( flowJobItemParam , WS . Path . FlowItem . Version1 . sendFlowItemOn ( allowCollaboratorToSendOnParam ) ) ) ; } catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class FlowItemClient { /** * Send a form item to be part of a workflow .
 * @ param formToSendToFlowParam The Form to { @ code " Send To Flow ( introduction ) " } in the workflow process .
 * @ param flowParam The Flow the { @ code formToSendToFlowParam } must be sent to .
 * @ return The Fluid item that was initiated in a workflow process . */
public FluidItem sendFormToFlow ( Form formToSendToFlowParam , String flowParam ) { } }

implementation: FluidItem itemToSend = new FluidItem ( ) ; itemToSend . setForm ( formToSendToFlowParam ) ; itemToSend . setFlow ( flowParam ) ; if ( this . serviceTicket != null ) { itemToSend . setServiceTicket ( this . serviceTicket ) ; } try { return new FluidItem ( this . postJson ( itemToSend , WS . Path . FlowItem . Version1 . sendFlowItemToFlow ( ) ) ) ; } catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class WebSocketClient { /** * Callback hook for Connection close events .
 * @ param userSessionParam The userSession which is getting closed .
 * @ param reasonParam The reason for connection close . */
@ OnClose public void onClose ( Session userSessionParam , CloseReason reasonParam ) { } }

implementation: this . userSession = null ; if ( this . messageHandlers != null ) { this . messageHandlers . values ( ) . forEach ( handle -> { handle . connectionClosed ( ) ; } ) ; }


signature:
public class WebSocketClient { /** * Callback hook for Message Events . This method will be invoked when
 * a client sends a message .
 * @ param messageParam The text message */
@ OnMessage public void onMessage ( String messageParam ) { } }

implementation: boolean handlerFoundForMsg = false ; for ( IMessageResponseHandler handler : new ArrayList < > ( this . messageHandlers . values ( ) ) ) { Object qualifyObj = handler . doesHandlerQualifyForProcessing ( messageParam ) ; if ( qualifyObj instanceof Error ) { handler . handleMessage ( qualifyObj ) ; } else if ( qualifyObj instanceof JSONObject ) { handler . handleMessage ( qualifyObj ) ; handlerFoundForMsg = true ; break ; } } if ( ! handlerFoundForMsg ) { throw new FluidClientException ( "No handler found for message;\n" + messageParam , FluidClientException . ErrorCode . IO_ERROR ) ; }


signature:
public class WebSocketClient { /** * Send a message .
 * @ param aBaseFluidJSONObjectParam The JSON Object to send . */
public void sendMessage ( ABaseFluidJSONObject aBaseFluidJSONObjectParam ) { } }

implementation: if ( aBaseFluidJSONObjectParam == null ) { throw new FluidClientException ( "No JSON Object to send." , FluidClientException . ErrorCode . IO_ERROR ) ; } else { this . sendMessage ( aBaseFluidJSONObjectParam . toJsonObject ( ) . toString ( ) ) ; }


signature:
public class WebSocketClient { /** * Send a message as text .
 * @ param messageToSendParam The text message to send . */
public void sendMessage ( String messageToSendParam ) { } }

implementation: if ( this . userSession == null ) { throw new FluidClientException ( "User Session is not set. Check if connection is open." , FluidClientException . ErrorCode . IO_ERROR ) ; } RemoteEndpoint . Async asyncRemote = null ; if ( ( asyncRemote = this . userSession . getAsyncRemote ( ) ) == null ) { throw new FluidClientException ( "Remote Session is not set. Check if connection is open." , FluidClientException . ErrorCode . IO_ERROR ) ; } asyncRemote . sendText ( messageToSendParam ) ;


signature:
public class WebSocketClient { /** * Closes the Web Socket User session . */
public void closeSession ( ) { } }

implementation: if ( this . userSession == null ) { return ; } try { this . userSession . close ( ) ; } catch ( IOException e ) { throw new FluidClientException ( "Unable to close session. " + e . getMessage ( ) , e , FluidClientException . ErrorCode . IO_ERROR ) ; }


signature:
public class Error { /** * Base { @ code toJsonObject } that creates a { @ code JSONObject }
 * with the Id and ServiceTicket set .
 * @ return { @ code JSONObject } representation of { @ code ABaseFluidJSONObject }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see org . json . JSONObject */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; returnVal . put ( JSONMapping . ERROR_CODE , this . getErrorCode ( ) ) ; returnVal . put ( JSONMapping . ERROR_CODE_OTHER , this . getErrorCode ( ) ) ; // Error Message . . .
if ( this . getErrorMessage ( ) != null ) { returnVal . put ( JSONMapping . ERROR_MESSAGE , this . getErrorMessage ( ) ) ; returnVal . put ( JSONMapping . ERROR_MESSAGE_OTHER , this . getErrorMessage ( ) ) ; } return returnVal ;


signature:
public class SQLUtilWebSocketGetFormFieldsClient { /** * Retrieves all the Ancestors ( Forms ) for the { @ code formToGetAncestorsForForParam } .
 * @ param formsToGetFieldListingForForParam The Fluid Form to get Ancestors for .
 * @ return The { @ code formToGetAncestorsForForParam } Table Records as { @ code Form } ' s . */
public List < FormFieldListing > getFormFieldsSynchronized ( Form ... formsToGetFieldListingForForParam ) { } }

implementation:
if ( formsToGetFieldListingForForParam == null ) { return null ; } if ( formsToGetFieldListingForForParam . length == 0 ) { return null ; } // Start a new request . . .
String uniqueReqId = this . initNewRequest ( ) ; // Send all the messages . . .
int numberOfSentForms = 0 ; for ( Form formToSend : formsToGetFieldListingForForParam ) { this . setEchoIfNotSet ( formToSend ) ; // Send the actual message . . .
this . sendMessage ( formToSend , uniqueReqId ) ; numberOfSentForms ++ ; } try { List < FormFieldListing > returnValue = this . getHandler ( uniqueReqId ) . getCF ( ) . get ( this . getTimeoutInMillis ( ) , TimeUnit . MILLISECONDS ) ; // Connection was closed . . this is a problem . . . .
if ( this . getHandler ( uniqueReqId ) . isConnectionClosed ( ) ) { throw new FluidClientException ( "SQLUtil-WebSocket-GetFormFields: " + "The connection was closed by the server prior to the response received." , FluidClientException . ErrorCode . IO_ERROR ) ; } return returnValue ; } catch ( InterruptedException exceptParam ) { // Interrupted . . .
throw new FluidClientException ( "SQLUtil-WebSocket-Interrupted-GetFormFields: " + exceptParam . getMessage ( ) , exceptParam , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } catch ( ExecutionException executeProblem ) { // Error on the web - socket . . .
Throwable cause = executeProblem . getCause ( ) ; // Fluid client exception . . .
if ( cause instanceof FluidClientException ) { throw ( FluidClientException ) cause ; } else { throw new FluidClientException ( "SQLUtil-WebSocket-GetFormFields: " + cause . getMessage ( ) , cause , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } } catch ( TimeoutException eParam ) { // Timeout . . .
String errMessage = this . getExceptionMessageVerbose ( "SQLUtil-WebSocket-GetFormFields" , uniqueReqId , numberOfSentForms ) ; throw new FluidClientException ( errMessage , FluidClientException . ErrorCode . IO_ERROR ) ; } finally { this . removeHandler ( uniqueReqId ) ; }


signature:
public class FormFlowHistoricData { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FormFlowHistoricData } .
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Rule Executed . . .
if ( this . getRuleExecuted ( ) != null ) { returnVal . put ( JSONMapping . RULE_EXECUTED , this . getRuleExecuted ( ) ) ; } // Rule Executed Result . . .
if ( this . getRuleExecutedResult ( ) != null ) { returnVal . put ( JSONMapping . RULE_EXECUTED_RESULT , this . getRuleExecutedResult ( ) ) ; } // Rule Order . . .
if ( this . getFlowRuleOrder ( ) != null ) { returnVal . put ( JSONMapping . FLOW_RULE_ORDER , this . getFlowRuleOrder ( ) ) ; } // Log Entry Type . . .
if ( this . getLogEntryType ( ) != null ) { returnVal . put ( JSONMapping . LOG_ENTRY_TYPE , this . getLogEntryType ( ) ) ; } // User . . .
if ( this . getUser ( ) != null ) { returnVal . put ( JSONMapping . USER , this . getUser ( ) . toJsonObject ( ) ) ; } // Flow Step . . .
if ( this . getFlowStep ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP , this . getFlowStep ( ) . toJsonObject ( ) ) ; } // Form . . .
if ( this . getForm ( ) != null ) { returnVal . put ( JSONMapping . FORM , this . getForm ( ) . toJsonObject ( ) ) ; } // Job View . . .
if ( this . getJobView ( ) != null ) { returnVal . put ( JSONMapping . JOB_VIEW , this . getJobView ( ) ) ; } return returnVal ;


signature:
public class SQLUtilWebSocketExecuteNativeSQLClient { /** * Executes a native SQL query on the remote Fluid instance .
 * The relevant access must exist .
 * @ param nativeSQLQueryParam The SQL Query to execute .
 * @ return The SQL Execution result as { @ code SQLResultSet } ' s .
 * @ throws FluidClientException if data - source name is not set . */
public List < SQLResultSet > executeNativeSQLSynchronized ( NativeSQLQuery nativeSQLQueryParam ) { } }

implementation:
if ( nativeSQLQueryParam == null ) { return null ; } if ( nativeSQLQueryParam . getDatasourceName ( ) == null || nativeSQLQueryParam . getDatasourceName ( ) . isEmpty ( ) ) { throw new FluidClientException ( "No data-source name provided. Not allowed." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } // No query to execute . . .
if ( ( nativeSQLQueryParam . getQuery ( ) == null || nativeSQLQueryParam . getQuery ( ) . isEmpty ( ) ) && ( nativeSQLQueryParam . getStoredProcedure ( ) == null || nativeSQLQueryParam . getStoredProcedure ( ) . isEmpty ( ) ) ) { return null ; } // Validate the echo . . .
this . setEchoIfNotSet ( nativeSQLQueryParam ) ; // Start a new request . . .
String uniqueReqId = this . initNewRequest ( ) ; // Send the actual message . . .
this . sendMessage ( nativeSQLQueryParam , uniqueReqId ) ; try { List < SQLResultSet > returnValue = this . getHandler ( uniqueReqId ) . getCF ( ) . get ( this . getTimeoutInMillis ( ) , TimeUnit . MILLISECONDS ) ; // Connection was closed . . this is a problem . . . .
if ( this . getHandler ( uniqueReqId ) . isConnectionClosed ( ) ) { throw new FluidClientException ( "SQLUtil-WebSocket-ExecuteNativeSQL: " + "The connection was closed by the server prior to the response received." , FluidClientException . ErrorCode . IO_ERROR ) ; } return returnValue ; } // Interrupted . . .
catch ( InterruptedException exceptParam ) { throw new FluidClientException ( "SQLUtil-WebSocket-ExecuteNativeSQL: " + exceptParam . getMessage ( ) , exceptParam , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } // Error on the web - socket . . .
catch ( ExecutionException executeProblem ) { Throwable cause = executeProblem . getCause ( ) ; // Fluid client exception . . .
if ( cause instanceof FluidClientException ) { throw ( FluidClientException ) cause ; } else { throw new FluidClientException ( "SQLUtil-WebSocket-ExecuteNativeSQL: " + cause . getMessage ( ) , cause , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } } // Timeout . . .
catch ( TimeoutException eParam ) { throw new FluidClientException ( "SQLUtil-WebSocket-ExecuteNativeSQL: Timeout while waiting for all return data. There were '" + this . getHandler ( uniqueReqId ) . getReturnValue ( ) . size ( ) + "' items after a Timeout of " + ( TimeUnit . MILLISECONDS . toSeconds ( this . getTimeoutInMillis ( ) ) ) + " seconds." , FluidClientException . ErrorCode . IO_ERROR ) ; } finally { this . removeHandler ( uniqueReqId ) ; }


signature:
public class SyntaxFactory { /** * Gets the single instance of the { @ code SyntaxFactory } .
 * @ return single instance of { @ code this } . */
public static SyntaxFactory getInstance ( ) { } }

implementation: if ( SyntaxFactory . syntaxFactory == null ) { SyntaxFactory . syntaxFactory = new SyntaxFactory ( ) ; } return SyntaxFactory . syntaxFactory ;


signature:
public class SyntaxFactory { /** * Returns the { @ code ISyntax } from the { @ code sqlTypeParam } and { @ code aliasParam } .
 * @ param sqlTypeParam The type of SQL DB engine .
 * @ param aliasParam The alias or stored procedure .
 * @ return implementation of { @ code ISyntax } .
 * @ see ISyntax
 * @ see com . fluidbpm . program . api . util . sql . ABaseSQLUtil . SQLServerType */
public ISyntax getSyntaxFor ( ABaseSQLUtil . SQLServerType sqlTypeParam , String aliasParam ) { } }

implementation: if ( ISyntax . ProcedureMapping . isStoredProcedureMapping ( aliasParam ) ) { return new StoredProcedureSyntax ( aliasParam , ISyntax . ProcedureMapping . getParamCountForAlias ( aliasParam ) ) ; } throw new FluidSQLException ( new SQLException ( "Unable to find Syntax for alias '" + aliasParam + "' and SQL Type '" + sqlTypeParam + "'." ) ) ;


signature:
public class SyntaxFactory { /** * Returns the { @ code ISyntax } from the { @ code sqlTypeParam } and { @ code formFieldMappingParam } .
 * @ param sqlTypeParam The type of SQL DB engine .
 * @ param formFieldMappingParam The Form Field mapping .
 * @ return implementation of { @ code ISyntax } .
 * @ see ISyntax
 * @ see com . fluidbpm . program . api . util . sql . impl . SQLFormFieldUtil . FormFieldMapping */
public ISyntax getFieldValueSyntaxFor ( ABaseSQLUtil . SQLServerType sqlTypeParam , SQLFormFieldUtil . FormFieldMapping formFieldMappingParam ) { } }

implementation: Long dataType = formFieldMappingParam . dataType ; if ( dataType == null ) { return null ; } switch ( dataType . intValue ( ) ) { case UtilGlobal . FieldTypeId . _1_TEXT : return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_1_Text ) ; case UtilGlobal . FieldTypeId . _2_TRUE_FALSE : return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_2_TrueFalse ) ; case UtilGlobal . FieldTypeId . _3_PARAGRAPH_TEXT : return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_3_ParagraphText ) ; case UtilGlobal . FieldTypeId . _4_MULTI_CHOICE : if ( this . isPlain ( formFieldMappingParam . metaData ) ) { return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_4_MultiChoice ) ; } else if ( this . isSelectMany ( formFieldMappingParam . metaData ) ) { return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldMultipleValue_4_MultiChoice ) ; } else { throw new FluidSQLException ( new SQLException ( "Data Type '" + dataType + "' does not support '" + formFieldMappingParam . metaData + "'." ) ) ; } case UtilGlobal . FieldTypeId . _5_DATE_TIME : return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_5_DateTime ) ; case UtilGlobal . FieldTypeId . _6_DECIMAL : return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_6_Decimal ) ; case UtilGlobal . FieldTypeId . _7_TABLE_FIELD : return this . getSyntaxFor ( sqlTypeParam , ISyntax . ProcedureMapping . Field . GetFormFieldValue_7_TableField ) ; case UtilGlobal . FieldTypeId . _8_TEXT_ENCRYPTED : case UtilGlobal . FieldTypeId . _9_LABEL : return null ; default : throw new FluidSQLException ( new SQLException ( "Data Type '" + dataType + "' is not supported." ) ) ; }


signature:
public class SyntaxFactory { /** * Checks whether { @ code textToCheckParam } is Plain .
 * @ param textToCheckParam The String to check .
 * @ return Whether the { @ code textToCheckParam } is of type Plain . */
private boolean isPlain ( String textToCheckParam ) { } }

implementation: if ( textToCheckParam == null || textToCheckParam . trim ( ) . isEmpty ( ) ) { return false ; } String toCheckLower = textToCheckParam . toLowerCase ( ) ; return toCheckLower . startsWith ( PLAIN . toLowerCase ( ) ) ;


signature:
public class SyntaxFactory { /** * Checks whether { @ code textToCheckParam } is Select Many .
 * @ param textToCheckParam The String to check .
 * @ return Whether the { @ code textToCheckParam } is of type Select Many . */
private boolean isSelectMany ( String textToCheckParam ) { } }

implementation: if ( textToCheckParam == null || textToCheckParam . trim ( ) . isEmpty ( ) ) { return false ; } String toCheckLower = textToCheckParam . toLowerCase ( ) ; return toCheckLower . startsWith ( SELECT_MANY . toLowerCase ( ) ) ;


signature:
public class SQLRow { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code UserQuery }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // SQL Columns . . .
if ( this . getSqlColumns ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( SQLColumn toAdd : this . getSqlColumns ( ) ) { jsonArray . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . SQL_COLUMNS , jsonArray ) ; } return returnVal ;


signature:
public class MailMessageNameValue { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code MailMessageNameValue }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Name . . .
if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Value . . .
if ( this . getValue ( ) != null ) { returnVal . put ( JSONMapping . VALUE , this . getValue ( ) ) ; } return returnVal ;


signature:
public class FluidLicenseClient { /** * Request a new license based on the license request input .
 * It is important to set the following fields .
 * { @ code Valid From }
 * { @ code Valid To }
 * { @ code User Count }
 * @ param licenseRequestParam The license request used to issue a license request from .
 * @ return The License Request file . */
public String requestLicense ( LicenseRequest licenseRequestParam ) { } }

implementation: if ( licenseRequestParam != null && this . serviceTicket != null ) { licenseRequestParam . setServiceTicket ( this . serviceTicket ) ; } return this . executeTxtReceiveTxt ( HttpMethod . POST , null , false , ( licenseRequestParam == null ) ? null : licenseRequestParam . toJsonObject ( ) . toString ( ) , ContentType . APPLICATION_JSON , Version1 . licenseRequest ( ) ) ;


signature:
public class FluidLicenseClient { /** * Applies a generated license for the server .
 * @ param licenseToApplyParam The clear license to apply .
 * @ return The applied license . */
public LicenseRequest applyLicense ( String licenseToApplyParam ) { } }

implementation: LicenseRequest liceReq = new LicenseRequest ( ) ; liceReq . setLicenseCipherText ( licenseToApplyParam ) ; if ( this . serviceTicket != null ) { liceReq . setServiceTicket ( this . serviceTicket ) ; } return new LicenseRequest ( this . postJson ( liceReq , Version1 . licenseApply ( ) ) ) ;


signature:
public class UserQuery { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code UserQuery }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Name . . .
if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Description . . .
if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } // Inputs . . .
if ( this . getInputs ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( Field toAdd : this . getInputs ( ) ) { jsonArray . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . INPUTS , jsonArray ) ; } // Rules . . .
if ( this . getRules ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( String toAdd : this . getRules ( ) ) { jsonArray . put ( toAdd ) ; } returnVal . put ( JSONMapping . RULES , jsonArray ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } return returnVal ;


signature:
public class RouteFieldClient { /** * Create a new Plain Text field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldTextPlain ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . Text ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . Text . PLAIN ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new True False field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldTrueFalse ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . TrueFalse ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . TrueFalse . TRUE_FALSE ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Paragraph Text field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldParagraphTextPlain ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . ParagraphText ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . ParagraphText . PLAIN ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Paragraph HTML field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldParagraphTextHTML ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . ParagraphText ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . ParagraphText . HTML ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Multi Choice field .
 * @ param routeFieldParam Field to Create .
 * @ param multiChoiceValuesParam The available multi choice values .
 * @ return Created Field . */
public Field createFieldMultiChoicePlain ( Field routeFieldParam , List < String > multiChoiceValuesParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( multiChoiceValuesParam == null ) { multiChoiceValuesParam = new ArrayList ( ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . MultipleChoice ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . MultiChoice . PLAIN ) ; routeFieldParam . setFieldValue ( new MultiChoice ( multiChoiceValuesParam ) ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Multi Choice select Many field .
 * @ param routeFieldParam Field to Create .
 * @ param multiChoiceValuesParam The available multi choice values .
 * @ return Created Field . */
public Field createFieldMultiChoiceSelectMany ( Field routeFieldParam , List < String > multiChoiceValuesParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( multiChoiceValuesParam == null || multiChoiceValuesParam . isEmpty ( ) ) { throw new FluidClientException ( "No Multi-choice values provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . MultipleChoice ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . MultiChoice . SELECT_MANY ) ; routeFieldParam . setFieldValue ( new MultiChoice ( multiChoiceValuesParam ) ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Date only field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldDateTimeDate ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . DateTime ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . DateTime . DATE ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Date and time field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldDateTimeDateAndTime ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . DateTime ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . DateTime . DATE_AND_TIME ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create a new Decimal field .
 * @ param routeFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldDecimalPlain ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . Decimal . PLAIN ) ; } return new Field ( this . putJson ( routeFieldParam , Version1 . routeFieldCreate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Text field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldTextPlain ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . Text ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . Text . PLAIN ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing True False field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldTrueFalse ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . TrueFalse ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . TrueFalse . TRUE_FALSE ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Paragraph Text field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldParagraphTextPlain ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . ParagraphText ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . ParagraphText . PLAIN ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Paragraph HTML field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldParagraphTextHTML ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . ParagraphText ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . ParagraphText . HTML ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Multi Choice field .
 * @ param routeFieldParam Field to Update .
 * @ param multiChoiceValuesParam New available Multi - choices .
 * @ return Updated Field . */
public Field updateFieldMultiChoicePlain ( Field routeFieldParam , List < String > multiChoiceValuesParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( multiChoiceValuesParam == null || multiChoiceValuesParam . isEmpty ( ) ) { throw new FluidClientException ( "No Multi-choice values provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . MultipleChoice ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . MultiChoice . PLAIN ) ; routeFieldParam . setFieldValue ( new MultiChoice ( multiChoiceValuesParam ) ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Date field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldDateTimeDate ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . DateTime ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . DateTime . DATE ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Date and Time field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldDateTimeDateAndTime ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . DateTime ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . DateTime . DATE_AND_TIME ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing Decimal field .
 * @ param routeFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldDecimalPlain ( Field routeFieldParam ) { } }

implementation: if ( routeFieldParam != null && this . serviceTicket != null ) { routeFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( routeFieldParam != null ) { routeFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; routeFieldParam . setTypeMetaData ( FieldMetaData . Decimal . PLAIN ) ; } return new Field ( this . postJson ( routeFieldParam , Version1 . routeFieldUpdate ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Update an existing ' Route field ' value .
 * @ param routeFieldValueParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldValue ( Field routeFieldValueParam ) { } }

implementation: if ( routeFieldValueParam != null && this . serviceTicket != null ) { routeFieldValueParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( routeFieldValueParam , Version1 . routeFieldUpdateValue ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Create an new ' Route field ' value .
 * @ param routeFieldValueToCreateParam Field to Create .
 * @ param fluidItemParam Fluid item to create field for .
 * @ return Created Field . */
public Field createFieldValue ( Field routeFieldValueToCreateParam , FluidItem fluidItemParam ) { } }

implementation: if ( routeFieldValueToCreateParam != null && this . serviceTicket != null ) { routeFieldValueToCreateParam . setServiceTicket ( this . serviceTicket ) ; } Long fluidItmId = ( fluidItemParam == null ) ? null : fluidItemParam . getId ( ) ; return new Field ( this . putJson ( routeFieldValueToCreateParam , Version1 . routeFieldCreateValue ( fluidItmId ) ) ) ;


signature:
public class RouteFieldClient { /** * Retrieves field information by { @ code fieldIdParam } .
 * @ param fieldIdParam The field Primary Key .
 * @ return Field Definition by primary key . */
public Field getFieldById ( Long fieldIdParam ) { } }

implementation:
Field field = new Field ( fieldIdParam ) ; // Set for Payara server . . .
field . setFieldValue ( new MultiChoice ( ) ) ; if ( this . serviceTicket != null ) { field . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( field , Version1 . getById ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Retrieve the Route field values for { @ code fluidItemParam } .
 * If the id is not set , the { @ code Form } id must be set .
 * @ param fluidItemParam The fluid item to get route fields for .
 * @ return Route Fields by the FluidItem { @ code fluidItemParam } .
 * @ see RouteFieldListing
 * @ see Field */
public List < Field > getRouteFieldValuesBy ( FluidItem fluidItemParam ) { } }

implementation: if ( this . serviceTicket != null && fluidItemParam != null ) { fluidItemParam . setServiceTicket ( this . serviceTicket ) ; } return new RouteFieldListing ( this . postJson ( fluidItemParam , Version1 . getValuesBy ( ) ) ) . getListing ( ) ;


signature:
public class RouteFieldClient { /** * Deletes a field from Fluid .
 * @ param fieldParam The field to delete . Important that Id is set .
 * @ return Deleted Field . */
public Field deleteField ( Field fieldParam ) { } }

implementation: if ( fieldParam != null && this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( fieldParam , Version1 . routeFieldDelete ( ) ) ) ;


signature:
public class RouteFieldClient { /** * Forcefully Deletes a field from Fluid .
 * Only ' admin ' is allowed to make this call .
 * @ param fieldParam The field to delete . Important that Id is set .
 * @ return Deleted Field . */
public Field forceDeleteField ( Field fieldParam ) { } }

implementation: if ( fieldParam != null && this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( fieldParam , Version1 . routeFieldDelete ( true ) ) ) ;


signature:
public class ABaseFluidElasticSearchJSONObject { /** * Convert the { @ code SQLFormFieldUtil . FormFieldMapping } to { @ code Field } .
 * @ param formFieldMappingsParam The { @ code formFieldMappingsParam } to convert .
 * @ return The converted { @ code Field } s . */
@ XmlTransient public List < Field > convertTo ( List < SQLFormFieldUtil . FormFieldMapping > formFieldMappingsParam ) { } }

implementation: if ( formFieldMappingsParam == null ) { return null ; } List < Field > returnVal = new ArrayList ( ) ; for ( SQLFormFieldUtil . FormFieldMapping mappingToConvert : formFieldMappingsParam ) { returnVal . add ( this . convertTo ( mappingToConvert ) ) ; } return returnVal ;


signature:
public class ABaseFluidElasticSearchJSONObject { /** * Utility method to convert from a { @ code SQLFormFieldUtil . FormFieldMapping } to a { @ code Field } .
 * @ param formFieldMappingParam The { @ code SQLFormFieldUtil . FormFieldMapping } to convert .
 * @ return Converted { @ code Field } from { @ code SQLFormFieldUtil . FormFieldMapping } . */
@ XmlTransient public Field convertTo ( SQLFormFieldUtil . FormFieldMapping formFieldMappingParam ) { } }

implementation:
switch ( formFieldMappingParam . dataType . intValue ( ) ) { // Text . . .
case UtilGlobal . FieldTypeId . _1_TEXT : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . Text ) ; // True False . . .
case UtilGlobal . FieldTypeId . _2_TRUE_FALSE : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . TrueFalse ) ; // Paragraph Text . . .
case UtilGlobal . FieldTypeId . _3_PARAGRAPH_TEXT : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . ParagraphText ) ; // Multiple Choice . . .
case UtilGlobal . FieldTypeId . _4_MULTI_CHOICE : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . MultipleChoice ) ; // Date Time . . .
case UtilGlobal . FieldTypeId . _5_DATE_TIME : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . DateTime ) ; // Decimal . . .
case UtilGlobal . FieldTypeId . _6_DECIMAL : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . Decimal ) ; // Table Field . . .
case UtilGlobal . FieldTypeId . _7_TABLE_FIELD : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , null , Field . Type . Table ) ; // TODO _ _ 8 _ _ encrypted field . . .
// Label . . .
case UtilGlobal . FieldTypeId . _9_LABEL : return new Field ( formFieldMappingParam . formFieldId , formFieldMappingParam . name , formFieldMappingParam . description , Field . Type . Label ) ; default : throw new IllegalStateException ( "Unable to map '" + formFieldMappingParam . dataType . intValue ( ) + "', to Form Field value." ) ; }


signature:
public class ConfigurationClient { /** * Retrieves a Configuration by Key .
 * @ param configurationKeyParam The Flow key .
 * @ return The Configuration . */
public Configuration getConfigurationByKey ( String configurationKeyParam ) { } }

implementation: Configuration configuration = new Configuration ( ) ; configuration . setKey ( configurationKeyParam ) ; if ( this . serviceTicket != null ) { configuration . setServiceTicket ( this . serviceTicket ) ; } return new Configuration ( this . postJson ( configuration , WS . Path . Configuration . Version1 . getByKey ( ) ) ) ;


signature:
public class ConfigurationClient { /** * Retrieves all Configurations .
 * @ return All the Configurations . */
public ConfigurationListing getAllConfigurations ( ) { } }

implementation: Configuration configuration = new Configuration ( ) ; if ( this . serviceTicket != null ) { configuration . setServiceTicket ( this . serviceTicket ) ; } return new ConfigurationListing ( this . postJson ( configuration , WS . Path . Configuration . Version1 . getAllConfigurations ( ) ) ) ;


signature:
public class LicenseRequest { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code LicenseRequest }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Machine Name . . .
if ( this . getMachineName ( ) != null ) { returnVal . put ( JSONMapping . MACHINE_NAME , this . getMachineName ( ) ) ; } // Cipher Text . . .
if ( this . getLicenseCipherText ( ) != null ) { returnVal . put ( JSONMapping . LICENSE_CIPHER_TEXT , this . getLicenseCipherText ( ) ) ; } // License Type . . .
if ( this . getLicenseType ( ) != null ) { returnVal . put ( JSONMapping . LICENSE_TYPE , this . getLicenseType ( ) ) ; } // User Count . . .
if ( this . getUserCount ( ) != null ) { returnVal . put ( JSONMapping . USER_COUNT , this . getUserCount ( ) ) ; } // Date Valid From . . .
if ( this . getDateValidFrom ( ) != null ) { returnVal . put ( JSONMapping . DATE_VALID_FROM , this . getDateAsLongFromJson ( this . getDateValidFrom ( ) ) ) ; } // Date Valid To . . .
if ( this . getDateValidTo ( ) != null ) { returnVal . put ( JSONMapping . DATE_VALID_TO , this . getDateAsLongFromJson ( this . getDateValidTo ( ) ) ) ; } return returnVal ;


signature:
public class WebSocketFormContainerCreateClient { /** * Creates a new ( Form ) for the { @ code formToCreateParam } .
 * @ param formToCreateParam The Fluid Form to create .
 * @ return The { @ code formToCreateParam } created as { @ code Form } . */
public Form createFormContainerSynchronized ( Form formToCreateParam ) { } }

implementation:
if ( formToCreateParam == null ) { return null ; } // Send all the messages . . .
if ( formToCreateParam . getEcho ( ) == null || formToCreateParam . getEcho ( ) . trim ( ) . isEmpty ( ) ) { formToCreateParam . setEcho ( UUID . randomUUID ( ) . toString ( ) ) ; } // Start a new request . . .
String uniqueReqId = this . initNewRequest ( ) ; // Send the actual message . . .
this . sendMessage ( formToCreateParam , uniqueReqId ) ; try { List < Form > returnValue = this . getHandler ( uniqueReqId ) . getCF ( ) . get ( this . getTimeoutInMillis ( ) , TimeUnit . MILLISECONDS ) ; // Connection was closed . . this is a problem . . . .
if ( this . getHandler ( uniqueReqId ) . isConnectionClosed ( ) ) { throw new FluidClientException ( "WebSocket-CreateFormContainer: " + "The connection was closed by the server prior to the response received." , FluidClientException . ErrorCode . IO_ERROR ) ; } if ( returnValue == null || returnValue . isEmpty ( ) ) { return null ; } return returnValue . get ( 0 ) ; } // Interrupted . . .
catch ( InterruptedException exceptParam ) { throw new FluidClientException ( "WebSocket-Interrupted-CreateFormContainer: " + exceptParam . getMessage ( ) , exceptParam , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } // Error on the web - socket . . .
catch ( ExecutionException executeProblem ) { Throwable cause = executeProblem . getCause ( ) ; // Fluid client exception . . .
if ( cause instanceof FluidClientException ) { throw ( FluidClientException ) cause ; } else { throw new FluidClientException ( "WebSocket-CreateFormContainer: " + cause . getMessage ( ) , cause , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } } // Timeout . . .
catch ( TimeoutException eParam ) { throw new FluidClientException ( "WebSocket-CreateFormContainer: Timeout while waiting for all return data. There were '" + this . getHandler ( uniqueReqId ) . getReturnValue ( ) . size ( ) + "' items after a Timeout of " + ( TimeUnit . MILLISECONDS . toSeconds ( this . getTimeoutInMillis ( ) ) ) + " seconds." , FluidClientException . ErrorCode . IO_ERROR ) ; } finally { this . removeHandler ( uniqueReqId ) ; }


signature:
public class Connection { /** * Gets a comma seperated list of providers from { @ code Identity } ' s .
 * @ return Text list of Providers for user { @ code Identities } .
 * @ see NormalizedUserProfile # getIdentities ( ) */
public String getListOfProvidersFromIdentities ( ) { } }

implementation: if ( this . getIdentities ( ) == null || this . getIdentities ( ) . isEmpty ( ) ) { return "" ; } StringBuilder returnVal = new StringBuilder ( ) ; for ( Client client : this . getIdentities ( ) ) { returnVal . append ( client . getProvider ( ) ) ; returnVal . append ( "," ) ; } String toString = returnVal . toString ( ) ; return toString . substring ( 0 , toString . length ( ) - 1 ) ;


signature:
public class AttachmentClient { /** * Uploads a new Attachment .
 * If there is an existing attachment with the same name , a new version will be
 * uploaded .
 * @ param attachmentParam The attachment to upload .
 * @ return The created attachment .
 * @ see Attachment */
public Attachment createAttachment ( Attachment attachmentParam ) { } }

implementation: if ( attachmentParam != null && this . serviceTicket != null ) { attachmentParam . setServiceTicket ( this . serviceTicket ) ; } return new Attachment ( this . putJson ( attachmentParam , WS . Path . Attachment . Version1 . attachmentCreate ( ) ) ) ;


signature:
public class AttachmentClient { /** * Retrieves a Attachment by Primary Key .
 * @ param attachmentIdParam The Attachment primary key .
 * @ param includeAttachmentDataParam Include the attachment data ( Base - 64 ) .
 * @ return The Attachment associated with { @ code attachmentIdParam } . */
public Attachment getAttachmentById ( Long attachmentIdParam , boolean includeAttachmentDataParam ) { } }

implementation: Attachment attachment = new Attachment ( attachmentIdParam ) ; if ( this . serviceTicket != null ) { attachment . setServiceTicket ( this . serviceTicket ) ; } return new Attachment ( this . postJson ( attachment , WS . Path . Attachment . Version1 . getById ( includeAttachmentDataParam ) ) ) ;


signature:
public class AttachmentClient { /** * Retrieves all the Attachments associated with Form { @ code formParam } .
 * @ param formParam The Form to use for lookup .
 * @ param includeAttachmentDataParam Include the attachment data ( Base - 64 ) .
 * @ return The Attachments associated with { @ code formParam } . */
public List < Attachment > getAttachmentsByForm ( Form formParam , boolean includeAttachmentDataParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } AttachmentListing returnedListing = new AttachmentListing ( postJson ( formParam , WS . Path . Attachment . Version1 . getAllByFormContainer ( includeAttachmentDataParam , false ) ) ) ; return ( returnedListing == null ) ? null : returnedListing . getListing ( ) ;


signature:
public class AttachmentClient { /** * Delete an existing Attachment .
 * @ param attachmentParam The Attachment to delete .
 * @ return The deleted Attachment . */
public Attachment deleteAttachment ( Attachment attachmentParam ) { } }

implementation: if ( attachmentParam != null && this . serviceTicket != null ) { attachmentParam . setServiceTicket ( this . serviceTicket ) ; } return new Attachment ( this . postJson ( attachmentParam , WS . Path . Attachment . Version1 . attachmentDelete ( ) ) ) ;


signature:
public class AttachmentClient { /** * Forcefully Delete an existing Attachment .
 * Only ' admin ' can forcefully delete a Attachment .
 * @ param attachmentParam The Attachment to delete .
 * @ return The deleted Attachment . */
public Attachment forceDeleteAttachment ( Attachment attachmentParam ) { } }

implementation: if ( attachmentParam != null && this . serviceTicket != null ) { attachmentParam . setServiceTicket ( this . serviceTicket ) ; } return new Attachment ( this . postJson ( attachmentParam , WS . Path . Attachment . Version1 . attachmentDelete ( true ) ) ) ;


signature:
public class XsdStringRestrictions { /** * Compares two different objects of this type .
 * @ param o1 The first object .
 * @ param o2 The object to compare .
 * @ return True if the value of both classes is different , False if the value is equal . */
public static boolean hasDifferentValue ( XsdStringRestrictions o1 , XsdStringRestrictions o2 ) { } }

implementation: if ( o1 == null && o2 == null ) { return false ; } String o1Value = null ; String o2Value ; if ( o1 != null ) { o1Value = o1 . getValue ( ) ; } if ( o2 != null ) { o2Value = o2 . getValue ( ) ; return o2Value . equals ( o1Value ) ; } return false ;


signature:
public class AttributesVisitor { /** * Tries to match the received { @ link NamedConcreteElement } object , with any of the elements present either in
 * { @ link AttributesVisitor # attributeGroups } or { @ link AttributesVisitor # attributes } . If a match occurs this method
 * performs all the required actions to fully exchange the { @ link UnsolvedReference } object with the element parameter .
 * @ param element The resolved element that will be match with the contents of this visitor in order to assert if
 * there is anything to replace . */
public void replaceUnsolvedAttributes ( NamedConcreteElement element ) { } }

implementation: if ( element . getElement ( ) instanceof XsdAttributeGroup ) { attributeGroups . stream ( ) . filter ( attributeGroup -> attributeGroup instanceof UnsolvedReference && ( ( UnsolvedReference ) attributeGroup ) . getRef ( ) . equals ( element . getName ( ) ) ) . findFirst ( ) . ifPresent ( referenceBase -> { attributeGroups . remove ( referenceBase ) ; attributeGroups . add ( element ) ; attributes . addAll ( element . getElement ( ) . getElements ( ) ) ; element . getElement ( ) . setParent ( getOwner ( ) ) ; } ) ; } if ( element . getElement ( ) instanceof XsdAttribute ) { attributes . stream ( ) . filter ( attribute -> attribute instanceof UnsolvedReference && ( ( UnsolvedReference ) attribute ) . getRef ( ) . equals ( element . getName ( ) ) ) . findFirst ( ) . ifPresent ( referenceBase -> { attributes . remove ( referenceBase ) ; attributes . add ( element ) ; element . getElement ( ) . setParent ( getOwner ( ) ) ; } ) ; }


signature:
public class XsdMultipleElements { /** * Replaces possible { @ link UnsolvedReference } objects in the { @ link XsdMultipleElements # elements } if any of their
 * { @ link UnsolvedReference # ref } field matches the { @ link NamedConcreteElement # name } field .
 * @ param elementWrapper A { @ link NamedConcreteElement } with a name that will replace an { @ link UnsolvedReference }
 * object , if a match between the { @ link NamedConcreteElement # name } attribute and the
 * { @ link UnsolvedReference # ref } attribute . */
@ Override public void replaceUnsolvedElements ( NamedConcreteElement elementWrapper ) { } }

implementation: if ( elementWrapper . getElement ( ) instanceof XsdElement ) { super . replaceUnsolvedElements ( elementWrapper ) ; } if ( elementWrapper . getElement ( ) instanceof XsdGroup ) { elements . add ( elementWrapper ) ; this . elements . removeIf ( element -> element instanceof UnsolvedReference && ( ( UnsolvedReference ) element ) . getRef ( ) . equals ( elementWrapper . getName ( ) ) ) ; }


signature:
public class XsdParserJar { /** * Parses the XSD file represented by the received InputStream .
 * @ param inputStream The inputStream of the XSD file . */
private void parseJarFile ( InputStream inputStream ) { } }

implementation:
// https : / / www . mkyong . com / java / how - to - read - xml - file - in - java - dom - parser /
try { Node schemaNode = getSchemaNode ( inputStream ) ; if ( isXsdSchema ( schemaNode ) ) { XsdSchema . parse ( this , schemaNode ) ; } else { throw new ParsingException ( "The top level element of a XSD file should be the xsd:schema node." ) ; } } catch ( SAXException | IOException | ParserConfigurationException e ) { Logger . getAnonymousLogger ( ) . log ( Level . SEVERE , "Exception while parsing." , e ) ; }


signature:
public class XsdParserJar { /** * Creates a new class loader , replacing the current one , having another path added to the classpath . The new
 * path is the path to the jar received in this class constructor .
 * @ param jarPath The path of the jar file . */
private void setClassLoader ( String jarPath ) { } }

implementation:
if ( ! jarPath . endsWith ( ".jar" ) ) { throw new ParsingException ( "The jarPath received doesn't represent a jar file." ) ; } ClassLoader originalCl = Thread . currentThread ( ) . getContextClassLoader ( ) ; URL url = originalCl . getResource ( jarPath ) ; if ( url == null ) { try { url = new URL ( "file:/" + jarPath ) ; } catch ( MalformedURLException e ) { throw new ParsingException ( "Invalid jar name." ) ; } } // Create class loader using given codebase
// Use prevCl as parent to maintain current visibility
ClassLoader urlCl = URLClassLoader . newInstance ( new URL [ ] { url } , originalCl ) ; Thread . currentThread ( ) . setContextClassLoader ( urlCl ) ; classLoader = urlCl ;


signature:
public class XsdAnnotationChildren { /** * This method is used to parse { @ link XsdAnnotationChildren } instances .
 * @ param node The node containing the information to parse .
 * @ param annotationChildren An instance of { @ link XsdAnnotationChildren } ( either { @ link XsdAppInfo } or
 * { @ link XsdDocumentation } ) .
 * @ return The annotationChildren wrapped in the correct { @ link ReferenceBase } wrapper . */
static ReferenceBase xsdAnnotationChildrenParse ( Node node , XsdAnnotationChildren annotationChildren ) { } }

implementation: annotationChildren . content = xsdRawContentParse ( node ) ; return ReferenceBase . createFromXsd ( annotationChildren ) ;


signature:
public class XsdParserCore { /** * Verifies if a given { @ link Node } object , i . e . { @ code node } is a xsd : schema node .
 * @ param node The node to verify .
 * @ return True if the node is a xsd : schema or xs : schema . False otherwise . */
boolean isXsdSchema ( Node node ) { } }

implementation: String schemaNodeName = node . getNodeName ( ) ; return schemaNodeName . equals ( XsdSchema . XSD_TAG ) || schemaNodeName . equals ( XsdSchema . XS_TAG ) ;


signature:
public class XsdParserCore { /** * This method resolves all the remaining { @ link UnsolvedReference } objects present after all the elements are parsed .
 * It starts by iterating all { @ link XsdParser # parseElements } and inserting all the parsed elements with a name
 * attribute in the concreteElementsMap variable . After that it iterates on the { @ link XsdParser # unsolvedElements }
 * list in order to find if any of the unsolvedReferences can be solved by replacing the unsolvedElement by its
 * matching { @ link NamedConcreteElement } object , present in the concreteElementsMap . The { @ link UnsolvedReference }
 * objects matches a { @ link NamedConcreteElement } object by having its ref attribute with the same value as the
 * name attribute of the { @ link NamedConcreteElement } . */
void resolveRefs ( ) { } }

implementation: Map < String , List < NamedConcreteElement > > concreteElementsMap = parseElements . stream ( ) . filter ( concreteElement -> concreteElement instanceof NamedConcreteElement ) . map ( concreteElement -> ( NamedConcreteElement ) concreteElement ) . collect ( groupingBy ( NamedConcreteElement :: getName ) ) ; unsolvedElements . forEach ( unsolvedElement -> replaceUnsolvedReference ( concreteElementsMap , unsolvedElement ) ) ;


signature:
public class XsdParserCore { /** * Replaces a single { @ link UnsolvedReference } object , with the respective { @ link NamedConcreteElement } object . If
 * there isn ' t a { @ link NamedConcreteElement } object to replace the { @ link UnsolvedReference } object , information
 * is stored informing the user of this Project of the occurrence .
 * @ param concreteElementsMap The map containing all named concreteElements .
 * @ param unsolvedReference The unsolved reference to solve . */
private void replaceUnsolvedReference ( Map < String , List < NamedConcreteElement > > concreteElementsMap , UnsolvedReference unsolvedReference ) { } }

implementation: List < NamedConcreteElement > concreteElements = concreteElementsMap . get ( unsolvedReference . getRef ( ) ) ; if ( concreteElements != null ) { Map < String , String > oldElementAttributes = unsolvedReference . getElement ( ) . getAttributesMap ( ) ; for ( NamedConcreteElement concreteElement : concreteElements ) { NamedConcreteElement substitutionElementWrapper ; if ( ! unsolvedReference . isTypeRef ( ) ) { XsdNamedElements substitutionElement = concreteElement . getElement ( ) . clone ( oldElementAttributes ) ; substitutionElementWrapper = ( NamedConcreteElement ) ReferenceBase . createFromXsd ( substitutionElement ) ; } else { substitutionElementWrapper = concreteElement ; } unsolvedReference . getParent ( ) . replaceUnsolvedElements ( substitutionElementWrapper ) ; } } else { storeUnsolvedItem ( unsolvedReference ) ; }


signature:
public class XsdParserCore { /** * Saves an occurrence of an element which couldn ' t be resolved in the { @ link XsdParser # replaceUnsolvedReference }
 * method , which can be accessed at the end of the parsing process in order to verify if were there were any
 * references that couldn ' t be solved .
 * @ param unsolvedReference The unsolved reference which couldn ' t be resolved . */
private void storeUnsolvedItem ( UnsolvedReference unsolvedReference ) { } }

implementation: if ( parserUnsolvedElementsMap . isEmpty ( ) ) { parserUnsolvedElementsMap . add ( new UnsolvedReferenceItem ( unsolvedReference ) ) ; } else { Optional < UnsolvedReferenceItem > innerEntry = parserUnsolvedElementsMap . stream ( ) . filter ( unsolvedReferenceObj -> unsolvedReferenceObj . getUnsolvedReference ( ) . getRef ( ) . equals ( unsolvedReference . getRef ( ) ) ) . findFirst ( ) ; if ( innerEntry . isPresent ( ) ) { innerEntry . ifPresent ( entry -> entry . getParents ( ) . add ( unsolvedReference . getParent ( ) ) ) ; } else { parserUnsolvedElementsMap . add ( new UnsolvedReferenceItem ( unsolvedReference ) ) ; } }


signature:
public class XsdParserCore { /** * Adds a new file to the parsing queue . This new file appears by having xsd : import or xsd : include tags in the
 * original file to parse .
 * @ param schemaLocation A new file path of another XSD file to parse . */
public void addFileToParse ( String schemaLocation ) { } }

implementation: if ( ! schemaLocations . contains ( schemaLocation ) && schemaLocation . endsWith ( ".xsd" ) ) { schemaLocations . add ( schemaLocation ) ; }


signature:
public class XsdGroup { /** * Asserts if the current object has the name attribute when not being a direct child of the XsdSchema element , which is
 * not allowed , throwing an exception in that case . */
private void rule2 ( ) { } }

implementation: if ( ! ( parent instanceof XsdSchema ) && name != null ) { throw new ParsingException ( XSD_TAG + " element: The " + NAME_TAG + " should only be used when the parent of the " + XSD_TAG + " is the " + XsdSchema . XSD_TAG + " element." ) ; }


signature:
public class XsdGroup { /** * Asserts if the current has no value for its name attribute while being a direct child of the top level XsdSchema element ,
 * which is required . Throws an exception if no name is present . */
private void rule3 ( ) { } }

implementation: if ( parent instanceof XsdSchema && name == null ) { throw new ParsingException ( XSD_TAG + " element: The " + NAME_TAG + " should is required the parent of the " + XSD_TAG + " is the " + XsdSchema . XSD_TAG + " element." ) ; }


signature:
public class XsdDoubleRestrictions { /** * Compares two different objects of this type .
 * @ param o1 The first object .
 * @ param o2 The object to compare .
 * @ return True if the value of both classes is different , False if the value is equal . */
public static boolean hasDifferentValue ( XsdDoubleRestrictions o1 , XsdDoubleRestrictions o2 ) { } }

implementation: if ( o1 == null && o2 == null ) { return false ; } double o1Value = Double . MAX_VALUE ; double o2Value ; if ( o1 != null ) { o1Value = o1 . getValue ( ) ; } if ( o2 != null ) { o2Value = o2 . getValue ( ) ; return o2Value == o1Value ; } return false ;


signature:
public class XsdSimpleType { /** * This method obtains all the restrictions for the current { @ link XsdSimpleType } element . It also joins multiple
 * restrictions with the same base attribute in the same { @ link XsdRestriction } object , if a overlap doesn ' t occur .
 * In case of restriction overlap an exception is thrown because the information on the xsd file is contradictory .
 * @ return A list of restrictions . */
public List < XsdRestriction > getAllRestrictions ( ) { } }

implementation: Map < String , XsdRestriction > restrictions = new HashMap < > ( ) ; Map < String , String > xsdBuiltinTypes = XsdParserCore . getXsdTypesToJava ( ) ; if ( restriction != null ) { restrictions . put ( xsdBuiltinTypes . get ( restriction . getBase ( ) ) , restriction ) ; } if ( union != null ) { union . getUnionElements ( ) . forEach ( unionMember -> { XsdRestriction unionMemberRestriction = unionMember . getRestriction ( ) ; if ( unionMemberRestriction != null ) { XsdRestriction existingRestriction = restrictions . getOrDefault ( xsdBuiltinTypes . get ( unionMemberRestriction . getBase ( ) ) , null ) ; if ( existingRestriction != null ) { if ( existsRestrictionOverlap ( existingRestriction , unionMemberRestriction ) ) { throw new InvalidParameterException ( "The xsd file is invalid because has contradictory restrictions." ) ; } updateExistingRestriction ( existingRestriction , unionMemberRestriction ) ; } else { restrictions . put ( xsdBuiltinTypes . get ( unionMemberRestriction . getBase ( ) ) , unionMemberRestriction ) ; } } } ) ; } return new ArrayList < > ( restrictions . values ( ) ) ;


signature:
public class XsdSimpleType { /** * Joins two distinct { @ link XsdRestriction } instances . This method assumes that the information of both
 * { @ link XsdRestriction } objects don ' t have overlapping or contradictory information .
 * @ param existing The existing restriction .
 * @ param newRestriction The new restriction . */
private void updateExistingRestriction ( XsdRestriction existing , XsdRestriction newRestriction ) { } }

implementation: XsdPattern pattern = newRestriction . getPattern ( ) ; XsdMaxExclusive maxExclusive = newRestriction . getMaxExclusive ( ) ; XsdMaxInclusive maxInclusive = newRestriction . getMaxInclusive ( ) ; XsdMaxLength maxLength = newRestriction . getMaxLength ( ) ; XsdMinExclusive minExclusive = newRestriction . getMinExclusive ( ) ; XsdMinInclusive minInclusive = newRestriction . getMinInclusive ( ) ; XsdMinLength minLength = newRestriction . getMinLength ( ) ; XsdLength length = newRestriction . getLength ( ) ; XsdFractionDigits fractionDigits = newRestriction . getFractionDigits ( ) ; XsdTotalDigits totalDigits = newRestriction . getTotalDigits ( ) ; XsdWhiteSpace whiteSpace = newRestriction . getWhiteSpace ( ) ; if ( pattern != null ) { existing . setPattern ( pattern ) ; } if ( maxExclusive != null ) { existing . setMaxExclusive ( maxExclusive ) ; } if ( maxInclusive != null ) { existing . setMaxInclusive ( maxInclusive ) ; } if ( maxLength != null ) { existing . setMaxLength ( maxLength ) ; } if ( minExclusive != null ) { existing . setMinExclusive ( minExclusive ) ; } if ( minInclusive != null ) { existing . setMinInclusive ( minInclusive ) ; } if ( minLength != null ) { existing . setMinLength ( minLength ) ; } if ( length != null ) { existing . setLength ( length ) ; } if ( fractionDigits != null ) { existing . setFractionDigits ( fractionDigits ) ; } if ( totalDigits != null ) { existing . setTotalDigits ( totalDigits ) ; } if ( whiteSpace != null ) { existing . setWhiteSpace ( whiteSpace ) ; } updateExistingRestrictionEnumerations ( existing , newRestriction ) ;


signature:
public class XsdSimpleType { /** * Updates the existing { @ link XsdRestriction } with the restrictions of the new { @ link XsdRestriction } instance .
 * @ param existing The existing { @ link XsdRestriction } instance .
 * @ param newRestriction The new { @ link XsdRestriction } instance . */
private void updateExistingRestrictionEnumerations ( XsdRestriction existing , XsdRestriction newRestriction ) { } }

implementation: List < XsdEnumeration > existingEnumeration = existing . getEnumeration ( ) ; List < XsdEnumeration > newRestrictionEnumeration = newRestriction . getEnumeration ( ) ; if ( existingEnumeration == null ) { existing . setEnumeration ( newRestrictionEnumeration ) ; } else { if ( newRestrictionEnumeration != null ) { for ( XsdEnumeration enumerationElem : newRestrictionEnumeration ) { if ( existingEnumeration . stream ( ) . noneMatch ( existingEnumerationElem -> existingEnumerationElem . getValue ( ) . equals ( enumerationElem . getValue ( ) ) ) ) { existingEnumeration . add ( enumerationElem ) ; } } } }


signature:
public class XsdSimpleType { /** * Checks for any restriction overlap between two different { @ link XsdRestriction } instances .
 * @ param existing The existing restriction .
 * @ param newRestriction The second restriction found .
 * @ return True if an overlap between the restrictions occur , false if it doesn ' t occur . */
private boolean existsRestrictionOverlap ( XsdRestriction existing , XsdRestriction newRestriction ) { } }

implementation: return hasDifferentValue ( existing . getPattern ( ) , newRestriction . getPattern ( ) ) || hasDifferentValue ( existing . getWhiteSpace ( ) , newRestriction . getWhiteSpace ( ) ) || hasDifferentValue ( existing . getTotalDigits ( ) , newRestriction . getTotalDigits ( ) ) || hasDifferentValue ( existing . getFractionDigits ( ) , newRestriction . getFractionDigits ( ) ) || hasDifferentValue ( existing . getMaxExclusive ( ) , newRestriction . getMaxExclusive ( ) ) || hasDifferentValue ( existing . getMaxInclusive ( ) , newRestriction . getMaxInclusive ( ) ) || hasDifferentValue ( existing . getMaxLength ( ) , newRestriction . getMaxLength ( ) ) || hasDifferentValue ( existing . getMinExclusive ( ) , newRestriction . getMinExclusive ( ) ) || hasDifferentValue ( existing . getMinInclusive ( ) , newRestriction . getMinInclusive ( ) ) || hasDifferentValue ( existing . getMinLength ( ) , newRestriction . getMinLength ( ) ) || hasDifferentValue ( existing . getLength ( ) , newRestriction . getLength ( ) ) ;


signature:
public class XsdAttribute { /** * Asserts if the current object has a ref attribute at the same time as either a simpleType as children , a form attribute or a type attribute .
 * Throws an exception in that case . */
private void rule3 ( ) { } }

implementation: if ( attributesMap . containsKey ( REF_TAG ) && ( simpleType != null || form != null || type != null ) ) { throw new ParsingException ( XSD_TAG + " element: If " + REF_TAG + " attribute is present, simpleType element, form attribute and type attribute cannot be present at the same time." ) ; }


signature:
public class XsdAttribute { /** * Receives a { @ link NamedConcreteElement } that should be the one requested earlier .
 * * In the { @ link XsdAttribute } constructor :
 * this . simpleType = new UnsolvedReference ( type , placeHolder ) ;
 * XsdParser . getInstance ( ) . addUnsolvedReference ( ( UnsolvedReference ) this . simpleType ) ;
 * This implies that the object being received is the object that is being referred with the { @ link XsdAttribute # type }
 * String .
 * @ param elementWrapper The object that should be wrapping the requested { @ link XsdSimpleType } object . */
@ Override public void replaceUnsolvedElements ( NamedConcreteElement elementWrapper ) { } }

implementation: super . replaceUnsolvedElements ( elementWrapper ) ; XsdAbstractElement element = elementWrapper . getElement ( ) ; if ( element instanceof XsdSimpleType && simpleType != null && type . equals ( elementWrapper . getName ( ) ) ) { this . simpleType = elementWrapper ; }


signature:
public class XsdParser { /** * Parses a XSD file and all its containing XSD elements . This code iterates on the nodes and parses the supported
 * ones . The supported types are all the XSD types that have their tag present in the { @ link XsdParser # parseMappers }
 * field .
 * @ param filePath The path to the XSD file . */
private void parseFile ( String filePath ) { } }

implementation:
// https : / / www . mkyong . com / java / how - to - read - xml - file - in - java - dom - parser /
try { if ( ! new File ( filePath ) . exists ( ) ) { throw new FileNotFoundException ( ) ; } Node schemaNode = getSchemaNode ( filePath ) ; if ( isXsdSchema ( schemaNode ) ) { XsdSchema . parse ( this , schemaNode ) ; } else { throw new ParsingException ( "The top level element of a XSD file should be the xsd:schema node." ) ; } } catch ( SAXException | IOException | ParserConfigurationException e ) { Logger . getAnonymousLogger ( ) . log ( Level . SEVERE , "Exception while parsing." , e ) ; }


signature:
public class XsdParser { /** * This function uses DOM to obtain a list of nodes from a XSD file .
 * @ param filePath The path to the XSD file .
 * @ throws IOException If the file parsing throws { @ link IOException } .
 * @ throws SAXException if the file parsing throws { @ link SAXException } .
 * @ throws ParserConfigurationException If the { @ link DocumentBuilderFactory # newDocumentBuilder ( ) } throws
 * { @ link ParserConfigurationException } .
 * @ return A list of nodes that represent the node tree of the XSD file with the path received . */
private Node getSchemaNode ( String filePath ) throws IOException , SAXException , ParserConfigurationException { } }

implementation: Document doc = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) . parse ( filePath ) ; doc . getDocumentElement ( ) . normalize ( ) ; return doc . getFirstChild ( ) ;


signature:
public class XsdElement { /** * Asserts if the current object has a form attribute while being a direct child of the top level XsdSchema element ,
 * which isn ' t allowed , throwing an exception in that case . */
private void rule7 ( ) { } }

implementation: if ( parent instanceof XsdSchema && attributesMap . containsKey ( FORM_TAG ) ) { throw new ParsingException ( XSD_TAG + " element: The " + FORM_TAG + " attribute can only be present when the parent of the " + xsdElementIsXsdSchema ) ; }


signature:
public class XsdElement { /** * Asserts if the current object has a ref attribute while being a direct child of the top level XsdSchema element , which isn ' t allowed ,
 * throwing an exception in that case . */
private void rule3 ( ) { } }

implementation: if ( parent instanceof XsdSchema && attributesMap . containsKey ( REF_TAG ) ) { throw new ParsingException ( XSD_TAG + " element: The " + REF_TAG + " attribute cannot be present when the parent of the " + xsdElementIsXsdSchema ) ; }


signature:
public class XsdElement { /** * This method aims to replace the previously created { @ link UnsolvedReference } in case that the type of the
 * current { @ link XsdElement } instance is not a built - in type .
 * @ param element A concrete element with a name that will replace the { @ link UnsolvedReference } object created in the
 * { @ link XsdElement } constructor . The { @ link UnsolvedReference } is only replaced if there
 * is a match between the { @ link UnsolvedReference # ref } and the { @ link NamedConcreteElement # name } . */
@ Override public void replaceUnsolvedElements ( NamedConcreteElement element ) { } }

implementation: super . replaceUnsolvedElements ( element ) ; XsdNamedElements elem = element . getElement ( ) ; boolean isComplexOrSimpleType = elem instanceof XsdComplexType || elem instanceof XsdSimpleType ; if ( this . type instanceof UnsolvedReference && isComplexOrSimpleType && ( ( UnsolvedReference ) this . type ) . getRef ( ) . equals ( element . getName ( ) ) ) { this . type = element ; elem . setParent ( this ) ; } if ( this . substitutionGroup instanceof UnsolvedReference && elem instanceof XsdElement && ( ( UnsolvedReference ) this . substitutionGroup ) . getRef ( ) . equals ( element . getName ( ) ) ) { XsdElement xsdElement = ( XsdElement ) elem ; this . type = xsdElement . type ; this . simpleType = xsdElement . simpleType ; this . complexType = xsdElement . complexType ; this . substitutionGroup = element ; elem . setParent ( this ) ; }


signature:
public class XsdAbstractElement { /** * The base code for parsing any { @ link XsdAbstractElement } . All the concrete implementations of this class should
 * call this method in order to parse its children .
 * @ param node The node from where the element will be parsed .
 * @ param element The concrete element that will be populated and returned .
 * @ return A wrapper object that contains the parsed XSD object . */
static ReferenceBase xsdParseSkeleton ( Node node , XsdAbstractElement element ) { } }

implementation: XsdParserCore parser = element . getParser ( ) ; Node child = node . getFirstChild ( ) ; while ( child != null ) { if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { String nodeName = child . getNodeName ( ) ; BiFunction < XsdParserCore , Node , ReferenceBase > parserFunction = XsdParserCore . getParseMappers ( ) . get ( nodeName ) ; if ( parserFunction != null ) { XsdAbstractElement childElement = parserFunction . apply ( parser , child ) . getElement ( ) ; childElement . accept ( element . getVisitor ( ) ) ; childElement . validateSchemaRules ( ) ; } } child = child . getNextSibling ( ) ; } ReferenceBase wrappedElement = ReferenceBase . createFromXsd ( element ) ; parser . addParsedElement ( wrappedElement ) ; return wrappedElement ;


signature:
public class XsdAbstractElement { /** * Converts a { @ link NamedNodeMap } to a { @ link Map } object . This is meant to simplify the manipulation of the
 * information .
 * @ param nodeMap The { @ link NamedNodeMap } to convert to a { @ link Map } object .
 * @ return The { @ link Map } object that was generated by the conversion . */
protected static Map < String , String > convertNodeMap ( NamedNodeMap nodeMap ) { } }

implementation: HashMap < String , String > attributesMapped = new HashMap < > ( ) ; for ( int i = 0 ; i < nodeMap . getLength ( ) ; i ++ ) { Node node = nodeMap . item ( i ) ; attributesMapped . put ( node . getNodeName ( ) , node . getNodeValue ( ) ) ; } return attributesMapped ;


signature:
public class XsdAbstractElement { /** * This method iterates on the current element children and replaces any { @ link UnsolvedReference } object that has a
 * ref attribute that matches the receiving { @ link NamedConcreteElement } name attribute .
 * @ param element A fully parsed element with a name that will replace an { @ link UnsolvedReference } object , if a
 * match between the { @ link NamedConcreteElement } name attribute and the { @ link UnsolvedReference }
 * ref attribute . */
public void replaceUnsolvedElements ( NamedConcreteElement element ) { } }

implementation: List < ReferenceBase > elements = this . getElements ( ) ; if ( elements != null ) { elements . stream ( ) . filter ( referenceBase -> referenceBase instanceof UnsolvedReference ) . map ( referenceBase -> ( UnsolvedReference ) referenceBase ) . filter ( unsolvedReference -> unsolvedReference . getRef ( ) . equals ( element . getName ( ) ) ) . findFirst ( ) . ifPresent ( oldElement -> elements . set ( elements . indexOf ( oldElement ) , element ) ) ; }