Giter Site home page Giter Site logo

validater's Introduction

Validater

JAVA 版本的参数校验工具

参数设置文件示例

<?xml version="1.0" encoding="UTF-8"?>
<check-config>
    <check-list>
    </check-list>
    <check-mapping>
        <class name="com.qianty.validater.ValidaterTest">
            <method name="test">
                <check id="checkUserInfo" class="com.qianty.validater.ValidaterTest$UserInfo" ognl="user != null" msg="用户不能为空">
                    <check field="user" ognl="username != null and password != null" msg="用户无效">
                        <check field="username" regex="[a-z A-Z 0-9]{6,}" msg="无效用户名"/>
                        <check field="password" regex="[a-z A-Z 0-9]{6,}" msg="无效密码"/>
                    </check>
                </check>
            </method>
        </class>
    </check-mapping>
</check-config>

也可

<?xml version="1.0" encoding="UTF-8"?>
<check-config>
    <check-list>
        <check id="checkUserInfo" ognl="user != null" msg="用户不能为空">
            <check field="user" ognl="username != null and password != null" msg="用户无效">
                <check field="username" regex="[a-z A-Z 0-9]{6,}" msg="无效用户名"/>
                <check field="password" regex="[a-z A-Z 0-9]{6,}" msg="无效密码"/>
            </check>
        </check>
    </check-list>
    <check-mapping>
        <class name="com.qianty.validater.ValidaterTest">
            <method name="test">
                <check ref="checkUserInfo"/>
            </method>
        </class>
    </check-mapping>
</check-config>

validater's People

Contributors

wangguangshuo avatar lzxz1234 avatar

Watchers

James Cloos avatar Beyond_奈何 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.