Examples of RuleFactory


Examples of org.drools.smf.RuleFactory

    {

        SemanticModule module = this.ruleSetReader.lookupSemanticModule( uri,
                                                                         localName );

        RuleFactory factory = module.getRuleFactory( localName );

        this.ruleSetReader.startConfiguration( localName,
                                               attrs );

        Configuration config = this.ruleSetReader.endConfiguration( );

        Rule rule;
        try
        {
            rule = factory.newRule( this.ruleSetReader.getRuleSet( ),
                                    this.ruleSetReader.getFactoryContext( ),
                                    config );

            startRule( rule,
                       attrs );
View Full Code Here

Examples of org.jsonschema2pojo.rules.RuleFactory

    public void selfRefWithoutParentFile() throws IOException {
        JCodeModel codeModel = new JCodeModel();
        JsonNode schema = new ObjectMapper().readTree("{\"type\":\"object\", \"properties\":{\"a\":{\"$ref\":\"#/b\"}}, \"b\":\"string\"}");
       
        JPackage p = codeModel._package("com.example");
        new RuleFactory().getSchemaRule().apply("Example", schema, p, new Schema(null, schema));
    }
View Full Code Here

Examples of org.jsonschema2pojo.rules.RuleFactory

     * @throws IOException
     *             if the application is unable to read data from the source
     */
    public static void generate(GenerationConfig config) throws FileNotFoundException, IOException {
        Annotator annotator = getAnnotator(config);
        RuleFactory ruleFactory = createRuleFactory(config);

        ruleFactory.setAnnotator(annotator);
        ruleFactory.setGenerationConfig(config);

        SchemaMapper mapper = new SchemaMapper(ruleFactory, new SchemaGenerator());

        JCodeModel codeModel = new JCodeModel();

View Full Code Here

Examples of org.jsonschema2pojo.rules.RuleFactory

     * implementation.
     *
     * @see RuleFactory
     */
    public SchemaMapper() {
        this(new RuleFactory(), new SchemaGenerator());
    }
View Full Code Here

Examples of org.jsonschema2pojo.rules.RuleFactory

    @Test
    public void generateReadsSchemaAsObject() throws IOException {

        final SchemaRule mockSchemaRule = mock(SchemaRule.class);

        final RuleFactory mockRuleFactory = mock(RuleFactory.class);
        when(mockRuleFactory.getSchemaRule()).thenReturn(mockSchemaRule);
        when(mockRuleFactory.getGenerationConfig()).thenReturn(new DefaultGenerationConfig());

        URL schemaContent = this.getClass().getResource("/schema/address.json");

        new SchemaMapper(mockRuleFactory, new SchemaGenerator()).generate(new JCodeModel(), "Address", "com.example.package", schemaContent);
View Full Code Here

Examples of org.jsonschema2pojo.rules.RuleFactory

        when(mockGenerationConfig.getSourceType()).thenReturn(SourceType.JSON);

        final SchemaGenerator mockSchemaGenerator = mock(SchemaGenerator.class);
        when(mockSchemaGenerator.schemaFromExample(schemaContent)).thenReturn(schemaNode);

        final RuleFactory mockRuleFactory = mock(RuleFactory.class);
        when(mockRuleFactory.getSchemaRule()).thenReturn(mockSchemaRule);
        when(mockRuleFactory.getGenerationConfig()).thenReturn(mockGenerationConfig);

        new SchemaMapper(mockRuleFactory, mockSchemaGenerator).generate(new JCodeModel(), "Address", "com.example.package", schemaContent);

        ArgumentCaptor<JPackage> capturePackage = ArgumentCaptor.forClass(JPackage.class);
View Full Code Here

Examples of urban.shapes.RuleFactory

public class ShapeToRuleTransformer implements ModelTransformer {

  @Override
  public Model transform(Model in) {
    Model out = new Model();
    final RuleFactory ruleFactory = new RuleFactory(new ModelInfo(in.getLines()).getShapeParameters());
   
    for(Statement line : in.getLines()){
      out.addStatement(line);
      if (line instanceof GeneratorStatement)
        out.addStatements(ruleFactory.generateRules((((GeneratorStatement)line).getGenerator())));
    }
    return out;
  }
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.