Examples of Regex


Examples of org.apache.isis.applib.annotation.RegEx

    public void process(final ProcessMethodContext processMethodContext) {
        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
        if (!Annotations.isString(returnType)) {
            return;
        }
        final RegEx annotation = Annotations.getAnnotation(processMethodContext.getMethod(), RegEx.class);
        addRegexFacetAndCorrespondingTitleFacet(processMethodContext.getFacetHolder(), annotation);
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.RegEx

        super(FeatureType.OBJECTS_ONLY);
    }

    @Override
    public void process(final ProcessClassContext processClassContaxt) {
        final RegEx annotation = Annotations.getAnnotation(processClassContaxt.getCls(), RegEx.class);
        FacetUtil.addFacet(createRegexFacet(annotation, processClassContaxt.getFacetHolder()));
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.RegEx

        }

        final Annotation[] parameterAnnotations = Annotations.getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
        for (final Annotation parameterAnnotation : parameterAnnotations) {
            if (parameterAnnotation instanceof RegEx) {
                final RegEx annotation = (RegEx) parameterAnnotation;
                addRegexFacetAndCorrespondingTitleFacet(processParameterContext.getFacetHolder(), annotation);
                return;
            }
        }
    }
View Full Code Here

Examples of org.apache.sirona.reporting.web.plugin.api.Regex

        for (final Method method : endpointClass.getMethods()) {
            if (method.getDeclaringClass() == Object.class) {
                continue;
            }

            final Regex regex = method.getAnnotation(Regex.class);
            if (regex != null) {
                final Pattern pattern = Pattern.compile(rootMapping + regex.value());
                final Invoker invoker = new Invoker(instance, method, id);
                int partIdx = 1; // regex index, it starts from 1
                for (final Class<?> clazz : method.getParameterTypes()) {
                    if (HttpServletRequest.class.equals(clazz)) {
                        invoker.addRequestParameter();
View Full Code Here

Examples of org.hyperdex.client.Regex

        Object obj26 = c.put("kv", "baz/baz/baz", attrs26);
        assert(obj26 != null);
        Boolean bool26 = (Boolean)obj26;
        assert(bool26 == true);
        Map<String, Object> checks27 = new HashMap<String, Object>();
        checks27.put("k", new Regex("^foo"));
        Set<Object> X27 = new HashSet<Object>();
        Iterator it27 = c.search("kv", checks27);
        while (it27.hasNext())
        {
            X27.add(it27.next());
        }
        Map<String, Object> checks28 = new HashMap<String, Object>();
        checks28.put("k", new Regex("foo$"));
        Set<Object> X28 = new HashSet<Object>();
        Iterator it28 = c.search("kv", checks28);
        while (it28.hasNext())
        {
            X28.add(it28.next());
        }
        Map<String, Object> checks29 = new HashMap<String, Object>();
        checks29.put("k", new Regex("^b.*/foo/.*$"));
        Set<Object> X29 = new HashSet<Object>();
        Iterator it29 = c.search("kv", checks29);
        while (it29.hasNext())
        {
            X29.add(it29.next());
View Full Code Here

Examples of org.joni.Regex

     */
    @JRubyMethod(name = "sub!", frame = true, reads = BACKREF, writes = BACKREF)
    public IRubyObject sub_bang(ThreadContext context, IRubyObject arg0, Block block) {
        if (block.isGiven()) {
            RubyRegexp rubyRegex = getPattern(arg0, true);
            Regex regex = rubyRegex.getPattern();
            return subBangCommon(regex, context, true, rubyRegex, block, null, false);
        } else {
            throw context.getRuntime().newArgumentError("wrong number of arguments (1 for 2)");
        }
    }
View Full Code Here

Examples of org.joni.Regex

     */
    @JRubyMethod(name = "sub!", frame = true, reads = BACKREF, writes = BACKREF)
    public IRubyObject sub_bang(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) {
        RubyString repl = arg1.convertToString();
        RubyRegexp rubyRegex = getPattern(arg0, true);
        Regex regex = rubyRegex.getPattern();
        return subBangCommon(regex, context, false, rubyRegex, block, repl, repl.isTaint());
    }
View Full Code Here

Examples of org.joni.Regex

    }

    private final IRubyObject gsub(ThreadContext context, IRubyObject arg0, Block block, final boolean bang) {
        if (block.isGiven()) {
            RubyRegexp rubyRegex = getPattern(arg0, true);
            Regex regex = rubyRegex.getPattern();
            return gsubCommon(regex, context, bang, true, rubyRegex, block, null, false);
        } else {
            throw context.getRuntime().newArgumentError("wrong number of arguments (1 for 2)");
        }
    }
View Full Code Here

Examples of org.joni.Regex

    }

    private final IRubyObject gsub(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block, final boolean bang) {
        IRubyObject repl = arg1.convertToString();
        RubyRegexp rubyRegex = getPattern(arg0, true);
        Regex regex = rubyRegex.getPattern();
        return gsubCommon(regex, context, bang, false, rubyRegex, block, repl, repl.isTaint());
    }
View Full Code Here

Examples of org.joni.Regex

    }
   
    private RubyArray split(ThreadContext context, IRubyObject pat, boolean limit, int lim, int i) {
        Ruby runtime = context.getRuntime();

        final Regex regex = getPattern(pat, true).getPattern();
        int beg, end, start;

        int begin = value.begin;
        start = begin;
        beg = 0;
       
        int range = begin + value.realSize;
        byte[]bytes = value.bytes;
        final Matcher matcher = regex.matcher(bytes, begin, range);
       
        boolean lastNull = false;
        RubyArray result = runtime.newArray();
        final Encoding enc = regex.getEncoding();
       
        if (regex.numberOfCaptures() == 0) { // shorter path, no captures defined, no region will be returned
            while ((end = matcher.search(start, range, Option.NONE)) >= 0) {
                if (start == end + begin && matcher.getBegin() == matcher.getEnd()) {
                    if (value.realSize == 0) {
                        result.append(newEmptyString(runtime, getMetaClass()));
                        break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.