All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.astamuse.asta4d.web.dispatch.mapping.handy.HandyRuleBuilder Maven / Gradle / Ivy

Go to download

web functionalities of asta4d framework, including view first and url matching

The newest version!
package com.astamuse.asta4d.web.dispatch.mapping.handy;

import com.astamuse.asta4d.web.dispatch.mapping.UrlMappingRule;
import com.astamuse.asta4d.web.dispatch.mapping.UrlMappingRuleSet;

/**
 * From the entry methods at {@link UrlMappingRuleSet}, there are two possible flow of rule configuration:
 * 
 * 
    *
  • {@link UrlMappingRuleSet#add(String, String)}: Once the target path is configured by entry method, the only operations can be * performed is to set rule attributes related values, such as id, rule attribute, extra path variables, rule matcher, priority, etc. * {@link #buildHandyRuleWithAttrOnly(UrlMappingRule)}} returns a sub class of {@link HandyRuleWithAttrOnly} to perform this restriction. *
  • {@link UrlMappingRuleSet#add(String)}: If the target is not set by entry method, the following steps are enabled to guide developers * to configure the current rule: *
      *
    1. remap(via {@link HandyRuleWithRemap})-> attribution related operations(via {@link HandyRuleWithAttrOnly} ) *
    2. attribution related operations (via {@link HandyRuleWithAttrAndHandler})-> handler setting(via {@link HandyRuleWithHandler}) -> * forward/redirect setting(via {@link HandyRuleWithForward}) *
    *
* * {@link HandyRuleWithAttrOnly} is dependent and others follow the following extending relationship: *

* * {@link HandyRuleWithForward} <--(extend with handler settable)-- {@link HandyRuleWithHandler} <--(extend with attr op)-- * {@link HandyRuleWithAttrAndHandler}) <--(extend with remap op)-- {@link HandyRuleWithRemap} * *

* * This builder interface affords the default build policy of how to create the above instances with the default handy rule implementations. * To extend the url rule configuration DSL, developers must supply their own set of above classes' sub classes, as well as the extended * implementation of {@link UrlMappingRuleSet}. * * @author e-ryu * */ public interface HandyRuleBuilder { @SuppressWarnings("unchecked") default > A buildHandyRuleAfterAddSrc(UrlMappingRule rule) { return (A) new HandyRuleAfterAddSrc<>(rule); } @SuppressWarnings("unchecked") default > B buildHandyRuleAfterAttr(UrlMappingRule rule) { return (B) new HandyRuleAfterAddSrc<>(rule); } @SuppressWarnings("unchecked") default > C buildHandyRuleAfterHandler(UrlMappingRule rule) { return (C) new HandyRuleAfterHandler<>(rule); } @SuppressWarnings("unchecked") default > D buildHandyRuleAfterAddSrcAndTarget(UrlMappingRule rule) { return (D) new HandyRuleAfterAddSrcAndTarget<>(rule); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy