forked from jruby/jruby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow JavaBeans properties to be accessed like ruby attributes.
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@1452 961051c9-f516-0410-bf72-c9f7e237a7b7
- Loading branch information
Showing
6 changed files
with
118 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.jruby.javasupport.test; | ||
|
||
public class Color { | ||
private String color; | ||
|
||
public Color(String color) { | ||
this.color = color; | ||
} | ||
|
||
public void setColor(String color) { | ||
this.color = color; | ||
} | ||
|
||
public String getColor() { | ||
return color; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (C) 2004 David Corbin <dcorbin@users.sourceforge.net> | ||
* | ||
* JRuby - http://jruby.sourceforge.net | ||
* | ||
* This file is part of JRuby | ||
* | ||
* JRuby 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. | ||
* | ||
* JRuby 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 JRuby; if not, write to | ||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, | ||
* Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
package org.jruby.javasupport.test; | ||
|
||
public class ConstantHolder { | ||
|
||
public static final String _LEADING_UNDERSCORE = "Foo"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jruby.javasupport.test; | ||
|
||
public class Room { | ||
private final String name; | ||
private String owner = null; | ||
|
||
public Room(String name) { | ||
this.name = name; | ||
} | ||
|
||
public boolean equals(Object obj) { | ||
if (! (obj instanceof Room)) | ||
return false; | ||
Room that = (Room) obj; | ||
return name.equals(that.name); | ||
} | ||
|
||
public String toString() { | ||
return name; | ||
} | ||
|
||
public int hashCode() { | ||
return name.hashCode(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters