Package org.mariuszgromada.math.mxparser
Class License
- java.lang.Object
-
- org.mariuszgromada.math.mxparser.License
-
public class License extends java.lang.ObjectA class that provides commercial and non-commercial use mode registration. The execution of methods in this class does not affect the operation of the MathParser.org-mXparser software, but is required by the terms of the License.geTermsOfAgreement().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classLicense.MessageTypeprivate static classLicense.UseType
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringERROR_NOT_CONFIRMEDprivate static java.lang.StringerrorMessagestatic java.lang.StringMATHPARSERORG_MXPARSER_DUAL_LICENSE_AGREEMENTThe terms of MathParser.org-mXparser DUAL LICENSE AGREEMENTprivate static intMAXIMUM_NUMBER_OF_WARNING_DISPLAYprivate static java.lang.Stringmessageprivate static intnumberOfConfirmationAttemptsprivate static intnumberOfWarningDisplayprivate static java.lang.Stringsignatureprivate static License.UseTypetypeOfUse
-
Constructor Summary
Constructors Constructor Description License()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleancheckIfNoPreviousConfirmationAttempts()private static booleancheckIfProperSignature(java.lang.String providedSignature)static booleancheckIfUseTypeConfirmed()Verifies whether the use type has been successfully confirmed and signed.private static booleancheckLackOfPreviousConfirmation()(package private) static voidcheckLicense()static voidconsolePrintLicense()Prints to the console the terms of MathParser.org-mXparser DUAL LICENSE AGREEMENTprivate static voiddisplayWarning()static java.lang.StringgeTermsOfAgreement()Return the terms of MathParser.org-mXparser DUAL LICENSE AGREEMENT.static java.lang.StringgetErrorMessage()Information about the problem encountered when calling methods: License.iConfirmNonCommercialUse(...), License.iConfirmCommercialUse(...)(package private) static intgetUseType()static java.lang.StringgetUseTypeConfirmationMessage()Verifies whether the use type has been successfully confirmed and signed.static booleaniConfirmCommercialUse(java.lang.String mySignature)By successfully calling this method, you confirm and sign that you use MathParser.org-mXparser commercially according to the License.geTermsOfAgreement().static booleaniConfirmNonCommercialUse(java.lang.String mySignature)By successfully calling this method, you confirm and sign that you use MathParser.org-mXparser non-commercially according to the License.geTermsOfAgreement().private static voidsetErrorMessage(License.MessageType type, java.lang.String errorMessage)private static voidsetMessageConfirmedCommercial()private static voidsetMessageConfirmedNonCommercial()
-
-
-
Field Detail
-
typeOfUse
private static License.UseType typeOfUse
-
signature
private static java.lang.String signature
-
numberOfConfirmationAttempts
private static int numberOfConfirmationAttempts
-
message
private static java.lang.String message
-
errorMessage
private static java.lang.String errorMessage
-
ERROR_NOT_CONFIRMED
private static final java.lang.String ERROR_NOT_CONFIRMED
- See Also:
- Constant Field Values
-
MAXIMUM_NUMBER_OF_WARNING_DISPLAY
private static final int MAXIMUM_NUMBER_OF_WARNING_DISPLAY
- See Also:
- Constant Field Values
-
numberOfWarningDisplay
private static int numberOfWarningDisplay
-
MATHPARSERORG_MXPARSER_DUAL_LICENSE_AGREEMENT
public static final java.lang.String MATHPARSERORG_MXPARSER_DUAL_LICENSE_AGREEMENT
The terms of MathParser.org-mXparser DUAL LICENSE AGREEMENT- See Also:
- Constant Field Values
-
-
Method Detail
-
displayWarning
private static void displayWarning()
-
checkLicense
static void checkLicense()
-
getUseType
static int getUseType()
-
setErrorMessage
private static void setErrorMessage(License.MessageType type, java.lang.String errorMessage)
-
setMessageConfirmedCommercial
private static void setMessageConfirmedCommercial()
-
setMessageConfirmedNonCommercial
private static void setMessageConfirmedNonCommercial()
-
checkIfProperSignature
private static boolean checkIfProperSignature(java.lang.String providedSignature)
-
checkIfNoPreviousConfirmationAttempts
private static boolean checkIfNoPreviousConfirmationAttempts()
-
checkLackOfPreviousConfirmation
private static boolean checkLackOfPreviousConfirmation()
-
iConfirmCommercialUse
public static boolean iConfirmCommercialUse(java.lang.String mySignature)
By successfully calling this method, you confirm and sign that you use MathParser.org-mXparser commercially according to the License.geTermsOfAgreement(). The confirmation can only be called once. The method call takes place only internally for logging purposes and there is no connection with other external services and no data is sent or collected. The lack of a method call (or its successful call) does not affect the operation of the PRODUCT in any way.- Parameters:
mySignature- Your first and last name or your e-mail address or your company name. At least 5 non-blank characters.- Returns:
- Logs commercial use and returns true if this was the first attempt to register a use type and the signature met the conditions specified for it. Otherwise, returns false and does not log use type.
- See Also:
iConfirmNonCommercialUse(String),getUseTypeConfirmationMessage(),checkIfUseTypeConfirmed(),geTermsOfAgreement()
-
iConfirmNonCommercialUse
public static boolean iConfirmNonCommercialUse(java.lang.String mySignature)
By successfully calling this method, you confirm and sign that you use MathParser.org-mXparser non-commercially according to the License.geTermsOfAgreement(). The confirmation can only be called once. The method call takes place only internally for logging purposes and there is no connection with other external services and no data is sent or collected. The lack of a method call (or its successful call) does not affect the operation of the PRODUCT in any way.- Parameters:
mySignature- Your first and last name or your e-mail address or your company name. At least 5 non-blank characters.- Returns:
- Logs non-commercial use and returns true if this was the first attempt to register a use type and the signature met the conditions specified for it. Otherwise, returns false and does not log use type.
- See Also:
iConfirmNonCommercialUse(String),getUseTypeConfirmationMessage(),checkIfUseTypeConfirmed(),geTermsOfAgreement()
-
checkIfUseTypeConfirmed
public static boolean checkIfUseTypeConfirmed()
Verifies whether the use type has been successfully confirmed and signed.- Returns:
- True in case commercial or non-commercial user type has been confirmed and signed. Otherwise, returns false.
-
getUseTypeConfirmationMessage
public static java.lang.String getUseTypeConfirmationMessage()
Verifies whether the use type has been successfully confirmed and signed.- Returns:
- Confirmation message in case commercial or non-commercial user type has been confirmed and signed. Otherwise, returns error / warning message.
- See Also:
iConfirmNonCommercialUse(String),iConfirmNonCommercialUse(String)
-
getErrorMessage
public static java.lang.String getErrorMessage()
Information about the problem encountered when calling methods: License.iConfirmNonCommercialUse(...), License.iConfirmCommercialUse(...)- Returns:
- Error message if an error occurred, empty string if no error.
- See Also:
iConfirmNonCommercialUse(String),iConfirmNonCommercialUse(String)
-
geTermsOfAgreement
public static java.lang.String geTermsOfAgreement()
Return the terms of MathParser.org-mXparser DUAL LICENSE AGREEMENT.- Returns:
- The terms of MathParser.org-mXparser DUAL LICENSE AGREEMENT as string.
-
consolePrintLicense
public static void consolePrintLicense()
Prints to the console the terms of MathParser.org-mXparser DUAL LICENSE AGREEMENT
-
-