Examine individual changes
This page allows you to examine the variables generated by the Edit Filter for an individual change.
Variables generated for this change
Variable | Value |
---|---|
Whether or not the edit is marked as minor (no longer in use) (minor_edit ) | false |
Edit count of the user (user_editcount ) | null |
Name of the user account (user_name ) | '184.94.121.158' |
Age of the user account (user_age ) | 0 |
Groups (including implicit) the user is in (user_groups ) | [
0 => '*'
] |
Rights that the user has (user_rights ) | [
0 => 'createaccount',
1 => 'read',
2 => 'edit',
3 => 'createtalk',
4 => 'writeapi',
5 => 'viewmywatchlist',
6 => 'editmywatchlist',
7 => 'viewmyprivateinfo',
8 => 'editmyprivateinfo',
9 => 'editmyoptions',
10 => 'abusefilter-log-detail',
11 => 'centralauth-merge',
12 => 'abusefilter-view',
13 => 'abusefilter-log',
14 => 'vipsscaler-test'
] |
Whether the user is editing from mobile app (user_app ) | false |
Whether or not a user is editing through the mobile interface (user_mobile ) | false |
Page ID (page_id ) | 1173053 |
Page namespace (page_namespace ) | 0 |
Page title without namespace (page_title ) | 'JavaBeans' |
Full page title (page_prefixedtitle ) | 'JavaBeans' |
Last ten users to contribute to the page (page_recent_contributors ) | [
0 => '123.252.235.36',
1 => '91.227.215.2',
2 => 'Yankexe',
3 => '46.255.86.28',
4 => '2601:CF:8100:CB60:E95E:8B10:CF28:6301',
5 => '103.16.12.86',
6 => 'Alvakirud',
7 => '161.225.96.152',
8 => 'Sae1962',
9 => '80.248.4.82'
] |
Action (action ) | 'edit' |
Edit summary/reason (summary ) | '/* Disadvantages */ ' |
Old content model (old_content_model ) | 'wikitext' |
New content model (new_content_model ) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext ) | '{{Distinguish|Enterprise JavaBeans}}
{{multiple issues|
{{refimprove|date=June 2016}}
{{manual|date=October 2012}}
}}
In computing based on the Java Platform, '''JavaBeans''' are classes that encapsulate many [[Object (computer science)|objects]] into a single object (the bean). They are [[Serialization|serializable]], have a [[nullary constructor|zero-argument constructor]], and allow access to properties using [[Mutator method|getter and setter methods]]. The name "Bean" was given to encompass this standard, which aims to create [[Code reuse|reusable]] [[Component-based software engineering|software components]] for [[Java (programming language)|Java]].
It is a reusable software component written in JAVA that can be manipulated visually in an application builder tool.
==Features==
*Introspection
*Properties
*Customization
*Events
*Persistence
*Methods
== Advantages ==
* The properties, events, and methods of a bean can be exposed to another application.
* A bean may register to receive events from other objects and can generate events that are sent to those other objects.
* Auxiliary software can be provided to help configure a bean.
*The configuration settings of a bean can be saved to persistent storage and restored.
== Disadvantages ==
* A class with a [[nullary constructor|zero-argument constructor]] is subject to being instantiated in an invalid state.<ref name="Bloch">{{cite book|last1=Bloch|first1=Joshua|authorlink1=Joshua Bloch|title=Effective Java|date=2008|publisher=Addison-Wesley|isbn=978-0-321-35668-0|page=13|edition=Second}}</ref> If such a class is instantiated manually by a developer (rather than automatically by some kind of framework), the developer might not realize that the class has been improperly instantiated. The compiler cannot detect such a problem, and even if it is documented, there is no guarantee that the developer will see the documentation.
* JavaBeans are inherently mutable and so lack the advantages offered by [[immutable objects]].<ref name="Bloch"/>
* Having to create getters for every property and setters for many, most, or all of them can lead to an immense quantity of [[boilerplate code]].
== JavaBeans API ==
The JavaBeans functionality is provided by a set of classes and interfaces in the <tt>java.beans</tt> package.
{| class="wikitable sortable"
|-
! Interface !! Description
|-
| <tt>AppletInitializer</tt> || Methods in this interface are used to initialize Beans that are also [[Java applet|applet]]s.
|-java
| <tt>BeanInfo</tt> || This interface allows the designer to specify information about the events, methods and properties of a Bean.
|-
| <tt>Customizer</tt> || This interface allows the designer to provide a graphical user interface through which a bean may be configured.
|-
| <tt>DesignMode</tt> || Methods in this interface determine if a bean is executing in design mode.
|-
| <tt>ExceptionListener</tt> || A method in this interface is invoked when an exception has occurred.
|-
| <tt>PropertyChangeListener</tt> || A method in this interface is invoked when a bound property is changed.
|-
| <tt>PropertyEditor</tt> || Objects that implement this interface allow the designer to change and display property values.
|-
| <tt>VetoableChangeListener</tt> || A method in this interface is invoked when a Constrained property is changed.
|-
| <tt>Visibility</tt> || Methods in this interface allow a bean to execute in environments where the GUI is not available.
|}
== JavaBean conventions ==
In order to function as a JavaBean [[Class (computer science)|class]], an object class must obey certain conventions about method naming, construction, and behaviour. These conventions make it possible to have tools that can use, reuse, replace, and connect Java Beans.
The required conventions are as follows:
* The class must have a public [[default constructor]] (with no arguments). This allows easy instantiation within editing and activation frameworks.
* The class [[property (programming)|properties]] must be accessible using ''get'', ''set'', ''is'' (can be used for boolean properties instead of get), ''to'' and other methods (so-called [[Accessor|accessor methods]] and [[mutator method]]s) according to a standard [[naming conventions (programming)|naming convention]]. This allows easy automated inspection and updating of bean state within frameworks, many of which include custom editors for various types of properties. Setters can have one or more than one argument.
* The class should be [[Serialization#Java|serializable]]. (This allows applications and frameworks to reliably save, store, and restore the bean's state in a manner independent of the [[Virtual machine|VM]] and of the platform.)
===Code example===
<source lang=Java>
package player;
public class PersonBean implements java.io.Serializable {
/** Properties **/
private boolean deceased = false;
private List list;
/** Property <code>name</code> (note capitalization) readable/writable. */
private String name = null;
/** No-arg constructor (takes no arguments). */
public PersonBean() {
}
public List getList() {
return list;
}
public void setList(final List list) {
this.list = list;
}
/**
* Getter for property <code>name</code>
*/
public String getName() {
return name;
}
/**
* Setter for property <code>name</code>.
*
* @param value
*/
public void setName(final String value) {
this.name = value;
}
/**
* Getter for property "deceased"
* Different syntax for a boolean field (is v.s. get)
*/
public boolean isDeceased() {
return deceased;
}
/**
* Setter for property <code>deceased</code>.
* @param value
*/
public void setDeceased(boolean value) {
deceased = value;
}
}
</source>
'''<u><code>TestPersonBean.java</code></u>''':
<source lang=Java>
import player.PersonBean;
/**
* Class <code>TestPersonBean</code>.
*/
public class TestPersonBean {
/**
* Tester method <code>main</code> for class <code>PersonBean</code>.
*
* @param arguments
*/
public static void main(final String[] arguments) {
final PersonBean person = new PersonBean();
person.setName("Bob");
person.setDeceased(false);
person.setList(new ArrayList());
// Output: "Bob [alive]"
System.out.print(person.getName());
System.out.println(person.isDeceased() ? " [deceased]" : " [alive]");
}
}
</source>
====Use in a [[JavaServer Pages|JavaServer Page]]====
'''<u><code>testPersonBean.jsp</code></u>''';
<source lang=HTML4Strict>
<% // Use of PersonBean in a JSP. %>
<jsp:useBean id="person" class="player.PersonBean" scope="page"/>
<jsp:setProperty name="person" property="*"/>
<html>
<body>
Name: <jsp:getProperty name="person" property="name"/><br/>
Deceased? <jsp:getProperty name="person" property="deceased"/><br/>
<br/>
<form name="beanTest" method="POST" action="testPersonBean.jsp">
Enter a name: <input type="text" name="name" size="50"><br/>
Choose an option:
<select name="deceased">
<option value="false">Alive</option>
<option value="true">Dead</option>
</select>
<input type="submit" value="Test the Bean">
</form>
</body>
</html>
</source>
==References==
{{Reflist|2}}
== External links ==
* [http://download.oracle.com/javase/tutorial/javabeans/ Oracle's JavaBeans tutorials]
* [http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html JavaBeans specification]
<!--Categories-->
[[Category:Java platform]]
[[Category:Articles with example Java code]]' |
New page wikitext, after the edit (new_wikitext ) | '{{Distinguish|Enterprise JavaBeans}}
{{multiple issues|
{{refimprove|date=June 2016}}
{{manual|date=October 2012}}
}}
In computing based on the Java Platform, '''JavaBeans''' are classes that encapsulate many [[Object (computer science)|objects]] into a single object (the bean). They are [[Serialization|serializable]], have a [[nullary constructor|zero-argument constructor]], and allow access to properties using [[Mutator method|getter and setter methods]]. The name "Bean" was given to encompass this standard, which aims to create [[Code reuse|reusable]] [[Component-based software engineering|software components]] for [[Java (programming language)|Java]].
It is a reusable software component written in JAVA that can be manipulated visually in an application builder tool.
==Features==
*Introspection
*Properties
*Customization
*Events
*Persistence
*Methods
== Advantages ==
* The properties, events, and methods of a bean can be exposed to another application.
* A bean may register to receive events from other objects and can generate events that are sent to those other objects.
* Auxiliary software can be provided to help configure a bean.
*The configuration settings of a bean can be saved to persistent storage and restored.
== JavaBeans API ==
The JavaBeans functionality is provided by a set of classes and interfaces in the <tt>java.beans</tt> package.
{| class="wikitable sortable"
|-
! Interface !! Description
|-
| <tt>AppletInitializer</tt> || Methods in this interface are used to initialize Beans that are also [[Java applet|applet]]s.
|-java
| <tt>BeanInfo</tt> || This interface allows the designer to specify information about the events, methods and properties of a Bean.
|-
| <tt>Customizer</tt> || This interface allows the designer to provide a graphical user interface through which a bean may be configured.
|-
| <tt>DesignMode</tt> || Methods in this interface determine if a bean is executing in design mode.
|-
| <tt>ExceptionListener</tt> || A method in this interface is invoked when an exception has occurred.
|-
| <tt>PropertyChangeListener</tt> || A method in this interface is invoked when a bound property is changed.
|-
| <tt>PropertyEditor</tt> || Objects that implement this interface allow the designer to change and display property values.
|-
| <tt>VetoableChangeListener</tt> || A method in this interface is invoked when a Constrained property is changed.
|-
| <tt>Visibility</tt> || Methods in this interface allow a bean to execute in environments where the GUI is not available.
|}
== JavaBean conventions ==
In order to function as a JavaBean [[Class (computer science)|class]], an object class must obey certain conventions about method naming, construction, and behaviour. These conventions make it possible to have tools that can use, reuse, replace, and connect Java Beans.
The required conventions are as follows:
* The class must have a public [[default constructor]] (with no arguments). This allows easy instantiation within editing and activation frameworks.
* The class [[property (programming)|properties]] must be accessible using ''get'', ''set'', ''is'' (can be used for boolean properties instead of get), ''to'' and other methods (so-called [[Accessor|accessor methods]] and [[mutator method]]s) according to a standard [[naming conventions (programming)|naming convention]]. This allows easy automated inspection and updating of bean state within frameworks, many of which include custom editors for various types of properties. Setters can have one or more than one argument.
* The class should be [[Serialization#Java|serializable]]. (This allows applications and frameworks to reliably save, store, and restore the bean's state in a manner independent of the [[Virtual machine|VM]] and of the platform.)
===Code example===
<source lang=Java>
package player;
public class PersonBean implements java.io.Serializable {
/** Properties **/
private boolean deceased = false;
private List list;
/** Property <code>name</code> (note capitalization) readable/writable. */
private String name = null;
/** No-arg constructor (takes no arguments). */
public PersonBean() {
}
public List getList() {
return list;
}
public void setList(final List list) {
this.list = list;
}
/**
* Getter for property <code>name</code>
*/
public String getName() {
return name;
}
/**
* Setter for property <code>name</code>.
*
* @param value
*/
public void setName(final String value) {
this.name = value;
}
/**
* Getter for property "deceased"
* Different syntax for a boolean field (is v.s. get)
*/
public boolean isDeceased() {
return deceased;
}
/**
* Setter for property <code>deceased</code>.
* @param value
*/
public void setDeceased(boolean value) {
deceased = value;
}
}
</source>
'''<u><code>TestPersonBean.java</code></u>''':
<source lang=Java>
import player.PersonBean;
/**
* Class <code>TestPersonBean</code>.
*/
public class TestPersonBean {
/**
* Tester method <code>main</code> for class <code>PersonBean</code>.
*
* @param arguments
*/
public static void main(final String[] arguments) {
final PersonBean person = new PersonBean();
person.setName("Bob");
person.setDeceased(false);
person.setList(new ArrayList());
// Output: "Bob [alive]"
System.out.print(person.getName());
System.out.println(person.isDeceased() ? " [deceased]" : " [alive]");
}
}
</source>
====Use in a [[JavaServer Pages|JavaServer Page]]====
'''<u><code>testPersonBean.jsp</code></u>''';
<source lang=HTML4Strict>
<% // Use of PersonBean in a JSP. %>
<jsp:useBean id="person" class="player.PersonBean" scope="page"/>
<jsp:setProperty name="person" property="*"/>
<html>
<body>
Name: <jsp:getProperty name="person" property="name"/><br/>
Deceased? <jsp:getProperty name="person" property="deceased"/><br/>
<br/>
<form name="beanTest" method="POST" action="testPersonBean.jsp">
Enter a name: <input type="text" name="name" size="50"><br/>
Choose an option:
<select name="deceased">
<option value="false">Alive</option>
<option value="true">Dead</option>
</select>
<input type="submit" value="Test the Bean">
</form>
</body>
</html>
</source>
==References==
{{Reflist|2}}
== External links ==
* [http://download.oracle.com/javase/tutorial/javabeans/ Oracle's JavaBeans tutorials]
* [http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html JavaBeans specification]
<!--Categories-->
[[Category:Java platform]]
[[Category:Articles with example Java code]]' |
Unified diff of changes made by edit (edit_diff ) | '@@ -23,9 +23,4 @@
* Auxiliary software can be provided to help configure a bean.
*The configuration settings of a bean can be saved to persistent storage and restored.
-
-== Disadvantages ==
-* A class with a [[nullary constructor|zero-argument constructor]] is subject to being instantiated in an invalid state.<ref name="Bloch">{{cite book|last1=Bloch|first1=Joshua|authorlink1=Joshua Bloch|title=Effective Java|date=2008|publisher=Addison-Wesley|isbn=978-0-321-35668-0|page=13|edition=Second}}</ref> If such a class is instantiated manually by a developer (rather than automatically by some kind of framework), the developer might not realize that the class has been improperly instantiated. The compiler cannot detect such a problem, and even if it is documented, there is no guarantee that the developer will see the documentation.
-* JavaBeans are inherently mutable and so lack the advantages offered by [[immutable objects]].<ref name="Bloch"/>
-* Having to create getters for every property and setters for many, most, or all of them can lead to an immense quantity of [[boilerplate code]].
== JavaBeans API ==
' |
New page size (new_size ) | 6873 |
Old page size (old_size ) | 7800 |
Size change in edit (edit_delta ) | -927 |
Lines added in edit (added_lines ) | [] |
Lines removed in edit (removed_lines ) | [
0 => false,
1 => '== Disadvantages ==',
2 => '* A class with a [[nullary constructor|zero-argument constructor]] is subject to being instantiated in an invalid state.<ref name="Bloch">{{cite book|last1=Bloch|first1=Joshua|authorlink1=Joshua Bloch|title=Effective Java|date=2008|publisher=Addison-Wesley|isbn=978-0-321-35668-0|page=13|edition=Second}}</ref> If such a class is instantiated manually by a developer (rather than automatically by some kind of framework), the developer might not realize that the class has been improperly instantiated. The compiler cannot detect such a problem, and even if it is documented, there is no guarantee that the developer will see the documentation.',
3 => '* JavaBeans are inherently mutable and so lack the advantages offered by [[immutable objects]].<ref name="Bloch"/>',
4 => '* Having to create getters for every property and setters for many, most, or all of them can lead to an immense quantity of [[boilerplate code]].'
] |
Whether or not the change was made through a Tor exit node (tor_exit_node ) | false |
Unix timestamp of change (timestamp ) | 1535135857 |