Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moex
Transmorpher
Commits
a5511662
Commit
a5511662
authored
Jan 16, 2003
by
Fabien Triolet
Browse files
Corrected name of package (rules instead of Rules).
parent
771b8086
Changes
21
Hide whitespace changes
Inline
Side-by-side
transmorpher/src/fr/fluxmedia/transmorpher/graph/Namespaced.java
View file @
a5511662
/**
* $Id: Namespaced.java,v 1.
1
200
2-1
1-
0
6 1
4:08:21 serge
Exp $
* $Id: Namespaced.java,v 1.
2
200
3-0
1-
1
6 1
3:37:41 triolet
Exp $
*
* Transmorpher
*
...
...
@@ -31,7 +31,7 @@
package
fr.fluxmedia.transmorpher.graph
;
import
fr.fluxmedia.transmorpher.graph.
R
ules.Namespace
;
import
fr.fluxmedia.transmorpher.graph.
r
ules.Namespace
;
public
interface
Namespaced
{
...
...
transmorpher/src/fr/fluxmedia/transmorpher/graph/Query.java
View file @
a5511662
/**
* $Id: Query.java,v 1.
1
200
2-1
1-
0
6 1
4:08:21 serge
Exp $
* $Id: Query.java,v 1.
2
200
3-0
1-
1
6 1
3: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.
R
ules.Select
;
import
fr.fluxmedia.transmorpher.graph.
R
ules.Namespace
;
import
fr.fluxmedia.transmorpher.graph.
r
ules.Select
;
import
fr.fluxmedia.transmorpher.graph.
r
ules.Namespace
;
import
fr.fluxmedia.transmorpher.utils.Writer
;
public
class
Query
extends
TransformationImpl
implements
Namespaced
{
...
...
transmorpher/src/fr/fluxmedia/transmorpher/graph/Ruleset.java
View file @
a5511662
/**
* $Id: Ruleset.java,v 1.
3
200
2-1
1-
2
6 1
6:34:57
triolet Exp $
* $Id: Ruleset.java,v 1.
4
200
3-0
1-
1
6 1
3: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.
R
ules.*
;
import
fr.fluxmedia.transmorpher.graph.
r
ules.*
;
public
class
Ruleset
extends
TransformationImpl
implements
Namespaced
{
...
...
transmorpher/src/fr/fluxmedia/transmorpher/graph/rules/AddAtt.java
View file @
a5511662
/**
* $Id: AddAtt.java,v 1.
2
200
2-1
1-1
8
1
6:08
:4
0
triolet Exp $
* $Id: AddAtt.java,v 1.
3
200
3-0
1-1
6
1
3:37
:4
1
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
);
}
}
transmorpher/src/fr/fluxmedia/transmorpher/graph/rules/AddTag.java
View file @
a5511662
/**
* $Id: AddTag.java,v 1.
1
200
2-1
1-
0
6 1
4:08:21 serge
Exp $
* $Id: AddTag.java,v 1.
2
200
3-0
1-
1
6 1
3: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"
);
}
}
transmorpher/src/fr/fluxmedia/transmorpher/graph/rules/DefAtt.java
View file @
a5511662
/**
* $Id: DefAtt.java,v 1.
1
200
2-1
1-
0
6 1
4:08:21 serge
Exp $
* $Id: DefAtt.java,v 1.
2
200
3-0
1-
1
6 1
3: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
+
"\""
);
}