Readable, scalable, and portable across contexts.
Validation logic in OpenEdge often spirals into tangled IF statements and brittle one-off checks. But it doesn’t have to. With ValidatorUtil.cls, you get a focused set of tools for validating structured input—without the chaos.
This utility class from OE Essentials helps you enforce data integrity with reusable, testable methods.
What It Actually Solves
📧 Email Address Validation: Check if an email string follows standard formatting rules—no regex required.
🌐 URL and IP Address Checks: Validate IPv4, IPv6, and URL formats using built-in logic and Unix-based libraries.
📱 Phone Number Validation: Confirm that phone numbers meet expected patterns, especially useful for form inputs and contact records.
💳 Credit Card Number Validation: Use the Luhn algorithm to verify card numbers before processing.
Use Cases That Shine
- Validating user-submitted contact info
- Pre-checking API payloads for malformed fields
- Enforcing format rules in config files or system settings
- Building robust form validation for web or desktop UIs
e.g.
class class Tests.ValidatorUtilUnitTest:
@Test.
method public void TestValidateEmailAddress():
Assert:IsTrue(ValidatorUtil:ValidateEmailAddress("user@example.com"), "Expected valid email to pass").
Assert:IsFalse(ValidatorUtil:ValidateEmailAddress("user@.com"), "Expected invalid email to fail").
Assert:IsFalse(ValidatorUtil:ValidateEmailAddress("userexample.com"), "Expected email without @ to fail").
Assert:IsTrue(ValidatorUtil:ValidateEmailAddress("user.name+tag@example.co.uk"), "Expected complex valid email to pass").
end method.
end class.
Why It Matters
- Reusable logic across modules: Centralized validation means fewer bugs and easier maintenance.
- Cleaner code, fewer conditionals: Replace verbose checks with expressive method calls.
- Predictable behavior: Built-in methods handle edge cases so you don’t have to.
Final Thought
ValidatorUtil.cls helps you write validation logic like a pro. Whether you’re checking emails, URLs, or credit card numbers, this class keeps your code clean and your data trustworthy.
Got a validation challenge you’d love to see supported? Submit an idea or issue on GitHub—OE Essentials is built with your feedback in mind.
Author: Ioana Trasca, Office Manager & Communications Officer
People-oriented person passionate about writing, reading, traveling and a forever animal lover.