Commit a5511662 authored by Fabien Triolet's avatar Fabien Triolet
Browse files

Corrected name of package (rules instead of Rules).

parent 771b8086
/**
* $Id: Namespaced.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: Namespaced.java,v 1.2 2003-01-16 13:37:41 triolet Exp $
*
* Transmorpher
*
......@@ -31,7 +31,7 @@
package fr.fluxmedia.transmorpher.graph ;
import fr.fluxmedia.transmorpher.graph.Rules.Namespace ;
import fr.fluxmedia.transmorpher.graph.rules.Namespace ;
public interface Namespaced {
......
/**
* $Id: Query.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: Query.java,v 1.2 2003-01-16 13:37:41 triolet Exp $
*
* Transmorpher
*
......@@ -39,8 +39,8 @@ import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.LinearIndexedStruct;
import fr.fluxmedia.transmorpher.utils.Version;
import fr.fluxmedia.transmorpher.graph.Rules.Select ;
import fr.fluxmedia.transmorpher.graph.Rules.Namespace ;
import fr.fluxmedia.transmorpher.graph.rules.Select ;
import fr.fluxmedia.transmorpher.graph.rules.Namespace ;
import fr.fluxmedia.transmorpher.utils.Writer;
public class Query extends TransformationImpl implements Namespaced{
......
/**
* $Id: Ruleset.java,v 1.3 2002-11-26 16:34:57 triolet Exp $
* $Id: Ruleset.java,v 1.4 2003-01-16 13:37:41 triolet Exp $
*
* Transmorpher
*
......@@ -41,7 +41,7 @@ import fr.fluxmedia.transmorpher.utils.LinearIndexedStruct;
import fr.fluxmedia.transmorpher.utils.Version;
import fr.fluxmedia.transmorpher.utils.TMException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.graph.Rules.*;
import fr.fluxmedia.transmorpher.graph.rules.*;
public class Ruleset extends TransformationImpl implements Namespaced {
......
/**
* $Id: AddAtt.java,v 1.2 2002-11-18 16:08:40 triolet Exp $
* $Id: AddAtt.java,v 1.3 2003-01-16 13:37:41 triolet Exp $
*
* Transmorpher
*
......@@ -22,46 +22,115 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* Transmorpher graph rule node interface
*
* @author Jerome.Euzenat@inrialpes.fr
* @since jdk 1.3 / SAX 2.0
*/
package fr.fluxmedia.transmorpher.graph.Rules ;
import java.io.IOException;
package fr.fluxmedia.transmorpher.graph.rules;
import fr.fluxmedia.transmorpher.utils.Writer;
import java.io.IOException;
/**
* Transmorpher graph rule node interface
*
*@since jdk 1.3 / SAX 2.0
*@author Jerome.Euzenat@inrialpes.fr
*/
public class AddAtt implements Rule {
public String match = null;
public String value = null;
public AddAtt(String n, String v){
super();
match = n;
value = v;
}
/** Prints the XML expression of the rule */
public void generateXML(){
System.out.println(" <addatt match=\""+match+"\" value=\""+value+"\"/>");
}
public void generateXSLTCode(Writer file) throws IOException {
file.writeln(6,"<!-- Adding attributes "+match+" -->");
file.write(6,"<xsl:attribute name=\""+match+"\">");
file.write(value);
file.write("</xsl:attribute>");
file.writeln("");
}
/** Prints the XSLT code inside a ModTag template */
public void generateInsideXSLTCode(Writer file) throws IOException {
generateXSLTCode(file);
}
/**
* Description of the Field
*/
public String match = null;
/**
* Description of the Field
*/
public String value = null;
/**
*Constructor for the AddAtt object
*/
public AddAtt() {
super();
}
/**
*Constructor for the AddAtt object
*
*@param n Description of the Parameter
*@param v Description of the Parameter
*/
public AddAtt(String n, String v) {
super();
match = n;
value = v;
}
/**
* Sets the match attribute of the AddAtt object
*
*@param match The new match value
*/
public void setMatch(String match) {
this.match = match;
}
/**
* Sets the value attribute of the AddAtt object
*
*@param value The new value value
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the match attribute of the AddAtt object
*
*@return The match value
*/
public String getMatch() {
return match;
}
/**
* Gets the value attribute of the AddAtt object
*
*@return The value value
*/
public String getValue() {
return value;
}
/**
* Prints the XML expression of the rule
*/
public void generateXML() {
System.out.println(" <addatt match=\"" + match + "\" value=\"" + value + "\"/>");
}
/**
* Description of the Method
*
*@param file Description of the Parameter
*@exception IOException Description of the Exception
*/
public void generateXSLTCode(Writer file) throws IOException {
file.writeln(6, "<!-- Adding attributes " + match + " -->");
file.write(6, "<xsl:attribute name=\"" + match + "\">");
file.write(value);
file.write("</xsl:attribute>");
file.writeln("");
}
/**
* Prints the XSLT code inside a ModTag template
*
*@param file Description of the Parameter
*@exception IOException Description of the Exception
*/
public void generateInsideXSLTCode(Writer file) throws IOException {
generateXSLTCode(file);
}
}
/**
* $Id: AddTag.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: AddTag.java,v 1.2 2003-01-16 13:37:41 triolet Exp $
*
* Transmorpher
*
*
* Copyright (C) 2001-2002 Fluxmedia and INRIA Rhône-Alpes.
*
* http://www.fluxmedia.fr - http://transmorpher.inrialpes.fr
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* Transmorpher graph rule node interface
*
* @author Jerome.Euzenat@inrialpes.fr
* @since jdk 1.3 / SAX 2.0
*/
package fr.fluxmedia.transmorpher.graph.rules;
import fr.fluxmedia.transmorpher.utils.TMException;
package fr.fluxmedia.transmorpher.graph.Rules ;
import fr.fluxmedia.transmorpher.utils.Writer;
import java.io.IOException;
import fr.fluxmedia.transmorpher.utils.Writer;
import fr.fluxmedia.transmorpher.utils.TMException;
/**
* Transmorpher graph rule node interface
*
*@since jdk 1.3 / SAX 2.0
*@author Jerome.Euzenat@inrialpes.fr
*/
public class AddTag implements Rule {
public String match = null;
public String context = null;
public AddTag(String m){
super();
match = m;
}
public AddTag(String m, String c){
this(m);
context = c;
}
/** Prints the XML expression of the rule */
public void generateXML(){
System.out.print(" <addtag match=\""+match+"\"");
if ( context != null ) System.out.print(" context=\""+context+"\"");
System.out.println("/>");
}
//** THIS HAS NOT BEEN DEFINED */
public void generateXSLTCode(Writer file) throws IOException {
file.writeln(2,"<!-- Removing attributes "+match+" -->");
file.write(2,"<xsl:template match=\"");
if( context != null ) file.write(context+"/");
file.writeln("@"+match+"\"/>");
file.writeln("");
}
/** Prints the XSLT code inside a ModTag template */
public void generateInsideXSLTCode(Writer file) throws TMException {
throw new TMException("[AddTag]generateInsideXSLTCode: not implemented yet");
}
/**
* Description of the Field
*/
public String match = null;
/**
* Description of the Field
*/
public String context = null;
/**
*Constructor for the AddTag object
*/
public AddTag() {
super();
}
/**
*Constructor for the AddTag object
*
*@param m Description of the Parameter
*/
public AddTag(String m) {
super();
match = m;
}
/**
*Constructor for the AddTag object
*
*@param m Description of the Parameter
*@param c Description of the Parameter
*/
public AddTag(String m, String c) {
this(m);
context = c;
}
/**
* Sets the match attribute of the AddTag object
*
*@param match The new match value
*/
public void setMatch(String match) {
this.match = match;
}
/**
* Gets the match attribute of the AddTag object
*
*@return The match value
*/
public String getMatch() {
return match;
}
/**
* Sets the context attribute of the AddTag object
*
*@param context The new context value
*/
public void setContext(String context) {
this.context = context;
}
/**
* Gets the context attribute of the AddTag object
*
*@return The context value
*/
public String getContext() {
return context;
}
/**
* Prints the XML expression of the rule
*/
public void generateXML() {
System.out.print(" <addtag match=\"" + match + "\"");
if (context != null) {
System.out.print(" context=\"" + context + "\"");
}
System.out.println("/>");
}
//** THIS HAS NOT BEEN DEFINED */
/**
* Description of the Method
*
*@param file Description of the Parameter
*@exception IOException Description of the Exception
*/
public void generateXSLTCode(Writer file) throws IOException {
file.writeln(2, "<!-- Removing attributes " + match + " -->");
file.write(2, "<xsl:template match=\"");
if (context != null) {
file.write(context + "/");
}
file.writeln("@" + match + "\"/>");
file.writeln("");
}
/**
* Prints the XSLT code inside a ModTag template
*
*@param file Description of the Parameter
*@exception TMException Description of the Exception
*/
public void generateInsideXSLTCode(Writer file) throws TMException {
throw new TMException("[AddTag]generateInsideXSLTCode: not implemented yet");
}
}
/**
* $Id: DefAtt.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: DefAtt.java,v 1.2 2003-01-16 13:37:41 triolet Exp $
*
* Transmorpher
*
......@@ -22,65 +22,168 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* Transmorpher default attribute rule
*
* @author Jerome.Euzenat@inrialpes.fr
* @since jdk 1.3 / SAX 2.0
*/
package fr.fluxmedia.transmorpher.graph.Rules ;
import java.io.IOException;
package fr.fluxmedia.transmorpher.graph.rules;
import fr.fluxmedia.transmorpher.utils.Writer;
import java.io.IOException;
/**
* Transmorpher default attribute rule
*
*@since jdk 1.3 / SAX 2.0
*@author Jerome.Euzenat@inrialpes.fr
*/
public class DefAtt implements Rule {
public String match = null;
public String value = null;
public String context = null;
public DefAtt(String m, String v){
super();
match = m;
value = v;
}
public DefAtt(String m, String v, String c){
this(m, v);
context = c;
}
/** Prints the XML expression of the rule */
public void generateXML(){
System.out.print(" <defatt match=\""+match+"\"");
if ( context != null ) System.out.print(" context=\""+context+"\"");
System.out.println("value=\""+value+"/>");
}
public void generateXSLTCode(Writer file) throws IOException {
file.writeln(2,"<!-- Default attributes for "+match+": "+value+" -->");
file.write(2,"<xsl:template match=\"");
if( context != null ) file.write(context+"/");
file.writeln("@"+ match+"\">");
file.writeln(4,"<xsl:attribute name=\""+value+"\">");
file.write("<xsl:value-of select=\"@"+match+"\"/>");
file.writeln(4,"</xsl:attribute>");
file.writeln(2,"</xsl:template>");
file.writeln("");
}
/** Prints the XSLT code inside a ModTag template
This is the only way for a default attribute rule to work*/
public void generateInsideXSLTCode(Writer file) throws IOException {
file.writeln(6,"<!-- Default attributes for "+match+": "+value+" -->");
file.writeln(6,"<xsl:if test=\"not(@\""+match+")\">");
file.writeln(8,"<xsl:attribute name=\""+match+"\">");
file.write(value);
file.writeln(8,"</xsl:attribute>");
file.writeln(6,"</xsl:if>");
file.writeln("");
}
/**
* Description of the Field
*/
public String match = null;
/**
* Description of the Field
*/
public String value = null;
/**
* Description of the Field
*/
public String context = null;
/**
*Constructor for the DefAtt object
*/
public DefAtt() {
super();
}
/**
*Constructor for the DefAtt object
*
*@param m Description of the Parameter
*@param v Description of the Parameter
*/
public DefAtt(String m, String v) {
super();
match = m;
value = v;
}
/**
*Constructor for the DefAtt object
*
*@param m Description of the Parameter
*@param v Description of the Parameter
*@param c Description of the Parameter
*/
public DefAtt(String m, String v, String c) {
this(m, v);
context = c;
}
/**
* Sets the match attribute of the DefAtt object
*
*@param match The new match value
*/
public void setMatch(String match) {
this.match = match;
}
/**
* Gets the match attribute of the DefAtt object
*
*@return The match value
*/
public String getMatch() {
return match;
}
/**
* Gets the context attribute of the DefAtt object
*
*@return The context value
*/
public String getContext() {
return context;
}
/**
* Sets the context attribute of the DefAtt object
*
*@param context The new context value
*/
public void setContext(String context) {
this.context = context;
}
/**
* Gets the value attribute of the DefAtt object
*
*@return The value value
*/
public String getValue() {
return value;
}
/**
* Sets the value attribute of the DefAtt object
*
*@param value The new value value
*/
public void setValue(String value) {
this.value = value;
}
/**
* Prints the XML expression of the rule
*/
public void generateXML() {
System.out.print(" <defatt match=\"" + match + "\"");
if (context != null) {
System.out.print(" context=\"" + context + "\"");