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

rdfreactor.generator.5.0.1.source-code.add.vm Maven / Gradle / Ivy

Go to download

RDFReactor creates domain-specific, type-safe Java classes which act as a view over domain-free, loosely typed RDF instances. This package generates the Java classes form an RDF vocabulary.

The newest version!
## ================================================
##
##   if(maxCard==?)
##     "add(Node)"
##     for each range R
##       generate add(R)
##   else
##     "add(Node,maxCard)"
##     for each range R
##       generate add(R,maxCard)
##
## ================================================
##
##     -----------------------------------------------------------------------
##    | IF max cardinality == UNDEFINED. GENERATE "add(Node node)"
#if($prop.maxCardinality == $UNDEFINED)

    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} as an RDF2Go {@linkplain Node}.
#comment("     " $prop)
     * @param model an RDF2Go model
     * @param instanceResource an RDF2Go resource
	 * @param value the value to be added
#debug("add1static")
     */
	public static void add${methodnameprefix}#mixedcase(${prop.name})(Model model, Resource instanceResource, Node value) {
		Base.add(model, instanceResource, #uppercase(${prop.name}), value);
	}

    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} as an RDF2Go {@linkplain Node}.
#comment("     " $prop)
	 * @param value the value to be added
#debug("add1dynamic")
     */
	public void add${methodnameprefix}#mixedcase(${prop.name})(Node value) {
		Base.add(this.model, this.getResource(), #uppercase(${prop.name}), value);
	}
##             -----------------------------------------------------------------------
##            | FOR each range R: GENERATE "add(R)"
#foreach(${type} in $prop.types)
    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} from an instance of {@linkplain ${type}}.
#comment("     " $type)
     * @param model an RDF2Go model
     * @param instanceResource an RDF2Go resource
     * @param value
#debug("add3static")
     */
	public static void add${methodnameprefix}#mixedcase(${prop.name})(Model model, Resource instanceResource, ${type} value) {
		Base.add(model, instanceResource, #uppercase(${prop.name}), value);
	}

    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} from an instance of {@linkplain ${type}}.
#comment("     " $type)
#debug("add4dynamic")
     */
	public void add${methodnameprefix}#mixedcase(${prop.name})(${type} value) {
		Base.add(this.model, this.getResource(), #uppercase(${prop.name}), value);
	}
#end ## #foreach(type in $prop.types)
##     -----------------------------------------------------------------------
##    | END IF max cardinality == UNDEFINED
#else
##     -----------------------------------------------------------------------
##    | max cardinality defined

    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} as an RDF2Go {@linkplain Node}.
#comment("     " $prop)
     * @param model an RDF2Go model
     * @param instanceResource an RDF2Go resource
	 * @param value the value to be added
	 * @throws CardinalityException if adding a value would bring the number
	 *            of property values above the cardinality constraint.
#debug("add5static")
     */
	public static void add${methodnameprefix}#mixedcase(${prop.name})(Model model, Resource instanceResource, Node value)
    throws CardinalityException {
		Base.add(model, instanceResource, #uppercase(${prop.name}), value, $prop.maxCardinality);
	}

    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} as an RDF2Go {@linkplain Node}.
#comment("     " $prop)
	 * @param value the value to be added
	 * @throws CardinalityException if adding a value would bring the number
	 *            of property values above the cardinality constraint.
#debug("add6dynamic")
     */
	public void add${methodnameprefix}#mixedcase(${prop.name})(Node value)
    throws CardinalityException {
		Base.add(this.model, this.getResource(), #uppercase(${prop.name}), value, $prop.maxCardinality);
	}
##             -----------------------------------------------------------------------
##            | FOR each range R: GENERATE "add(R)"
#foreach(${type} in $prop.types)
    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} from an instance of {@linkplain ${type}}.
#comment("     " $type)
     * @param model an RDF2Go model
     * @param instanceResource an RDF2Go resource
	 * @throws CardinalityException if adding a value would bring the number
	 *            of property values above the cardinality constraint.
#debug("add7static")
     */
	public static void add${methodnameprefix}#mixedcase(${prop.name})(Model model, Resource instanceResource, ${type} value)
    throws CardinalityException {
		Base.add(model, instanceResource, #uppercase(${prop.name}), value, $prop.maxCardinality);
	}

    /**
     * Adds a value to property {@code #mixedcase(${prop.name})} from an instance of {@linkplain ${type}}.
#comment("     " $type)
	 * @throws CardinalityException if adding a value would bring the number
	 *            of property values above the cardinality constraint.
#debug("add8dynamic")
     */
	public void add${methodnameprefix}#mixedcase(${prop.name})(${type} value)
    throws CardinalityException {
		Base.add(this.model, this.getResource(), #uppercase(${prop.name}), value, $prop.maxCardinality);
	}
#end ## #foreach(type in $prop.types)

#end ## else




© 2015 - 2025 Weber Informatics LLC | Privacy Policy