Пример #1
0
  public AbstractRuleProvider() {
    /*
     * In the case of a proxy, the no-args constructor will be called. This is the case even if the provider
     * itself would normally have a metadata param passed in.
     *
     * Once completed, the getMetadata() method will be proxied correctly, so this is ok. Just allow it to pass
     * in this case.
     */
    if (Proxies.isForgeProxy(this)
        && !Annotations.isAnnotationPresent(getClass(), RuleMetadata.class)) return;

    if (!Annotations.isAnnotationPresent(getClass(), RuleMetadata.class)) {
      throw new IllegalStateException(
          getClass().getName()
              + " must either "
              + "be abstract, or specify @"
              + RuleMetadata.class.getName()
              + ", or call a super() constructor and provide "
              + RuleProviderMetadata.class.getName());
    }
    this.metadata = MetadataBuilder.forProvider(getClass());
  }
 public DiscoverStaticIPAddressRuleProvider() {
   super(
       MetadataBuilder.forProvider(DiscoverStaticIPAddressRuleProvider.class)
           .setPhase(MigrationRulesPhase.class));
 }
Пример #3
0
 /**
  * Create a new {@link AbstractRuleProvider} instance using the given parameters to construct
  * default {@link RuleProviderMetadata}.
  */
 public AbstractRuleProvider(Class<? extends RuleProvider> implementationType, String id) {
   this.metadata = MetadataBuilder.forProvider(implementationType, id);
 }
 public JspRulesProvider() {
   super(MetadataBuilder.forProvider(JspRulesProvider.class).setHaltOnException(true));
 }
 public TestXMLNestedXmlFileRuleProvider() {
   super(
       MetadataBuilder.forProvider(TestXMLNestedXmlFileRuleProvider.class)
           .setPhase(PostMigrationRulesPhase.class));
 }
 public CreateApplicationReportIndexRuleProvider() {
   super(
       MetadataBuilder.forProvider(CreateApplicationReportIndexRuleProvider.class)
           .setPhase(PreReportGenerationPhase.class));
 }