id
int32 0
165k
| repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
list | docstring
stringlengths 3
16k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 105
339
|
|---|---|---|---|---|---|---|---|---|---|---|---|
146,400
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
|
ImageAnchorCell.setLongdesc
|
public void setLongdesc(String longdesc) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LONGDESC, longdesc);
}
|
java
|
public void setLongdesc(String longdesc) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LONGDESC, longdesc);
}
|
[
"public",
"void",
"setLongdesc",
"(",
"String",
"longdesc",
")",
"{",
"_imageState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"LONGDESC",
",",
"longdesc",
")",
";",
"}"
] |
Sets the longdesc attribute for the HTML image tag.
@param longdesc the longdesc attribute
@jsptagref.attributedescription The longdesc attribute for the HTML image tag.
@jsptagref.attributesyntaxvalue <i>string_alt</i>
@netui:attribute required="false" rtexprvalue="true"
description="the longdesc for the HTML image tag."
|
[
"Sets",
"the",
"longdesc",
"attribute",
"for",
"the",
"HTML",
"image",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L440-L442
|
146,401
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
|
ImageAnchorCell.setHeight
|
public void setHeight(String height) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEIGHT, height);
}
|
java
|
public void setHeight(String height) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEIGHT, height);
}
|
[
"public",
"void",
"setHeight",
"(",
"String",
"height",
")",
"{",
"_imageState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"HEIGHT",
",",
"height",
")",
";",
"}"
] |
Sets the image height attribute for the HTML image tag.
@param height the height.
@jsptagref.attributedescription The image height attribute for the HTML image tag.
@jsptagref.attributesyntaxvalue <i>integer_height</i>
@netui:attribute required="false" rtexprvalue="true"
description="The image height attribute for the HTML image tag."
|
[
"Sets",
"the",
"image",
"height",
"attribute",
"for",
"the",
"HTML",
"image",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L466-L468
|
146,402
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
|
ImageAnchorCell.setHspace
|
public void setHspace(String hspace) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HSPACE, hspace);
}
|
java
|
public void setHspace(String hspace) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HSPACE, hspace);
}
|
[
"public",
"void",
"setHspace",
"(",
"String",
"hspace",
")",
"{",
"_imageState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"HSPACE",
",",
"hspace",
")",
";",
"}"
] |
Sets the the horizontal spacing attribute for the HTML image tag.
@param hspace the horizontal spacing.
@jsptagref.attributedescription The horizontal spacing for the HTML image tag.
@jsptagref.attributesyntaxvalue <i>integer_hspace</i>
@netui:attribute required="false" rtexprvalue="true"
description="The horizontal spacing for the HTML image tag."
|
[
"Sets",
"the",
"the",
"horizontal",
"spacing",
"attribute",
"for",
"the",
"HTML",
"image",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L479-L481
|
146,403
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
|
ImageAnchorCell.setIsmap
|
public void setIsmap(String ismap) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ISMAP, ismap);
}
|
java
|
public void setIsmap(String ismap) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ISMAP, ismap);
}
|
[
"public",
"void",
"setIsmap",
"(",
"String",
"ismap",
")",
"{",
"_imageState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"ISMAP",
",",
"ismap",
")",
";",
"}"
] |
Sets the server-side image map declaration for the HTML image tag.
@param ismap the image map declaration.
@jsptagref.attributedescription The server-side map declaration for the HTML image tag.
@jsptagref.attributesyntaxvalue <i>string_isMap</i>
@netui:attribute required="false" rtexprvalue="true"
description="The server-side map declaration for the HTML image tag."
|
[
"Sets",
"the",
"server",
"-",
"side",
"image",
"map",
"declaration",
"for",
"the",
"HTML",
"image",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L492-L494
|
146,404
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
|
ImageAnchorCell.setUsemap
|
public void setUsemap(String usemap) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.USEMAP, usemap);
}
|
java
|
public void setUsemap(String usemap) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.USEMAP, usemap);
}
|
[
"public",
"void",
"setUsemap",
"(",
"String",
"usemap",
")",
"{",
"_imageState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"USEMAP",
",",
"usemap",
")",
";",
"}"
] |
Sets the client-side image map declaration for the HTML iage tag.
@param usemap the map declaration.
@jsptagref.attributedescription The client-side image map declaration for the HTML image tag.
@jsptagref.attributesyntaxvalue <i>string_useMap</i>
@netui:attribute required="false" rtexprvalue="true"
description="The client-side image map declaration for the HTML image tag."
|
[
"Sets",
"the",
"client",
"-",
"side",
"image",
"map",
"declaration",
"for",
"the",
"HTML",
"iage",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L519-L521
|
146,405
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
|
ImageAnchorCell.setVspace
|
public void setVspace(String vspace) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VSPACE, vspace);
}
|
java
|
public void setVspace(String vspace) {
_imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VSPACE, vspace);
}
|
[
"public",
"void",
"setVspace",
"(",
"String",
"vspace",
")",
"{",
"_imageState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"VSPACE",
",",
"vspace",
")",
";",
"}"
] |
Sets the vertical spacing around the HTML image tag.
@param vspace the vertical spacing.
@jsptagref.attributedescription The vertical spacing around the HTML image tag.
@jsptagref.attributesyntaxvalue <i>string_vspace</i>
@netui:attribute required="false" rtexprvalue="true"
description="The vertical spacing around the HTML image tag."
|
[
"Sets",
"the",
"vertical",
"spacing",
"around",
"the",
"HTML",
"image",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L532-L534
|
146,406
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java
|
SqlStatement.setCallableStatement
|
private boolean setCallableStatement(Object[] args) {
// CallableStatement vs. PreparedStatement
if (args != null && args.length == 1 && args[0] != null) {
Class argClass = args[0].getClass();
if (argClass.isArray() && JdbcControl.SQLParameter.class.isAssignableFrom(argClass.getComponentType())) {
return true;
}
}
return false;
}
|
java
|
private boolean setCallableStatement(Object[] args) {
// CallableStatement vs. PreparedStatement
if (args != null && args.length == 1 && args[0] != null) {
Class argClass = args[0].getClass();
if (argClass.isArray() && JdbcControl.SQLParameter.class.isAssignableFrom(argClass.getComponentType())) {
return true;
}
}
return false;
}
|
[
"private",
"boolean",
"setCallableStatement",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"// CallableStatement vs. PreparedStatement",
"if",
"(",
"args",
"!=",
"null",
"&&",
"args",
".",
"length",
"==",
"1",
"&&",
"args",
"[",
"0",
"]",
"!=",
"null",
")",
"{",
"Class",
"argClass",
"=",
"args",
"[",
"0",
"]",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"argClass",
".",
"isArray",
"(",
")",
"&&",
"JdbcControl",
".",
"SQLParameter",
".",
"class",
".",
"isAssignableFrom",
"(",
"argClass",
".",
"getComponentType",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] |
Determine if this SQL will generate a callable or prepared statement.
@param args The method's argument list which this SQL annotation was assocatied with.
@return true if this statement will generated a CallableStatement
|
[
"Determine",
"if",
"this",
"SQL",
"will",
"generate",
"a",
"callable",
"or",
"prepared",
"statement",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java#L409-L419
|
146,407
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java
|
SqlStatement.doBatchUpdate
|
private void doBatchUpdate(PreparedStatement ps, Object[] args, Calendar cal) throws SQLException {
final int[] sqlTypes = new int[args.length];
final Object[] objArrays = new Object[args.length];
// build an array of type values and object arrays
for (int i = 0; i < args.length; i++) {
sqlTypes[i] = _tmf.getSqlType(args[i].getClass().getComponentType());
objArrays[i] = TypeMappingsFactory.toObjectArray(args[i]);
}
final int rowCount = ((Object[]) objArrays[0]).length;
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < args.length; j++) {
setPreparedStatementParameter(ps, j + 1, ((Object[]) objArrays[j])[i], sqlTypes[j], cal);
}
ps.addBatch();
}
}
|
java
|
private void doBatchUpdate(PreparedStatement ps, Object[] args, Calendar cal) throws SQLException {
final int[] sqlTypes = new int[args.length];
final Object[] objArrays = new Object[args.length];
// build an array of type values and object arrays
for (int i = 0; i < args.length; i++) {
sqlTypes[i] = _tmf.getSqlType(args[i].getClass().getComponentType());
objArrays[i] = TypeMappingsFactory.toObjectArray(args[i]);
}
final int rowCount = ((Object[]) objArrays[0]).length;
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < args.length; j++) {
setPreparedStatementParameter(ps, j + 1, ((Object[]) objArrays[j])[i], sqlTypes[j], cal);
}
ps.addBatch();
}
}
|
[
"private",
"void",
"doBatchUpdate",
"(",
"PreparedStatement",
"ps",
",",
"Object",
"[",
"]",
"args",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"final",
"int",
"[",
"]",
"sqlTypes",
"=",
"new",
"int",
"[",
"args",
".",
"length",
"]",
";",
"final",
"Object",
"[",
"]",
"objArrays",
"=",
"new",
"Object",
"[",
"args",
".",
"length",
"]",
";",
"// build an array of type values and object arrays",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",
"{",
"sqlTypes",
"[",
"i",
"]",
"=",
"_tmf",
".",
"getSqlType",
"(",
"args",
"[",
"i",
"]",
".",
"getClass",
"(",
")",
".",
"getComponentType",
"(",
")",
")",
";",
"objArrays",
"[",
"i",
"]",
"=",
"TypeMappingsFactory",
".",
"toObjectArray",
"(",
"args",
"[",
"i",
"]",
")",
";",
"}",
"final",
"int",
"rowCount",
"=",
"(",
"(",
"Object",
"[",
"]",
")",
"objArrays",
"[",
"0",
"]",
")",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"rowCount",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"args",
".",
"length",
";",
"j",
"++",
")",
"{",
"setPreparedStatementParameter",
"(",
"ps",
",",
"j",
"+",
"1",
",",
"(",
"(",
"Object",
"[",
"]",
")",
"objArrays",
"[",
"j",
"]",
")",
"[",
"i",
"]",
",",
"sqlTypes",
"[",
"j",
"]",
",",
"cal",
")",
";",
"}",
"ps",
".",
"addBatch",
"(",
")",
";",
"}",
"}"
] |
Build a prepared statement for a batch update.
@param ps The PreparedStatement object.
@param args The parameter list of the jdbccontrol method.
@param cal A Calendar instance used to resolve date/time values.
@throws SQLException If a batch update cannot be performed.
|
[
"Build",
"a",
"prepared",
"statement",
"for",
"a",
"batch",
"update",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java#L429-L447
|
146,408
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java
|
SqlStatement.loadSQLAnnotationStatmentOptions
|
private void loadSQLAnnotationStatmentOptions(ControlBeanContext context, Method method) {
final JdbcControl.SQL methodSQL = (JdbcControl.SQL) context.getMethodPropertySet(method, JdbcControl.SQL.class);
_batchUpdate = methodSQL.batchUpdate();
_getGeneratedKeys = methodSQL.getGeneratedKeys();
_genKeyColumnNames = methodSQL.generatedKeyColumnNames();
_genKeyColumnIndexes = methodSQL.generatedKeyColumnIndexes();
_scrollType = methodSQL.scrollableResultSet();
_fetchDirection = methodSQL.fetchDirection();
_fetchSize = methodSQL.fetchSize();
_maxRows = methodSQL.maxRows();
_maxArray = methodSQL.arrayMaxLength();
_holdability = methodSQL.resultSetHoldabilityOverride();
}
|
java
|
private void loadSQLAnnotationStatmentOptions(ControlBeanContext context, Method method) {
final JdbcControl.SQL methodSQL = (JdbcControl.SQL) context.getMethodPropertySet(method, JdbcControl.SQL.class);
_batchUpdate = methodSQL.batchUpdate();
_getGeneratedKeys = methodSQL.getGeneratedKeys();
_genKeyColumnNames = methodSQL.generatedKeyColumnNames();
_genKeyColumnIndexes = methodSQL.generatedKeyColumnIndexes();
_scrollType = methodSQL.scrollableResultSet();
_fetchDirection = methodSQL.fetchDirection();
_fetchSize = methodSQL.fetchSize();
_maxRows = methodSQL.maxRows();
_maxArray = methodSQL.arrayMaxLength();
_holdability = methodSQL.resultSetHoldabilityOverride();
}
|
[
"private",
"void",
"loadSQLAnnotationStatmentOptions",
"(",
"ControlBeanContext",
"context",
",",
"Method",
"method",
")",
"{",
"final",
"JdbcControl",
".",
"SQL",
"methodSQL",
"=",
"(",
"JdbcControl",
".",
"SQL",
")",
"context",
".",
"getMethodPropertySet",
"(",
"method",
",",
"JdbcControl",
".",
"SQL",
".",
"class",
")",
";",
"_batchUpdate",
"=",
"methodSQL",
".",
"batchUpdate",
"(",
")",
";",
"_getGeneratedKeys",
"=",
"methodSQL",
".",
"getGeneratedKeys",
"(",
")",
";",
"_genKeyColumnNames",
"=",
"methodSQL",
".",
"generatedKeyColumnNames",
"(",
")",
";",
"_genKeyColumnIndexes",
"=",
"methodSQL",
".",
"generatedKeyColumnIndexes",
"(",
")",
";",
"_scrollType",
"=",
"methodSQL",
".",
"scrollableResultSet",
"(",
")",
";",
"_fetchDirection",
"=",
"methodSQL",
".",
"fetchDirection",
"(",
")",
";",
"_fetchSize",
"=",
"methodSQL",
".",
"fetchSize",
"(",
")",
";",
"_maxRows",
"=",
"methodSQL",
".",
"maxRows",
"(",
")",
";",
"_maxArray",
"=",
"methodSQL",
".",
"arrayMaxLength",
"(",
")",
";",
"_holdability",
"=",
"methodSQL",
".",
"resultSetHoldabilityOverride",
"(",
")",
";",
"}"
] |
Load element values from the SQL annotation which apply to Statements.
@param context ControlBeanContext instance.
@param method Annotated method.
|
[
"Load",
"element",
"values",
"from",
"the",
"SQL",
"annotation",
"which",
"apply",
"to",
"Statements",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java#L455-L470
|
146,409
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java
|
SqlStatement.checkJdbcSupport
|
private void checkJdbcSupport(DatabaseMetaData metaData) throws SQLException {
if (_getGeneratedKeys && !metaData.supportsGetGeneratedKeys()) {
throw new ControlException("The database does not support getGeneratedKeys.");
}
if (_batchUpdate && !metaData.supportsBatchUpdates()) {
throw new ControlException("The database does not support batchUpdates.");
}
if (_scrollType != JdbcControl.ScrollType.DRIVER_DEFAULT
&& !metaData.supportsResultSetConcurrency(_scrollType.getType(), _scrollType.getConcurrencyType())) {
throw new ControlException("The database does not support the ResultSet concurrecy type: " + _scrollType.toString());
}
if (_holdability != JdbcControl.HoldabilityType.DRIVER_DEFAULT
&& !metaData.supportsResultSetHoldability(_holdability.getHoldability())) {
throw new ControlException("The database does not support the ResultSet holdability type: " + _holdability.toString());
}
}
|
java
|
private void checkJdbcSupport(DatabaseMetaData metaData) throws SQLException {
if (_getGeneratedKeys && !metaData.supportsGetGeneratedKeys()) {
throw new ControlException("The database does not support getGeneratedKeys.");
}
if (_batchUpdate && !metaData.supportsBatchUpdates()) {
throw new ControlException("The database does not support batchUpdates.");
}
if (_scrollType != JdbcControl.ScrollType.DRIVER_DEFAULT
&& !metaData.supportsResultSetConcurrency(_scrollType.getType(), _scrollType.getConcurrencyType())) {
throw new ControlException("The database does not support the ResultSet concurrecy type: " + _scrollType.toString());
}
if (_holdability != JdbcControl.HoldabilityType.DRIVER_DEFAULT
&& !metaData.supportsResultSetHoldability(_holdability.getHoldability())) {
throw new ControlException("The database does not support the ResultSet holdability type: " + _holdability.toString());
}
}
|
[
"private",
"void",
"checkJdbcSupport",
"(",
"DatabaseMetaData",
"metaData",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"_getGeneratedKeys",
"&&",
"!",
"metaData",
".",
"supportsGetGeneratedKeys",
"(",
")",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"The database does not support getGeneratedKeys.\"",
")",
";",
"}",
"if",
"(",
"_batchUpdate",
"&&",
"!",
"metaData",
".",
"supportsBatchUpdates",
"(",
")",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"The database does not support batchUpdates.\"",
")",
";",
"}",
"if",
"(",
"_scrollType",
"!=",
"JdbcControl",
".",
"ScrollType",
".",
"DRIVER_DEFAULT",
"&&",
"!",
"metaData",
".",
"supportsResultSetConcurrency",
"(",
"_scrollType",
".",
"getType",
"(",
")",
",",
"_scrollType",
".",
"getConcurrencyType",
"(",
")",
")",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"The database does not support the ResultSet concurrecy type: \"",
"+",
"_scrollType",
".",
"toString",
"(",
")",
")",
";",
"}",
"if",
"(",
"_holdability",
"!=",
"JdbcControl",
".",
"HoldabilityType",
".",
"DRIVER_DEFAULT",
"&&",
"!",
"metaData",
".",
"supportsResultSetHoldability",
"(",
"_holdability",
".",
"getHoldability",
"(",
")",
")",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"The database does not support the ResultSet holdability type: \"",
"+",
"_holdability",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] |
Checks that all statement options specified in annotation are supported by the database.
@param metaData
@throws SQLException
|
[
"Checks",
"that",
"all",
"statement",
"options",
"specified",
"in",
"annotation",
"are",
"supported",
"by",
"the",
"database",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java#L478-L497
|
146,410
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptEventField.java
|
AptEventField.initTypeParameterBindings
|
private void initTypeParameterBindings()
{
//
// Get an iterator to both the declared type arguments and the original type
// declaration on the associated control interface
//
DeclaredType fieldType = (DeclaredType)_fieldDecl.getType();
Iterator<TypeMirror> paramBoundIter = fieldType.getActualTypeArguments().iterator();
TypeDeclaration intfDecl = (TypeDeclaration)_controlIntf.getTypeDeclaration();
Iterator<TypeParameterDeclaration> paramDeclIter =
intfDecl.getFormalTypeParameters().iterator();
//
// Iterate through them in parallel, creating a mapping from the original formal
// type parameter name to the actual bound type. In parallel, also build up a
// representation of the bound type declaration.
//
// NOTE: If no type binding is done on the field declaration, then loop below
// will not execute and no mappings/empty bound decl will be the result.
//
StringBuffer sb = new StringBuffer();
boolean isFirst = true;
while (paramBoundIter.hasNext())
{
TypeMirror paramBound = paramBoundIter.next();
TypeParameterDeclaration paramDecl = paramDeclIter.next();
//
// Save a mapping from the formal type name to the bound mirror type
//
_typeBindingMap.put(paramDecl.getSimpleName(), paramBound);
if (isFirst)
{
sb.append("<");
isFirst = false;
}
else
sb.append(", ");
sb.append(paramBound);
}
if (!isFirst)
sb.append(">");
_boundParameterDecl = sb.toString();
}
|
java
|
private void initTypeParameterBindings()
{
//
// Get an iterator to both the declared type arguments and the original type
// declaration on the associated control interface
//
DeclaredType fieldType = (DeclaredType)_fieldDecl.getType();
Iterator<TypeMirror> paramBoundIter = fieldType.getActualTypeArguments().iterator();
TypeDeclaration intfDecl = (TypeDeclaration)_controlIntf.getTypeDeclaration();
Iterator<TypeParameterDeclaration> paramDeclIter =
intfDecl.getFormalTypeParameters().iterator();
//
// Iterate through them in parallel, creating a mapping from the original formal
// type parameter name to the actual bound type. In parallel, also build up a
// representation of the bound type declaration.
//
// NOTE: If no type binding is done on the field declaration, then loop below
// will not execute and no mappings/empty bound decl will be the result.
//
StringBuffer sb = new StringBuffer();
boolean isFirst = true;
while (paramBoundIter.hasNext())
{
TypeMirror paramBound = paramBoundIter.next();
TypeParameterDeclaration paramDecl = paramDeclIter.next();
//
// Save a mapping from the formal type name to the bound mirror type
//
_typeBindingMap.put(paramDecl.getSimpleName(), paramBound);
if (isFirst)
{
sb.append("<");
isFirst = false;
}
else
sb.append(", ");
sb.append(paramBound);
}
if (!isFirst)
sb.append(">");
_boundParameterDecl = sb.toString();
}
|
[
"private",
"void",
"initTypeParameterBindings",
"(",
")",
"{",
"//",
"// Get an iterator to both the declared type arguments and the original type",
"// declaration on the associated control interface",
"//",
"DeclaredType",
"fieldType",
"=",
"(",
"DeclaredType",
")",
"_fieldDecl",
".",
"getType",
"(",
")",
";",
"Iterator",
"<",
"TypeMirror",
">",
"paramBoundIter",
"=",
"fieldType",
".",
"getActualTypeArguments",
"(",
")",
".",
"iterator",
"(",
")",
";",
"TypeDeclaration",
"intfDecl",
"=",
"(",
"TypeDeclaration",
")",
"_controlIntf",
".",
"getTypeDeclaration",
"(",
")",
";",
"Iterator",
"<",
"TypeParameterDeclaration",
">",
"paramDeclIter",
"=",
"intfDecl",
".",
"getFormalTypeParameters",
"(",
")",
".",
"iterator",
"(",
")",
";",
"//",
"// Iterate through them in parallel, creating a mapping from the original formal",
"// type parameter name to the actual bound type. In parallel, also build up a",
"// representation of the bound type declaration.",
"//",
"// NOTE: If no type binding is done on the field declaration, then loop below",
"// will not execute and no mappings/empty bound decl will be the result.",
"//",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"boolean",
"isFirst",
"=",
"true",
";",
"while",
"(",
"paramBoundIter",
".",
"hasNext",
"(",
")",
")",
"{",
"TypeMirror",
"paramBound",
"=",
"paramBoundIter",
".",
"next",
"(",
")",
";",
"TypeParameterDeclaration",
"paramDecl",
"=",
"paramDeclIter",
".",
"next",
"(",
")",
";",
"//",
"// Save a mapping from the formal type name to the bound mirror type",
"//",
"_typeBindingMap",
".",
"put",
"(",
"paramDecl",
".",
"getSimpleName",
"(",
")",
",",
"paramBound",
")",
";",
"if",
"(",
"isFirst",
")",
"{",
"sb",
".",
"append",
"(",
"\"<\"",
")",
";",
"isFirst",
"=",
"false",
";",
"}",
"else",
"sb",
".",
"append",
"(",
"\", \"",
")",
";",
"sb",
".",
"append",
"(",
"paramBound",
")",
";",
"}",
"if",
"(",
"!",
"isFirst",
")",
"sb",
".",
"append",
"(",
"\">\"",
")",
";",
"_boundParameterDecl",
"=",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] |
Computes the binding from any formal type parameters declared on the control interface
to bound types on the field declaration.
|
[
"Computes",
"the",
"binding",
"from",
"any",
"formal",
"type",
"parameters",
"declared",
"on",
"the",
"control",
"interface",
"to",
"bound",
"types",
"on",
"the",
"field",
"declaration",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptEventField.java#L53-L99
|
146,411
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptEventField.java
|
AptEventField.getControlInterface
|
public AptControlInterface getControlInterface()
{
if (_controlIntf == null)
{
_controlIntf = initControlInterface();
if (_controlIntf != null)
initTypeParameterBindings();
}
return _controlIntf;
}
|
java
|
public AptControlInterface getControlInterface()
{
if (_controlIntf == null)
{
_controlIntf = initControlInterface();
if (_controlIntf != null)
initTypeParameterBindings();
}
return _controlIntf;
}
|
[
"public",
"AptControlInterface",
"getControlInterface",
"(",
")",
"{",
"if",
"(",
"_controlIntf",
"==",
"null",
")",
"{",
"_controlIntf",
"=",
"initControlInterface",
"(",
")",
";",
"if",
"(",
"_controlIntf",
"!=",
"null",
")",
"initTypeParameterBindings",
"(",
")",
";",
"}",
"return",
"_controlIntf",
";",
"}"
] |
Returns the ControlInterface associated with this event field
|
[
"Returns",
"the",
"ControlInterface",
"associated",
"with",
"this",
"event",
"field"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptEventField.java#L104-L113
|
146,412
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptEventField.java
|
AptEventField.addEventAdaptor
|
public void addEventAdaptor(AptEventSet eventSet, EventAdaptor eventAdaptor)
{
assert !_eventAdaptors.containsKey(eventSet);
_eventAdaptors.put(eventSet, eventAdaptor);
}
|
java
|
public void addEventAdaptor(AptEventSet eventSet, EventAdaptor eventAdaptor)
{
assert !_eventAdaptors.containsKey(eventSet);
_eventAdaptors.put(eventSet, eventAdaptor);
}
|
[
"public",
"void",
"addEventAdaptor",
"(",
"AptEventSet",
"eventSet",
",",
"EventAdaptor",
"eventAdaptor",
")",
"{",
"assert",
"!",
"_eventAdaptors",
".",
"containsKey",
"(",
"eventSet",
")",
";",
"_eventAdaptors",
".",
"put",
"(",
"eventSet",
",",
"eventAdaptor",
")",
";",
"}"
] |
Adds a EventAdaptor for a particular EventSet
|
[
"Adds",
"a",
"EventAdaptor",
"for",
"a",
"particular",
"EventSet"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptEventField.java#L126-L130
|
146,413
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setSummary
|
public void setSummary(String summary)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.SUMMARY, summary);
}
|
java
|
public void setSummary(String summary)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.SUMMARY, summary);
}
|
[
"public",
"void",
"setSummary",
"(",
"String",
"summary",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"SUMMARY",
",",
"summary",
")",
";",
"}"
] |
Sets the summary attribute for the HTML table tag.
@param summary the summary
@jsptagref.attributedescription The summary for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_summary</i>
@netui:attribute required="false" rtexprvalue="true"
description="The summary for the HTML table tag."
|
[
"Sets",
"the",
"summary",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L639-L642
|
146,414
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setWidth
|
public void setWidth(String width)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.WIDTH, width);
}
|
java
|
public void setWidth(String width)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.WIDTH, width);
}
|
[
"public",
"void",
"setWidth",
"(",
"String",
"width",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"WIDTH",
",",
"width",
")",
";",
"}"
] |
Sets the width attribute for the HTML table tag.
@param width the width
@jsptagref.attributedescription The width for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_width</i>
@netui:attribute required="false" rtexprvalue="true" description="The width attribute for the HTML table tag."
|
[
"Sets",
"the",
"width",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L651-L654
|
146,415
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setBorder
|
public void setBorder(String border)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.BORDER, border);
}
|
java
|
public void setBorder(String border)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.BORDER, border);
}
|
[
"public",
"void",
"setBorder",
"(",
"String",
"border",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"BORDER",
",",
"border",
")",
";",
"}"
] |
Sets the border attribute for the HTML table tag.
@param border
@jsptagref.attributedescription The border attribute for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_dir</i>
@netui:attribute required="false" rtexprvalue="true" description="The border attribute for the HTML table tag."
|
[
"Sets",
"the",
"border",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L663-L666
|
146,416
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setFrame
|
public void setFrame(String frame)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.FRAME, frame);
}
|
java
|
public void setFrame(String frame)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.FRAME, frame);
}
|
[
"public",
"void",
"setFrame",
"(",
"String",
"frame",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"FRAME",
",",
"frame",
")",
";",
"}"
] |
Sets the frame attribute for the HTML table tag.
@param frame the frame
@jsptagref.attributedescription The frame attribute for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_frame</i>
@netui:attribute required="false" rtexprvalue="true"
description="The frame for the HTML table tag."
|
[
"Sets",
"the",
"frame",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L676-L679
|
146,417
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setRules
|
public void setRules(String rules)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.RULES, rules);
}
|
java
|
public void setRules(String rules)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.RULES, rules);
}
|
[
"public",
"void",
"setRules",
"(",
"String",
"rules",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"RULES",
",",
"rules",
")",
";",
"}"
] |
Sets the rules attribute for the HTML table tag.
@param rules the rules
@jsptagref.attributedescription The rules attribute for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_rules</i>
@netui:attribute required="false" rtexprvalue="true" description="The rules attribute for the HTML table tag."
|
[
"Sets",
"the",
"rules",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L688-L691
|
146,418
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setCellspacing
|
public void setCellspacing(String cellspacing)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CELLSPACING, cellspacing);
}
|
java
|
public void setCellspacing(String cellspacing)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CELLSPACING, cellspacing);
}
|
[
"public",
"void",
"setCellspacing",
"(",
"String",
"cellspacing",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"CELLSPACING",
",",
"cellspacing",
")",
";",
"}"
] |
Sets the cellspacing attribute for the HTML table tag.
@param cellspacing the cell spacing
@jsptagref.attributedescription The cellspacing for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_cellspacing</i>
@netui:attribute required="false" rtexprvalue="true" description="The cellspacing for the HTML table tag."
|
[
"Sets",
"the",
"cellspacing",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L700-L703
|
146,419
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
|
DataGrid.setCellpadding
|
public void setCellpadding(String cellpadding)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CELLPADDING, cellpadding);
}
|
java
|
public void setCellpadding(String cellpadding)
{
_tableState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CELLPADDING, cellpadding);
}
|
[
"public",
"void",
"setCellpadding",
"(",
"String",
"cellpadding",
")",
"{",
"_tableState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"CELLPADDING",
",",
"cellpadding",
")",
";",
"}"
] |
Sets the cellpadding attribute for the HTML table tag.
@param cellpadding the cell padding
@jsptagref.attributedescription The cellpadding for the HTML table tag.
@jsptagref.attributesyntaxvalue <i>string_cellpadding</i>
@netui:attribute required="false" rtexprvalue="true" description="The cellpadding for the HTML table tag."
|
[
"Sets",
"the",
"cellpadding",
"attribute",
"for",
"the",
"HTML",
"table",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L712-L715
|
146,420
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java
|
DefaultIteratorResultSetMapper.mapToResultType
|
public Iterator mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
return new ResultSetIterator(context, m, resultSet, cal);
}
|
java
|
public Iterator mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
return new ResultSetIterator(context, m, resultSet, cal);
}
|
[
"public",
"Iterator",
"mapToResultType",
"(",
"ControlBeanContext",
"context",
",",
"Method",
"m",
",",
"ResultSet",
"resultSet",
",",
"Calendar",
"cal",
")",
"{",
"return",
"new",
"ResultSetIterator",
"(",
"context",
",",
"m",
",",
"resultSet",
",",
"cal",
")",
";",
"}"
] |
Map a ResultSet to an object type
Type of object to interate over is defined in the SQL annotation for the method.
@param context A ControlBeanContext instance, see Beehive controls javadoc for additional information
@param m Method assoicated with this call.
@param resultSet Result set to map.
@param cal A Calendar instance for time/date value resolution.
@return The Iterator object instance resulting from the ResultSet
|
[
"Map",
"a",
"ResultSet",
"to",
"an",
"object",
"type",
"Type",
"of",
"object",
"to",
"interate",
"over",
"is",
"defined",
"in",
"the",
"SQL",
"annotation",
"for",
"the",
"method",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultIteratorResultSetMapper.java#L44-L46
|
146,421
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/context/process/AbstractProcessContextContainer.java
|
AbstractProcessContextContainer.containsContextsWithACModel
|
public boolean containsContextsWithACModel(AbstractACModel acModel) {
for (ProcessContext context : getComponents()) {
if (context.getACModel().equals(acModel)) {
return true;
}
}
return false;
}
|
java
|
public boolean containsContextsWithACModel(AbstractACModel acModel) {
for (ProcessContext context : getComponents()) {
if (context.getACModel().equals(acModel)) {
return true;
}
}
return false;
}
|
[
"public",
"boolean",
"containsContextsWithACModel",
"(",
"AbstractACModel",
"acModel",
")",
"{",
"for",
"(",
"ProcessContext",
"context",
":",
"getComponents",
"(",
")",
")",
"{",
"if",
"(",
"context",
".",
"getACModel",
"(",
")",
".",
"equals",
"(",
"acModel",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] |
Checks if there are contexts whose access control model equals the given
model.
@param acModel The access control model.
@return <code>true</code> if there is at least one such context;<br>
<code>fasle</code> otherwise.
|
[
"Checks",
"if",
"there",
"are",
"contexts",
"whose",
"access",
"control",
"model",
"equals",
"the",
"given",
"model",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/AbstractProcessContextContainer.java#L59-L66
|
146,422
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/LogTrace.java
|
LogTrace.getEntriesForActivities
|
public List<E> getEntriesForActivities(Set<String> activities) {
Validate.noNullElements(activities);
List<E> result = new ArrayList<>();
for (E entry : logEntries) {
if (activities.contains(entry.getActivity())) {
result.add(entry);
}
}
return result;
}
|
java
|
public List<E> getEntriesForActivities(Set<String> activities) {
Validate.noNullElements(activities);
List<E> result = new ArrayList<>();
for (E entry : logEntries) {
if (activities.contains(entry.getActivity())) {
result.add(entry);
}
}
return result;
}
|
[
"public",
"List",
"<",
"E",
">",
"getEntriesForActivities",
"(",
"Set",
"<",
"String",
">",
"activities",
")",
"{",
"Validate",
".",
"noNullElements",
"(",
"activities",
")",
";",
"List",
"<",
"E",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"E",
"entry",
":",
"logEntries",
")",
"{",
"if",
"(",
"activities",
".",
"contains",
"(",
"entry",
".",
"getActivity",
"(",
")",
")",
")",
"{",
"result",
".",
"add",
"(",
"entry",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] |
Returns all log entries of this trace whose activities are in the given
activity set.
@param activities
@return
|
[
"Returns",
"all",
"log",
"entries",
"of",
"this",
"trace",
"whose",
"activities",
"are",
"in",
"the",
"given",
"activity",
"set",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/LogTrace.java#L58-L67
|
146,423
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/in/XesXmlParser.java
|
XesXmlParser.parse
|
public List<XLog> parse(InputStream is) throws Exception {
BufferedInputStream bis = new BufferedInputStream(is);
// set up a specialized SAX2 handler to fill the container
XesXmlHandler handler = new XesXmlHandler();
// set up SAX parser and parse provided log file into the container
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
parserFactory.setNamespaceAware(false);
SAXParser parser = parserFactory.newSAXParser();
parser.parse(bis, handler);
bis.close();
ArrayList<XLog> wrapper = new ArrayList<XLog>();
wrapper.add(handler.getLog());
return wrapper;
}
|
java
|
public List<XLog> parse(InputStream is) throws Exception {
BufferedInputStream bis = new BufferedInputStream(is);
// set up a specialized SAX2 handler to fill the container
XesXmlHandler handler = new XesXmlHandler();
// set up SAX parser and parse provided log file into the container
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
parserFactory.setNamespaceAware(false);
SAXParser parser = parserFactory.newSAXParser();
parser.parse(bis, handler);
bis.close();
ArrayList<XLog> wrapper = new ArrayList<XLog>();
wrapper.add(handler.getLog());
return wrapper;
}
|
[
"public",
"List",
"<",
"XLog",
">",
"parse",
"(",
"InputStream",
"is",
")",
"throws",
"Exception",
"{",
"BufferedInputStream",
"bis",
"=",
"new",
"BufferedInputStream",
"(",
"is",
")",
";",
"// set up a specialized SAX2 handler to fill the container",
"XesXmlHandler",
"handler",
"=",
"new",
"XesXmlHandler",
"(",
")",
";",
"// set up SAX parser and parse provided log file into the container",
"SAXParserFactory",
"parserFactory",
"=",
"SAXParserFactory",
".",
"newInstance",
"(",
")",
";",
"parserFactory",
".",
"setNamespaceAware",
"(",
"false",
")",
";",
"SAXParser",
"parser",
"=",
"parserFactory",
".",
"newSAXParser",
"(",
")",
";",
"parser",
".",
"parse",
"(",
"bis",
",",
"handler",
")",
";",
"bis",
".",
"close",
"(",
")",
";",
"ArrayList",
"<",
"XLog",
">",
"wrapper",
"=",
"new",
"ArrayList",
"<",
"XLog",
">",
"(",
")",
";",
"wrapper",
".",
"add",
"(",
"handler",
".",
"getLog",
"(",
")",
")",
";",
"return",
"wrapper",
";",
"}"
] |
Parses a log from the given input stream, which is supposed to deliver an
XES log in XML representation.
@param is
Input stream, which is supposed to deliver an XES log in XML
representation.
@return The parsed log.
|
[
"Parses",
"a",
"log",
"from",
"the",
"given",
"input",
"stream",
"which",
"is",
"supposed",
"to",
"deliver",
"an",
"XES",
"log",
"in",
"XML",
"representation",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/in/XesXmlParser.java#L167-L180
|
146,424
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractSimpleTag.java
|
AbstractSimpleTag.getPageContext
|
protected PageContext getPageContext()
{
JspContext ctxt = getJspContext();
if (ctxt instanceof PageContext)
return (PageContext) ctxt;
// assert the page context and log an error in production
assert(false) : "The JspContext was not a PageContext";
logger.error("The JspContext was not a PageContext");
return null;
}
|
java
|
protected PageContext getPageContext()
{
JspContext ctxt = getJspContext();
if (ctxt instanceof PageContext)
return (PageContext) ctxt;
// assert the page context and log an error in production
assert(false) : "The JspContext was not a PageContext";
logger.error("The JspContext was not a PageContext");
return null;
}
|
[
"protected",
"PageContext",
"getPageContext",
"(",
")",
"{",
"JspContext",
"ctxt",
"=",
"getJspContext",
"(",
")",
";",
"if",
"(",
"ctxt",
"instanceof",
"PageContext",
")",
"return",
"(",
"PageContext",
")",
"ctxt",
";",
"// assert the page context and log an error in production",
"assert",
"(",
"false",
")",
":",
"\"The JspContext was not a PageContext\"",
";",
"logger",
".",
"error",
"(",
"\"The JspContext was not a PageContext\"",
")",
";",
"return",
"null",
";",
"}"
] |
This method will attempt to cast the JspContext into a PageContext. If this fails,
it will log an exception.
@return PageContext
|
[
"This",
"method",
"will",
"attempt",
"to",
"cast",
"the",
"JspContext",
"into",
"a",
"PageContext",
".",
"If",
"this",
"fails",
"it",
"will",
"log",
"an",
"exception",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractSimpleTag.java#L130-L140
|
146,425
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractSimpleTag.java
|
AbstractSimpleTag.getHtmlTag
|
protected IScriptReporter getHtmlTag(ServletRequest req)
{
Html html = (Html) req.getAttribute(Html.HTML_TAG_ID);
if (html != null && html instanceof IScriptReporter)
return (IScriptReporter) html;
return null;
}
|
java
|
protected IScriptReporter getHtmlTag(ServletRequest req)
{
Html html = (Html) req.getAttribute(Html.HTML_TAG_ID);
if (html != null && html instanceof IScriptReporter)
return (IScriptReporter) html;
return null;
}
|
[
"protected",
"IScriptReporter",
"getHtmlTag",
"(",
"ServletRequest",
"req",
")",
"{",
"Html",
"html",
"=",
"(",
"Html",
")",
"req",
".",
"getAttribute",
"(",
"Html",
".",
"HTML_TAG_ID",
")",
";",
"if",
"(",
"html",
"!=",
"null",
"&&",
"html",
"instanceof",
"IScriptReporter",
")",
"return",
"(",
"IScriptReporter",
")",
"html",
";",
"return",
"null",
";",
"}"
] |
This method will return the scriptReporter that is represented by the HTML tag.
@return IScriptReporter
|
[
"This",
"method",
"will",
"return",
"the",
"scriptReporter",
"that",
"is",
"represented",
"by",
"the",
"HTML",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractSimpleTag.java#L255-L261
|
146,426
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/FlowControllerInfo.java
|
FlowControllerInfo.addReturnAction
|
public TypeInstance addReturnAction( String returnActionName, AnnotationInstance annotation, TypeDeclaration outerType )
{
TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
if ( formBeanType == null )
{
String memberFieldName = CompilerUtils.getString( annotation, OUTPUT_FORM_BEAN_ATTR, true );
if ( memberFieldName != null )
{
FieldDeclaration field = CompilerUtils.findField( outerType, memberFieldName );
if ( field != null ) formBeanType = field.getType();
}
}
String formTypeName =
formBeanType != null && formBeanType instanceof DeclaredType
? CompilerUtils.getDeclaration( ( DeclaredType ) formBeanType ).getQualifiedName()
: null;
addReturnAction( returnActionName, formTypeName );
return formBeanType;
}
|
java
|
public TypeInstance addReturnAction( String returnActionName, AnnotationInstance annotation, TypeDeclaration outerType )
{
TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
if ( formBeanType == null )
{
String memberFieldName = CompilerUtils.getString( annotation, OUTPUT_FORM_BEAN_ATTR, true );
if ( memberFieldName != null )
{
FieldDeclaration field = CompilerUtils.findField( outerType, memberFieldName );
if ( field != null ) formBeanType = field.getType();
}
}
String formTypeName =
formBeanType != null && formBeanType instanceof DeclaredType
? CompilerUtils.getDeclaration( ( DeclaredType ) formBeanType ).getQualifiedName()
: null;
addReturnAction( returnActionName, formTypeName );
return formBeanType;
}
|
[
"public",
"TypeInstance",
"addReturnAction",
"(",
"String",
"returnActionName",
",",
"AnnotationInstance",
"annotation",
",",
"TypeDeclaration",
"outerType",
")",
"{",
"TypeInstance",
"formBeanType",
"=",
"CompilerUtils",
".",
"getTypeInstance",
"(",
"annotation",
",",
"OUTPUT_FORM_BEAN_TYPE_ATTR",
",",
"true",
")",
";",
"if",
"(",
"formBeanType",
"==",
"null",
")",
"{",
"String",
"memberFieldName",
"=",
"CompilerUtils",
".",
"getString",
"(",
"annotation",
",",
"OUTPUT_FORM_BEAN_ATTR",
",",
"true",
")",
";",
"if",
"(",
"memberFieldName",
"!=",
"null",
")",
"{",
"FieldDeclaration",
"field",
"=",
"CompilerUtils",
".",
"findField",
"(",
"outerType",
",",
"memberFieldName",
")",
";",
"if",
"(",
"field",
"!=",
"null",
")",
"formBeanType",
"=",
"field",
".",
"getType",
"(",
")",
";",
"}",
"}",
"String",
"formTypeName",
"=",
"formBeanType",
"!=",
"null",
"&&",
"formBeanType",
"instanceof",
"DeclaredType",
"?",
"CompilerUtils",
".",
"getDeclaration",
"(",
"(",
"DeclaredType",
")",
"formBeanType",
")",
".",
"getQualifiedName",
"(",
")",
":",
"null",
";",
"addReturnAction",
"(",
"returnActionName",
",",
"formTypeName",
")",
";",
"return",
"formBeanType",
";",
"}"
] |
Add a return-action from an annotation.
@return the form bean type, or null</code> if there is no form bean.
|
[
"Add",
"a",
"return",
"-",
"action",
"from",
"an",
"annotation",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/FlowControllerInfo.java#L320-L341
|
146,427
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java
|
ServletTreeRenderSupport.registerTagError
|
protected void registerTagError(String message, Throwable e)
throws JspException
{
System.err.println("Error in rendering tree:" + message);
logger.error(message, e);
}
|
java
|
protected void registerTagError(String message, Throwable e)
throws JspException
{
System.err.println("Error in rendering tree:" + message);
logger.error(message, e);
}
|
[
"protected",
"void",
"registerTagError",
"(",
"String",
"message",
",",
"Throwable",
"e",
")",
"throws",
"JspException",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Error in rendering tree:\"",
"+",
"message",
")",
";",
"logger",
".",
"error",
"(",
"message",
",",
"e",
")",
";",
"}"
] |
Errors during rendering will call through this method. During the XmlHttpRequest, these
will just be logged and we will go on.
@param message
@param e
@throws JspException
|
[
"Errors",
"during",
"rendering",
"will",
"call",
"through",
"this",
"method",
".",
"During",
"the",
"XmlHttpRequest",
"these",
"will",
"just",
"be",
"logged",
"and",
"we",
"will",
"go",
"on",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java#L65-L70
|
146,428
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/out/XesXmlSerializer.java
|
XesXmlSerializer.addGlobalAttributes
|
protected void addGlobalAttributes(SXTag parent, String scope,
List<XAttribute> attributes) throws IOException {
if (attributes.size() > 0) {
SXTag guaranteedNode = parent.addChildNode("global");
guaranteedNode.addAttribute("scope", scope);
addAttributes(guaranteedNode, attributes);
}
}
|
java
|
protected void addGlobalAttributes(SXTag parent, String scope,
List<XAttribute> attributes) throws IOException {
if (attributes.size() > 0) {
SXTag guaranteedNode = parent.addChildNode("global");
guaranteedNode.addAttribute("scope", scope);
addAttributes(guaranteedNode, attributes);
}
}
|
[
"protected",
"void",
"addGlobalAttributes",
"(",
"SXTag",
"parent",
",",
"String",
"scope",
",",
"List",
"<",
"XAttribute",
">",
"attributes",
")",
"throws",
"IOException",
"{",
"if",
"(",
"attributes",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"SXTag",
"guaranteedNode",
"=",
"parent",
".",
"addChildNode",
"(",
"\"global\"",
")",
";",
"guaranteedNode",
".",
"addAttribute",
"(",
"\"scope\"",
",",
"scope",
")",
";",
"addAttributes",
"(",
"guaranteedNode",
",",
"attributes",
")",
";",
"}",
"}"
] |
Helper method for defining global attributes on a given scope.
|
[
"Helper",
"method",
"for",
"defining",
"global",
"attributes",
"on",
"a",
"given",
"scope",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/out/XesXmlSerializer.java#L183-L190
|
146,429
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/out/XesXmlSerializer.java
|
XesXmlSerializer.addAttributes
|
protected void addAttributes(SXTag tag, Collection<XAttribute> attributes)
throws IOException {
for (XAttribute attribute : attributes) {
SXTag attributeTag;
if (attribute instanceof XAttributeList) {
attributeTag = tag.addChildNode("list");
attributeTag.addAttribute("key", attribute.getKey());
} else if (attribute instanceof XAttributeContainer) {
attributeTag = tag.addChildNode("container");
attributeTag.addAttribute("key", attribute.getKey());
} else if (attribute instanceof XAttributeLiteral) {
attributeTag = tag.addChildNode("string");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeDiscrete) {
attributeTag = tag.addChildNode("int");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeContinuous) {
attributeTag = tag.addChildNode("float");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeTimestamp) {
attributeTag = tag.addChildNode("date");
attributeTag.addAttribute("key", attribute.getKey());
Date timestamp = ((XAttributeTimestamp) attribute).getValue();
attributeTag.addAttribute("value",
xsDateTimeConversion.format(timestamp));
} else if (attribute instanceof XAttributeBoolean) {
attributeTag = tag.addChildNode("boolean");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeID) {
attributeTag = tag.addChildNode("id");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else {
throw new IOException("Unknown attribute type!");
}
if (attribute instanceof XAttributeCollection) {
/*
* Use order as specified by the collection.
*/
Collection<XAttribute> childAttributes = ((XAttributeCollection) attribute).getCollection();
addAttributes(attributeTag, childAttributes);
} else {
addAttributes(attributeTag, attribute.getAttributes().values());
}
}
}
|
java
|
protected void addAttributes(SXTag tag, Collection<XAttribute> attributes)
throws IOException {
for (XAttribute attribute : attributes) {
SXTag attributeTag;
if (attribute instanceof XAttributeList) {
attributeTag = tag.addChildNode("list");
attributeTag.addAttribute("key", attribute.getKey());
} else if (attribute instanceof XAttributeContainer) {
attributeTag = tag.addChildNode("container");
attributeTag.addAttribute("key", attribute.getKey());
} else if (attribute instanceof XAttributeLiteral) {
attributeTag = tag.addChildNode("string");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeDiscrete) {
attributeTag = tag.addChildNode("int");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeContinuous) {
attributeTag = tag.addChildNode("float");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeTimestamp) {
attributeTag = tag.addChildNode("date");
attributeTag.addAttribute("key", attribute.getKey());
Date timestamp = ((XAttributeTimestamp) attribute).getValue();
attributeTag.addAttribute("value",
xsDateTimeConversion.format(timestamp));
} else if (attribute instanceof XAttributeBoolean) {
attributeTag = tag.addChildNode("boolean");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else if (attribute instanceof XAttributeID) {
attributeTag = tag.addChildNode("id");
attributeTag.addAttribute("key", attribute.getKey());
attributeTag.addAttribute("value", attribute.toString());
} else {
throw new IOException("Unknown attribute type!");
}
if (attribute instanceof XAttributeCollection) {
/*
* Use order as specified by the collection.
*/
Collection<XAttribute> childAttributes = ((XAttributeCollection) attribute).getCollection();
addAttributes(attributeTag, childAttributes);
} else {
addAttributes(attributeTag, attribute.getAttributes().values());
}
}
}
|
[
"protected",
"void",
"addAttributes",
"(",
"SXTag",
"tag",
",",
"Collection",
"<",
"XAttribute",
">",
"attributes",
")",
"throws",
"IOException",
"{",
"for",
"(",
"XAttribute",
"attribute",
":",
"attributes",
")",
"{",
"SXTag",
"attributeTag",
";",
"if",
"(",
"attribute",
"instanceof",
"XAttributeList",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"list\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeContainer",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"container\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeLiteral",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"string\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"value\"",
",",
"attribute",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeDiscrete",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"int\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"value\"",
",",
"attribute",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeContinuous",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"float\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"value\"",
",",
"attribute",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeTimestamp",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"date\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"Date",
"timestamp",
"=",
"(",
"(",
"XAttributeTimestamp",
")",
"attribute",
")",
".",
"getValue",
"(",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"value\"",
",",
"xsDateTimeConversion",
".",
"format",
"(",
"timestamp",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeBoolean",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"boolean\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"value\"",
",",
"attribute",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"attribute",
"instanceof",
"XAttributeID",
")",
"{",
"attributeTag",
"=",
"tag",
".",
"addChildNode",
"(",
"\"id\"",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"key\"",
",",
"attribute",
".",
"getKey",
"(",
")",
")",
";",
"attributeTag",
".",
"addAttribute",
"(",
"\"value\"",
",",
"attribute",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"IOException",
"(",
"\"Unknown attribute type!\"",
")",
";",
"}",
"if",
"(",
"attribute",
"instanceof",
"XAttributeCollection",
")",
"{",
"/*\n\t\t\t\t * Use order as specified by the collection.\n\t\t\t\t */",
"Collection",
"<",
"XAttribute",
">",
"childAttributes",
"=",
"(",
"(",
"XAttributeCollection",
")",
"attribute",
")",
".",
"getCollection",
"(",
")",
";",
"addAttributes",
"(",
"attributeTag",
",",
"childAttributes",
")",
";",
"}",
"else",
"{",
"addAttributes",
"(",
"attributeTag",
",",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"values",
"(",
")",
")",
";",
"}",
"}",
"}"
] |
Helper method, adds the given collection of attributes to the given Tag.
@param tag
Tag to add attributes to.
@param attributes
The attributes to add.
|
[
"Helper",
"method",
"adds",
"the",
"given",
"collection",
"of",
"attributes",
"to",
"the",
"given",
"Tag",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/out/XesXmlSerializer.java#L200-L249
|
146,430
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XFastEventList.java
|
XFastEventList.consolidate
|
public synchronized boolean consolidate() throws IOException {
if (isTainted()) {
// proceed with consolidation
XSequentialEventBuffer nBuffer = new XSequentialEventBuffer(buffer
.getProvider(), this.attributeMapSerializer);
int overflowIndex = 0;
int fileBufferIndex = 0;
for (int i = 0; i < size; i++) {
if (overflowIndex < overflowSize
&& overflowIndices[overflowIndex] == i) {
nBuffer.append(overflowEntries[overflowIndex]);
overflowIndex++;
} else {
while (holeFlags.get(fileBufferIndex) == true) {
fileBufferIndex++;
}
nBuffer.append(buffer.get(fileBufferIndex));
fileBufferIndex++;
}
}
buffer.cleanup();
buffer = nBuffer;
overflowSize = 0;
holeFlags.clear();
return true;
} else {
return false;
}
}
|
java
|
public synchronized boolean consolidate() throws IOException {
if (isTainted()) {
// proceed with consolidation
XSequentialEventBuffer nBuffer = new XSequentialEventBuffer(buffer
.getProvider(), this.attributeMapSerializer);
int overflowIndex = 0;
int fileBufferIndex = 0;
for (int i = 0; i < size; i++) {
if (overflowIndex < overflowSize
&& overflowIndices[overflowIndex] == i) {
nBuffer.append(overflowEntries[overflowIndex]);
overflowIndex++;
} else {
while (holeFlags.get(fileBufferIndex) == true) {
fileBufferIndex++;
}
nBuffer.append(buffer.get(fileBufferIndex));
fileBufferIndex++;
}
}
buffer.cleanup();
buffer = nBuffer;
overflowSize = 0;
holeFlags.clear();
return true;
} else {
return false;
}
}
|
[
"public",
"synchronized",
"boolean",
"consolidate",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isTainted",
"(",
")",
")",
"{",
"// proceed with consolidation",
"XSequentialEventBuffer",
"nBuffer",
"=",
"new",
"XSequentialEventBuffer",
"(",
"buffer",
".",
"getProvider",
"(",
")",
",",
"this",
".",
"attributeMapSerializer",
")",
";",
"int",
"overflowIndex",
"=",
"0",
";",
"int",
"fileBufferIndex",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"if",
"(",
"overflowIndex",
"<",
"overflowSize",
"&&",
"overflowIndices",
"[",
"overflowIndex",
"]",
"==",
"i",
")",
"{",
"nBuffer",
".",
"append",
"(",
"overflowEntries",
"[",
"overflowIndex",
"]",
")",
";",
"overflowIndex",
"++",
";",
"}",
"else",
"{",
"while",
"(",
"holeFlags",
".",
"get",
"(",
"fileBufferIndex",
")",
"==",
"true",
")",
"{",
"fileBufferIndex",
"++",
";",
"}",
"nBuffer",
".",
"append",
"(",
"buffer",
".",
"get",
"(",
"fileBufferIndex",
")",
")",
";",
"fileBufferIndex",
"++",
";",
"}",
"}",
"buffer",
".",
"cleanup",
"(",
")",
";",
"buffer",
"=",
"nBuffer",
";",
"overflowSize",
"=",
"0",
";",
"holeFlags",
".",
"clear",
"(",
")",
";",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}"
] |
Consolidates this fast event list. Consolidation implies, that all
overflow and skipping data structures are freed, and the buffered
representation is brought completely in-line with the virtual current
contents of the list.
The actual consolidation will be skipped, if no need for it is detected
by the algorithm.
@return Whether consolidation has been performed.
|
[
"Consolidates",
"this",
"fast",
"event",
"list",
".",
"Consolidation",
"implies",
"that",
"all",
"overflow",
"and",
"skipping",
"data",
"structures",
"are",
"freed",
"and",
"the",
"buffered",
"representation",
"is",
"brought",
"completely",
"in",
"-",
"line",
"with",
"the",
"virtual",
"current",
"contents",
"of",
"the",
"list",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XFastEventList.java#L148-L176
|
146,431
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XFastEventList.java
|
XFastEventList.get
|
public synchronized XEvent get(int index) throws IndexOutOfBoundsException,
IOException {
if (index < 0 || index >= size) {
throw new IndexOutOfBoundsException();
}
int bufferIndex = index;
// correct buffer index from overflow
for (int i = 0; i < overflowSize; i++) {
if (overflowIndices[i] == index) {
return overflowEntries[i];
} else if (overflowIndices[i] < index) {
bufferIndex--;
} else {
break;
}
}
// determine deleted offset
// step over flagged indices and adjust buffer index upwards
// respectively
for (int hole = holeFlags.nextSetBit(0); hole >= 0
&& hole <= bufferIndex; hole = holeFlags.nextSetBit(hole + 1)) {
bufferIndex++;
}
// buffer index should now point to the corresponding index
// within the file buffer, so return it
return buffer.get(bufferIndex);
}
|
java
|
public synchronized XEvent get(int index) throws IndexOutOfBoundsException,
IOException {
if (index < 0 || index >= size) {
throw new IndexOutOfBoundsException();
}
int bufferIndex = index;
// correct buffer index from overflow
for (int i = 0; i < overflowSize; i++) {
if (overflowIndices[i] == index) {
return overflowEntries[i];
} else if (overflowIndices[i] < index) {
bufferIndex--;
} else {
break;
}
}
// determine deleted offset
// step over flagged indices and adjust buffer index upwards
// respectively
for (int hole = holeFlags.nextSetBit(0); hole >= 0
&& hole <= bufferIndex; hole = holeFlags.nextSetBit(hole + 1)) {
bufferIndex++;
}
// buffer index should now point to the corresponding index
// within the file buffer, so return it
return buffer.get(bufferIndex);
}
|
[
"public",
"synchronized",
"XEvent",
"get",
"(",
"int",
"index",
")",
"throws",
"IndexOutOfBoundsException",
",",
"IOException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"int",
"bufferIndex",
"=",
"index",
";",
"// correct buffer index from overflow",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"overflowSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
"==",
"index",
")",
"{",
"return",
"overflowEntries",
"[",
"i",
"]",
";",
"}",
"else",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
"<",
"index",
")",
"{",
"bufferIndex",
"--",
";",
"}",
"else",
"{",
"break",
";",
"}",
"}",
"// determine deleted offset",
"// step over flagged indices and adjust buffer index upwards",
"// respectively",
"for",
"(",
"int",
"hole",
"=",
"holeFlags",
".",
"nextSetBit",
"(",
"0",
")",
";",
"hole",
">=",
"0",
"&&",
"hole",
"<=",
"bufferIndex",
";",
"hole",
"=",
"holeFlags",
".",
"nextSetBit",
"(",
"hole",
"+",
"1",
")",
")",
"{",
"bufferIndex",
"++",
";",
"}",
"// buffer index should now point to the corresponding index",
"// within the file buffer, so return it",
"return",
"buffer",
".",
"get",
"(",
"bufferIndex",
")",
";",
"}"
] |
Retrieves an event at a specific index in the list.
@param index
Index of the required event in the list.
@return The requested event.
|
[
"Retrieves",
"an",
"event",
"at",
"a",
"specific",
"index",
"in",
"the",
"list",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XFastEventList.java#L185-L211
|
146,432
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XFastEventList.java
|
XFastEventList.insert
|
public synchronized void insert(XEvent event, int index)
throws IndexOutOfBoundsException, IOException {
if (index < 0 || index > size) {
throw new IndexOutOfBoundsException();
}
// check if we can append
if (index == size) {
append(event);
return;
}
// adjust size and overflow size
size++;
overflowSize++;
// add to overflow set
for (int i = overflowSize - 2; i >= 0; i--) {
if (overflowIndices[i] >= index) {
overflowIndices[i + 1] = overflowIndices[i] + 1;
overflowEntries[i + 1] = overflowEntries[i];
} else {
overflowIndices[i + 1] = index;
overflowEntries[i + 1] = event;
if (overflowSize == overflowIndices.length) {
consolidate();
}
return;
}
}
// if we arrive here, we must insert at zero
overflowIndices[0] = index;
overflowEntries[0] = event;
if (overflowSize == overflowIndices.length) {
consolidate();
}
}
|
java
|
public synchronized void insert(XEvent event, int index)
throws IndexOutOfBoundsException, IOException {
if (index < 0 || index > size) {
throw new IndexOutOfBoundsException();
}
// check if we can append
if (index == size) {
append(event);
return;
}
// adjust size and overflow size
size++;
overflowSize++;
// add to overflow set
for (int i = overflowSize - 2; i >= 0; i--) {
if (overflowIndices[i] >= index) {
overflowIndices[i + 1] = overflowIndices[i] + 1;
overflowEntries[i + 1] = overflowEntries[i];
} else {
overflowIndices[i + 1] = index;
overflowEntries[i + 1] = event;
if (overflowSize == overflowIndices.length) {
consolidate();
}
return;
}
}
// if we arrive here, we must insert at zero
overflowIndices[0] = index;
overflowEntries[0] = event;
if (overflowSize == overflowIndices.length) {
consolidate();
}
}
|
[
"public",
"synchronized",
"void",
"insert",
"(",
"XEvent",
"event",
",",
"int",
"index",
")",
"throws",
"IndexOutOfBoundsException",
",",
"IOException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"// check if we can append",
"if",
"(",
"index",
"==",
"size",
")",
"{",
"append",
"(",
"event",
")",
";",
"return",
";",
"}",
"// adjust size and overflow size",
"size",
"++",
";",
"overflowSize",
"++",
";",
"// add to overflow set",
"for",
"(",
"int",
"i",
"=",
"overflowSize",
"-",
"2",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
">=",
"index",
")",
"{",
"overflowIndices",
"[",
"i",
"+",
"1",
"]",
"=",
"overflowIndices",
"[",
"i",
"]",
"+",
"1",
";",
"overflowEntries",
"[",
"i",
"+",
"1",
"]",
"=",
"overflowEntries",
"[",
"i",
"]",
";",
"}",
"else",
"{",
"overflowIndices",
"[",
"i",
"+",
"1",
"]",
"=",
"index",
";",
"overflowEntries",
"[",
"i",
"+",
"1",
"]",
"=",
"event",
";",
"if",
"(",
"overflowSize",
"==",
"overflowIndices",
".",
"length",
")",
"{",
"consolidate",
"(",
")",
";",
"}",
"return",
";",
"}",
"}",
"// if we arrive here, we must insert at zero",
"overflowIndices",
"[",
"0",
"]",
"=",
"index",
";",
"overflowEntries",
"[",
"0",
"]",
"=",
"event",
";",
"if",
"(",
"overflowSize",
"==",
"overflowIndices",
".",
"length",
")",
"{",
"consolidate",
"(",
")",
";",
"}",
"}"
] |
Inserts an event at a given index into the list.
@param event
The event to be inserted.
@param index
Requested index of the inserted event.
|
[
"Inserts",
"an",
"event",
"at",
"a",
"given",
"index",
"into",
"the",
"list",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XFastEventList.java#L221-L254
|
146,433
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XFastEventList.java
|
XFastEventList.remove
|
public synchronized XEvent remove(int index)
throws IndexOutOfBoundsException, IOException {
// check overflow list and adjust indices
XEvent removed = null;
int smallerOverflow = 0;
for (int i = 0; i < overflowSize; i++) {
if (overflowIndices[i] == index) {
removed = overflowEntries[i];
} else if (overflowIndices[i] > index) {
overflowIndices[i] = overflowIndices[i] - 1;
if (removed != null) {
// move left
overflowIndices[i - 1] = overflowIndices[i];
overflowEntries[i - 1] = overflowEntries[i];
}
} else if (overflowIndices[i] < index) {
smallerOverflow++;
}
}
if (removed != null) {
// adjust overflow size
overflowSize--;
// invalidate entry in overflow set
overflowIndices[overflowSize] = -1;
overflowEntries[overflowSize] = null;
} else {
int bufferIndex = index - smallerOverflow;
for (int hole = holeFlags.nextSetBit(0); hole >= 0
&& hole <= bufferIndex; hole = holeFlags
.nextSetBit(hole + 1)) {
bufferIndex++;
}
removed = buffer.get(bufferIndex);
holeFlags.set(bufferIndex, true);
}
size--;
return removed;
}
|
java
|
public synchronized XEvent remove(int index)
throws IndexOutOfBoundsException, IOException {
// check overflow list and adjust indices
XEvent removed = null;
int smallerOverflow = 0;
for (int i = 0; i < overflowSize; i++) {
if (overflowIndices[i] == index) {
removed = overflowEntries[i];
} else if (overflowIndices[i] > index) {
overflowIndices[i] = overflowIndices[i] - 1;
if (removed != null) {
// move left
overflowIndices[i - 1] = overflowIndices[i];
overflowEntries[i - 1] = overflowEntries[i];
}
} else if (overflowIndices[i] < index) {
smallerOverflow++;
}
}
if (removed != null) {
// adjust overflow size
overflowSize--;
// invalidate entry in overflow set
overflowIndices[overflowSize] = -1;
overflowEntries[overflowSize] = null;
} else {
int bufferIndex = index - smallerOverflow;
for (int hole = holeFlags.nextSetBit(0); hole >= 0
&& hole <= bufferIndex; hole = holeFlags
.nextSetBit(hole + 1)) {
bufferIndex++;
}
removed = buffer.get(bufferIndex);
holeFlags.set(bufferIndex, true);
}
size--;
return removed;
}
|
[
"public",
"synchronized",
"XEvent",
"remove",
"(",
"int",
"index",
")",
"throws",
"IndexOutOfBoundsException",
",",
"IOException",
"{",
"// check overflow list and adjust indices",
"XEvent",
"removed",
"=",
"null",
";",
"int",
"smallerOverflow",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"overflowSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
"==",
"index",
")",
"{",
"removed",
"=",
"overflowEntries",
"[",
"i",
"]",
";",
"}",
"else",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
">",
"index",
")",
"{",
"overflowIndices",
"[",
"i",
"]",
"=",
"overflowIndices",
"[",
"i",
"]",
"-",
"1",
";",
"if",
"(",
"removed",
"!=",
"null",
")",
"{",
"// move left",
"overflowIndices",
"[",
"i",
"-",
"1",
"]",
"=",
"overflowIndices",
"[",
"i",
"]",
";",
"overflowEntries",
"[",
"i",
"-",
"1",
"]",
"=",
"overflowEntries",
"[",
"i",
"]",
";",
"}",
"}",
"else",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
"<",
"index",
")",
"{",
"smallerOverflow",
"++",
";",
"}",
"}",
"if",
"(",
"removed",
"!=",
"null",
")",
"{",
"// adjust overflow size",
"overflowSize",
"--",
";",
"// invalidate entry in overflow set",
"overflowIndices",
"[",
"overflowSize",
"]",
"=",
"-",
"1",
";",
"overflowEntries",
"[",
"overflowSize",
"]",
"=",
"null",
";",
"}",
"else",
"{",
"int",
"bufferIndex",
"=",
"index",
"-",
"smallerOverflow",
";",
"for",
"(",
"int",
"hole",
"=",
"holeFlags",
".",
"nextSetBit",
"(",
"0",
")",
";",
"hole",
">=",
"0",
"&&",
"hole",
"<=",
"bufferIndex",
";",
"hole",
"=",
"holeFlags",
".",
"nextSetBit",
"(",
"hole",
"+",
"1",
")",
")",
"{",
"bufferIndex",
"++",
";",
"}",
"removed",
"=",
"buffer",
".",
"get",
"(",
"bufferIndex",
")",
";",
"holeFlags",
".",
"set",
"(",
"bufferIndex",
",",
"true",
")",
";",
"}",
"size",
"--",
";",
"return",
"removed",
";",
"}"
] |
Removes the event at the given index from this list.
@param index
Index of the event to be removed.
@return The removed event.
|
[
"Removes",
"the",
"event",
"at",
"the",
"given",
"index",
"from",
"this",
"list",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XFastEventList.java#L316-L353
|
146,434
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XFastEventList.java
|
XFastEventList.replace
|
public synchronized XEvent replace(XEvent event, int index)
throws IndexOutOfBoundsException, IOException {
// check overflow list and adjust indices
XEvent replaced = null;
int smallerOverflow = 0;
for (int i = 0; i < overflowSize; i++) {
if (overflowIndices[i] == index) {
replaced = overflowEntries[i];
overflowEntries[i] = event;
return replaced;
} else if (overflowIndices[i] > index) {
// done
break;
} else if (overflowIndices[i] < index) {
smallerOverflow++;
}
}
// still here: we must look in file buffer
int bufferIndex = index - smallerOverflow;
for (int hole = holeFlags.nextSetBit(0); hole >= 0
&& hole <= bufferIndex; hole = holeFlags.nextSetBit(hole + 1)) {
bufferIndex++;
}
replaced = buffer.get(bufferIndex);
if (buffer.replace(event, bufferIndex) == false) {
remove(index);
insert(event, index);
}
return replaced;
}
|
java
|
public synchronized XEvent replace(XEvent event, int index)
throws IndexOutOfBoundsException, IOException {
// check overflow list and adjust indices
XEvent replaced = null;
int smallerOverflow = 0;
for (int i = 0; i < overflowSize; i++) {
if (overflowIndices[i] == index) {
replaced = overflowEntries[i];
overflowEntries[i] = event;
return replaced;
} else if (overflowIndices[i] > index) {
// done
break;
} else if (overflowIndices[i] < index) {
smallerOverflow++;
}
}
// still here: we must look in file buffer
int bufferIndex = index - smallerOverflow;
for (int hole = holeFlags.nextSetBit(0); hole >= 0
&& hole <= bufferIndex; hole = holeFlags.nextSetBit(hole + 1)) {
bufferIndex++;
}
replaced = buffer.get(bufferIndex);
if (buffer.replace(event, bufferIndex) == false) {
remove(index);
insert(event, index);
}
return replaced;
}
|
[
"public",
"synchronized",
"XEvent",
"replace",
"(",
"XEvent",
"event",
",",
"int",
"index",
")",
"throws",
"IndexOutOfBoundsException",
",",
"IOException",
"{",
"// check overflow list and adjust indices",
"XEvent",
"replaced",
"=",
"null",
";",
"int",
"smallerOverflow",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"overflowSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
"==",
"index",
")",
"{",
"replaced",
"=",
"overflowEntries",
"[",
"i",
"]",
";",
"overflowEntries",
"[",
"i",
"]",
"=",
"event",
";",
"return",
"replaced",
";",
"}",
"else",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
">",
"index",
")",
"{",
"// done",
"break",
";",
"}",
"else",
"if",
"(",
"overflowIndices",
"[",
"i",
"]",
"<",
"index",
")",
"{",
"smallerOverflow",
"++",
";",
"}",
"}",
"// still here: we must look in file buffer",
"int",
"bufferIndex",
"=",
"index",
"-",
"smallerOverflow",
";",
"for",
"(",
"int",
"hole",
"=",
"holeFlags",
".",
"nextSetBit",
"(",
"0",
")",
";",
"hole",
">=",
"0",
"&&",
"hole",
"<=",
"bufferIndex",
";",
"hole",
"=",
"holeFlags",
".",
"nextSetBit",
"(",
"hole",
"+",
"1",
")",
")",
"{",
"bufferIndex",
"++",
";",
"}",
"replaced",
"=",
"buffer",
".",
"get",
"(",
"bufferIndex",
")",
";",
"if",
"(",
"buffer",
".",
"replace",
"(",
"event",
",",
"bufferIndex",
")",
"==",
"false",
")",
"{",
"remove",
"(",
"index",
")",
";",
"insert",
"(",
"event",
",",
"index",
")",
";",
"}",
"return",
"replaced",
";",
"}"
] |
Replaces the event at the given index with another event.
@param event
Event to be inserted at the given position.
@param index
Position to replace event at.
@return The removed event, which has been replaced.
|
[
"Replaces",
"the",
"event",
"at",
"the",
"given",
"index",
"with",
"another",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XFastEventList.java#L364-L393
|
146,435
|
moparisthebest/beehive
|
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java
|
SessionEJBControlImpl.resolveBeanInstance
|
protected Object resolveBeanInstance() {
// First, try to resolve from a cached EJB handle (if any)
Object fromHandle = resolveBeanInstanceFromHandle();
if (fromHandle != null)
return fromHandle;
// Find null arg create() on the home interface, and use it to get an instance
try {
/* todo: for efficiency, this could be done once per home interface and cached */
Method createMethod = _homeInterface.getMethod("create", new Class []{});
Object beanInstance = createMethod.invoke(_homeInstance, (Object[])null);
_autoCreated = true;
return beanInstance;
}
catch (NoSuchMethodException e) {
throw new ControlException("Cannot auto-create session bean instance because no null argument create() method exists. To use this bean, you will need to call create() directly with the appropriate parameters");
}
catch (InvocationTargetException e) {
_lastException = e.getTargetException();
throw new ControlException("Unable to create session bean instance", _lastException);
}
catch (Exception e) {
throw new ControlException("Unable to invoke home interface create method", e);
}
}
|
java
|
protected Object resolveBeanInstance() {
// First, try to resolve from a cached EJB handle (if any)
Object fromHandle = resolveBeanInstanceFromHandle();
if (fromHandle != null)
return fromHandle;
// Find null arg create() on the home interface, and use it to get an instance
try {
/* todo: for efficiency, this could be done once per home interface and cached */
Method createMethod = _homeInterface.getMethod("create", new Class []{});
Object beanInstance = createMethod.invoke(_homeInstance, (Object[])null);
_autoCreated = true;
return beanInstance;
}
catch (NoSuchMethodException e) {
throw new ControlException("Cannot auto-create session bean instance because no null argument create() method exists. To use this bean, you will need to call create() directly with the appropriate parameters");
}
catch (InvocationTargetException e) {
_lastException = e.getTargetException();
throw new ControlException("Unable to create session bean instance", _lastException);
}
catch (Exception e) {
throw new ControlException("Unable to invoke home interface create method", e);
}
}
|
[
"protected",
"Object",
"resolveBeanInstance",
"(",
")",
"{",
"// First, try to resolve from a cached EJB handle (if any)",
"Object",
"fromHandle",
"=",
"resolveBeanInstanceFromHandle",
"(",
")",
";",
"if",
"(",
"fromHandle",
"!=",
"null",
")",
"return",
"fromHandle",
";",
"// Find null arg create() on the home interface, and use it to get an instance",
"try",
"{",
"/* todo: for efficiency, this could be done once per home interface and cached */",
"Method",
"createMethod",
"=",
"_homeInterface",
".",
"getMethod",
"(",
"\"create\"",
",",
"new",
"Class",
"[",
"]",
"{",
"}",
")",
";",
"Object",
"beanInstance",
"=",
"createMethod",
".",
"invoke",
"(",
"_homeInstance",
",",
"(",
"Object",
"[",
"]",
")",
"null",
")",
";",
"_autoCreated",
"=",
"true",
";",
"return",
"beanInstance",
";",
"}",
"catch",
"(",
"NoSuchMethodException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Cannot auto-create session bean instance because no null argument create() method exists. To use this bean, you will need to call create() directly with the appropriate parameters\"",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"e",
")",
"{",
"_lastException",
"=",
"e",
".",
"getTargetException",
"(",
")",
";",
"throw",
"new",
"ControlException",
"(",
"\"Unable to create session bean instance\"",
",",
"_lastException",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Unable to invoke home interface create method\"",
",",
"e",
")",
";",
"}",
"}"
] |
Implements auto-create semantics for Session beans.
|
[
"Implements",
"auto",
"-",
"create",
"semantics",
"for",
"Session",
"beans",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java#L57-L83
|
146,436
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/LabelBase.java
|
LabelBase.filter
|
protected void filter(String value, AbstractRenderAppender writer, boolean markupHTMLSpaceReturn)
{
if (value.equals(" ")) {
writer.append(" ");
return;
}
HtmlUtils.filter(value, writer, markupHTMLSpaceReturn);
}
|
java
|
protected void filter(String value, AbstractRenderAppender writer, boolean markupHTMLSpaceReturn)
{
if (value.equals(" ")) {
writer.append(" ");
return;
}
HtmlUtils.filter(value, writer, markupHTMLSpaceReturn);
}
|
[
"protected",
"void",
"filter",
"(",
"String",
"value",
",",
"AbstractRenderAppender",
"writer",
",",
"boolean",
"markupHTMLSpaceReturn",
")",
"{",
"if",
"(",
"value",
".",
"equals",
"(",
"\" \"",
")",
")",
"{",
"writer",
".",
"append",
"(",
"\" \"",
")",
";",
"return",
";",
"}",
"HtmlUtils",
".",
"filter",
"(",
"value",
",",
"writer",
",",
"markupHTMLSpaceReturn",
")",
";",
"}"
] |
Filter the specified string for characters that are senstive to
HTML interpreters, returning the string with these characters replaced
by the corresponding character entities.
@param value The string to be filtered and returned
@param markupHTMLSpaceReturn convert space characters and return characters
to &nbsp; and <br /> marketup for html.
|
[
"Filter",
"the",
"specified",
"string",
"for",
"characters",
"that",
"are",
"senstive",
"to",
"HTML",
"interpreters",
"returning",
"the",
"string",
"with",
"these",
"characters",
"replaced",
"by",
"the",
"corresponding",
"character",
"entities",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/LabelBase.java#L142-L150
|
146,437
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
|
ScopedRequestImpl.addParameter
|
public void addParameter( String name, String value )
{
if ( _additionalParameters == null )
{
_additionalParameters = new HashMap();
}
_additionalParameters.put( name, value );
}
|
java
|
public void addParameter( String name, String value )
{
if ( _additionalParameters == null )
{
_additionalParameters = new HashMap();
}
_additionalParameters.put( name, value );
}
|
[
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"_additionalParameters",
"==",
"null",
")",
"{",
"_additionalParameters",
"=",
"new",
"HashMap",
"(",
")",
";",
"}",
"_additionalParameters",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] |
Add a parameter to the request.
@param name the parameter name.
@param value the parameter value.
|
[
"Add",
"a",
"parameter",
"to",
"the",
"request",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java#L184-L192
|
146,438
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
|
ScopedRequestImpl.getListenScopeParameter
|
public String getListenScopeParameter( String paramName )
{
String retVal = null;
if ( _listenScopes != null )
{
for ( int i = 0, len = _listenScopes.size(); retVal == null && i < len; ++i )
{
String key = ScopedServletUtils.getScopedName( paramName, _listenScopes.get( i ) );
retVal = getRequest().getParameter( key );
}
}
return retVal;
}
|
java
|
public String getListenScopeParameter( String paramName )
{
String retVal = null;
if ( _listenScopes != null )
{
for ( int i = 0, len = _listenScopes.size(); retVal == null && i < len; ++i )
{
String key = ScopedServletUtils.getScopedName( paramName, _listenScopes.get( i ) );
retVal = getRequest().getParameter( key );
}
}
return retVal;
}
|
[
"public",
"String",
"getListenScopeParameter",
"(",
"String",
"paramName",
")",
"{",
"String",
"retVal",
"=",
"null",
";",
"if",
"(",
"_listenScopes",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"len",
"=",
"_listenScopes",
".",
"size",
"(",
")",
";",
"retVal",
"==",
"null",
"&&",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"String",
"key",
"=",
"ScopedServletUtils",
".",
"getScopedName",
"(",
"paramName",
",",
"_listenScopes",
".",
"get",
"(",
"i",
")",
")",
";",
"retVal",
"=",
"getRequest",
"(",
")",
".",
"getParameter",
"(",
"key",
")",
";",
"}",
"}",
"return",
"retVal",
";",
"}"
] |
Get the parameter from the listen scoped requests
@param paramName
@return value of the parameter
|
[
"Get",
"the",
"parameter",
"from",
"the",
"listen",
"scoped",
"requests"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java#L227-L241
|
146,439
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
|
ScopedRequestImpl.addListenScope
|
public void addListenScope( Object scopeKey )
{
assert scopeKey != null;
if ( _listenScopes == null )
{
_listenScopes = new ArrayList();
}
_listenScopes.add( scopeKey );
}
|
java
|
public void addListenScope( Object scopeKey )
{
assert scopeKey != null;
if ( _listenScopes == null )
{
_listenScopes = new ArrayList();
}
_listenScopes.add( scopeKey );
}
|
[
"public",
"void",
"addListenScope",
"(",
"Object",
"scopeKey",
")",
"{",
"assert",
"scopeKey",
"!=",
"null",
";",
"if",
"(",
"_listenScopes",
"==",
"null",
")",
"{",
"_listenScopes",
"=",
"new",
"ArrayList",
"(",
")",
";",
"}",
"_listenScopes",
".",
"add",
"(",
"scopeKey",
")",
";",
"}"
] |
Adds a scope to "listen" to. This scope will see all request parameters from a ScopedRequest
of the given scope.
|
[
"Adds",
"a",
"scope",
"to",
"listen",
"to",
".",
"This",
"scope",
"will",
"see",
"all",
"request",
"parameters",
"from",
"a",
"ScopedRequest",
"of",
"the",
"given",
"scope",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java#L344-L354
|
146,440
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
|
ScopedRequestImpl.persistAttributes
|
public void persistAttributes()
{
String attrName = getScopedName( STORED_ATTRS_ATTR );
getSession().setAttribute( attrName, _scopedContainer.getSerializableAttrs() );
}
|
java
|
public void persistAttributes()
{
String attrName = getScopedName( STORED_ATTRS_ATTR );
getSession().setAttribute( attrName, _scopedContainer.getSerializableAttrs() );
}
|
[
"public",
"void",
"persistAttributes",
"(",
")",
"{",
"String",
"attrName",
"=",
"getScopedName",
"(",
"STORED_ATTRS_ATTR",
")",
";",
"getSession",
"(",
")",
".",
"setAttribute",
"(",
"attrName",
",",
"_scopedContainer",
".",
"getSerializableAttrs",
"(",
")",
")",
";",
"}"
] |
Stores the current map of request attributes in the Session.
@deprecated Moved the persisting of attributes out of the beehive NetUI
layer. Use {@link #getAttributeMap} to get the attributes.
|
[
"Stores",
"the",
"current",
"map",
"of",
"request",
"attributes",
"in",
"the",
"Session",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java#L444-L448
|
146,441
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
|
ScopedRequestImpl.restoreAttributes
|
public void restoreAttributes()
{
String attrName = getScopedName( STORED_ATTRS_ATTR );
Map savedAttrs = ( Map ) getSession().getAttribute( attrName );
if ( savedAttrs != null )
{
setAttributeMap( savedAttrs );
}
}
|
java
|
public void restoreAttributes()
{
String attrName = getScopedName( STORED_ATTRS_ATTR );
Map savedAttrs = ( Map ) getSession().getAttribute( attrName );
if ( savedAttrs != null )
{
setAttributeMap( savedAttrs );
}
}
|
[
"public",
"void",
"restoreAttributes",
"(",
")",
"{",
"String",
"attrName",
"=",
"getScopedName",
"(",
"STORED_ATTRS_ATTR",
")",
";",
"Map",
"savedAttrs",
"=",
"(",
"Map",
")",
"getSession",
"(",
")",
".",
"getAttribute",
"(",
"attrName",
")",
";",
"if",
"(",
"savedAttrs",
"!=",
"null",
")",
"{",
"setAttributeMap",
"(",
"savedAttrs",
")",
";",
"}",
"}"
] |
Restores the map of request attributes from a map saved in the Session.
@deprecated Moved the persisting of attributes out of the beehive NetUI
layer. Use {@link #setAttributeMap} to set/merge the attributes.
|
[
"Restores",
"the",
"map",
"of",
"request",
"attributes",
"from",
"a",
"map",
"saved",
"in",
"the",
"Session",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java#L455-L464
|
146,442
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java
|
PageFlowStack.popUntil
|
PageFlowController popUntil( HttpServletRequest request, Class stopAt, boolean onlyIfPresent )
{
if (onlyIfPresent && lastIndexOf(stopAt) == -1) {
return null;
}
while ( ! isEmpty() )
{
PageFlowController popped = pop( request ).getPageFlow();
if ( popped.getClass().equals( stopAt ) )
{
//
// If we've popped everything from the stack, remove the stack attribute from the session.
//
if ( isEmpty() ) destroy( request );
return popped;
}
else
{
//
// We're discarding the popped page flow. Invoke its destroy() callback, unless it's longLived.
//
if ( ! popped.isLongLived() ) popped.destroy( request.getSession( false ) );
}
}
destroy( request ); // we're empty -- remove the attribute from the session.
return null;
}
|
java
|
PageFlowController popUntil( HttpServletRequest request, Class stopAt, boolean onlyIfPresent )
{
if (onlyIfPresent && lastIndexOf(stopAt) == -1) {
return null;
}
while ( ! isEmpty() )
{
PageFlowController popped = pop( request ).getPageFlow();
if ( popped.getClass().equals( stopAt ) )
{
//
// If we've popped everything from the stack, remove the stack attribute from the session.
//
if ( isEmpty() ) destroy( request );
return popped;
}
else
{
//
// We're discarding the popped page flow. Invoke its destroy() callback, unless it's longLived.
//
if ( ! popped.isLongLived() ) popped.destroy( request.getSession( false ) );
}
}
destroy( request ); // we're empty -- remove the attribute from the session.
return null;
}
|
[
"PageFlowController",
"popUntil",
"(",
"HttpServletRequest",
"request",
",",
"Class",
"stopAt",
",",
"boolean",
"onlyIfPresent",
")",
"{",
"if",
"(",
"onlyIfPresent",
"&&",
"lastIndexOf",
"(",
"stopAt",
")",
"==",
"-",
"1",
")",
"{",
"return",
"null",
";",
"}",
"while",
"(",
"!",
"isEmpty",
"(",
")",
")",
"{",
"PageFlowController",
"popped",
"=",
"pop",
"(",
"request",
")",
".",
"getPageFlow",
"(",
")",
";",
"if",
"(",
"popped",
".",
"getClass",
"(",
")",
".",
"equals",
"(",
"stopAt",
")",
")",
"{",
"//",
"// If we've popped everything from the stack, remove the stack attribute from the session.",
"//",
"if",
"(",
"isEmpty",
"(",
")",
")",
"destroy",
"(",
"request",
")",
";",
"return",
"popped",
";",
"}",
"else",
"{",
"//",
"// We're discarding the popped page flow. Invoke its destroy() callback, unless it's longLived.",
"//",
"if",
"(",
"!",
"popped",
".",
"isLongLived",
"(",
")",
")",
"popped",
".",
"destroy",
"(",
"request",
".",
"getSession",
"(",
"false",
")",
")",
";",
"}",
"}",
"destroy",
"(",
"request",
")",
";",
"// we're empty -- remove the attribute from the session.",
"return",
"null",
";",
"}"
] |
Pop page flows from the nesting stack until one of the given type is found.
@return the last popped page flow if one of the given type was found, or <code>null</code>
if none was found.
|
[
"Pop",
"page",
"flows",
"from",
"the",
"nesting",
"stack",
"until",
"one",
"of",
"the",
"given",
"type",
"is",
"found",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java#L200-L229
|
146,443
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java
|
PageFlowStack.push
|
public void push( PageFlowController pageFlow, HttpServletRequest request )
{
ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
if ( interceptorContext != null )
{
ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
InterceptorForward originalForward = interceptorContext.getOriginalForward();
String actionName = interceptorContext.getActionName();
_stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
}
else
{
_stack.push( new PushedPageFlow( pageFlow ) );
}
// Tell the page flow that it is on the nesting stack.
pageFlow.setIsOnNestingStack( true );
// To ensure that this attribute is replicated for session failover.
ensureFailover( request, getServletContext() );
}
|
java
|
public void push( PageFlowController pageFlow, HttpServletRequest request )
{
ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
if ( interceptorContext != null )
{
ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
InterceptorForward originalForward = interceptorContext.getOriginalForward();
String actionName = interceptorContext.getActionName();
_stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
}
else
{
_stack.push( new PushedPageFlow( pageFlow ) );
}
// Tell the page flow that it is on the nesting stack.
pageFlow.setIsOnNestingStack( true );
// To ensure that this attribute is replicated for session failover.
ensureFailover( request, getServletContext() );
}
|
[
"public",
"void",
"push",
"(",
"PageFlowController",
"pageFlow",
",",
"HttpServletRequest",
"request",
")",
"{",
"ActionInterceptorContext",
"interceptorContext",
"=",
"ActionInterceptorContext",
".",
"getActiveContext",
"(",
"request",
",",
"true",
")",
";",
"if",
"(",
"interceptorContext",
"!=",
"null",
")",
"{",
"ActionInterceptor",
"interceptor",
"=",
"interceptorContext",
".",
"getOverridingActionInterceptor",
"(",
")",
";",
"InterceptorForward",
"originalForward",
"=",
"interceptorContext",
".",
"getOriginalForward",
"(",
")",
";",
"String",
"actionName",
"=",
"interceptorContext",
".",
"getActionName",
"(",
")",
";",
"_stack",
".",
"push",
"(",
"new",
"PushedPageFlow",
"(",
"pageFlow",
",",
"interceptor",
",",
"originalForward",
",",
"actionName",
")",
")",
";",
"}",
"else",
"{",
"_stack",
".",
"push",
"(",
"new",
"PushedPageFlow",
"(",
"pageFlow",
")",
")",
";",
"}",
"// Tell the page flow that it is on the nesting stack.",
"pageFlow",
".",
"setIsOnNestingStack",
"(",
"true",
")",
";",
"// To ensure that this attribute is replicated for session failover.",
"ensureFailover",
"(",
"request",
",",
"getServletContext",
"(",
")",
")",
";",
"}"
] |
Push a page flow onto the stack of nested page flows in the session.
@param pageFlow the page flow to push.
@param request the current HttpServletRequest.
|
[
"Push",
"a",
"page",
"flow",
"onto",
"the",
"stack",
"of",
"nested",
"page",
"flows",
"in",
"the",
"session",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java#L275-L295
|
146,444
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java
|
PageFlowStack.pop
|
public PushedPageFlow pop( HttpServletRequest request )
{
PushedPageFlow ppf = ( PushedPageFlow ) _stack.pop();
PageFlowController pfc = ppf.getPageFlow();
pfc.setIsOnNestingStack( false );
if ( request != null ) // may be null if we're called from valueUnbound()
{
ServletContext servletContext = getServletContext();
// Reinitialize the page flow, in case it's lost its transient state.
pfc.reinitialize( request, null, servletContext );
ensureFailover( request, servletContext ); // to ensure that this attribute is replicated for session failover
}
return ppf;
}
|
java
|
public PushedPageFlow pop( HttpServletRequest request )
{
PushedPageFlow ppf = ( PushedPageFlow ) _stack.pop();
PageFlowController pfc = ppf.getPageFlow();
pfc.setIsOnNestingStack( false );
if ( request != null ) // may be null if we're called from valueUnbound()
{
ServletContext servletContext = getServletContext();
// Reinitialize the page flow, in case it's lost its transient state.
pfc.reinitialize( request, null, servletContext );
ensureFailover( request, servletContext ); // to ensure that this attribute is replicated for session failover
}
return ppf;
}
|
[
"public",
"PushedPageFlow",
"pop",
"(",
"HttpServletRequest",
"request",
")",
"{",
"PushedPageFlow",
"ppf",
"=",
"(",
"PushedPageFlow",
")",
"_stack",
".",
"pop",
"(",
")",
";",
"PageFlowController",
"pfc",
"=",
"ppf",
".",
"getPageFlow",
"(",
")",
";",
"pfc",
".",
"setIsOnNestingStack",
"(",
"false",
")",
";",
"if",
"(",
"request",
"!=",
"null",
")",
"// may be null if we're called from valueUnbound()",
"{",
"ServletContext",
"servletContext",
"=",
"getServletContext",
"(",
")",
";",
"// Reinitialize the page flow, in case it's lost its transient state.",
"pfc",
".",
"reinitialize",
"(",
"request",
",",
"null",
",",
"servletContext",
")",
";",
"ensureFailover",
"(",
"request",
",",
"servletContext",
")",
";",
"// to ensure that this attribute is replicated for session failover",
"}",
"return",
"ppf",
";",
"}"
] |
Pop the most recently-pushed page flow from the stack of nested page flows in the session.
@param request the current HttpServletRequest.
@return a {@link PushedPageFlow} that represents the popped page flow.
|
[
"Pop",
"the",
"most",
"recently",
"-",
"pushed",
"page",
"flow",
"from",
"the",
"stack",
"of",
"nested",
"page",
"flows",
"in",
"the",
"session",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java#L303-L319
|
146,445
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java
|
PageFlowStack.getLegacyStack
|
Stack getLegacyStack()
{
Stack ret = new Stack();
for ( int i = 0; i < _stack.size(); ++i )
{
ret.push( ( ( PushedPageFlow ) _stack.get( i ) ).getPageFlow() );
}
return ret;
}
|
java
|
Stack getLegacyStack()
{
Stack ret = new Stack();
for ( int i = 0; i < _stack.size(); ++i )
{
ret.push( ( ( PushedPageFlow ) _stack.get( i ) ).getPageFlow() );
}
return ret;
}
|
[
"Stack",
"getLegacyStack",
"(",
")",
"{",
"Stack",
"ret",
"=",
"new",
"Stack",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_stack",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
"{",
"ret",
".",
"push",
"(",
"(",
"(",
"PushedPageFlow",
")",
"_stack",
".",
"get",
"(",
"i",
")",
")",
".",
"getPageFlow",
"(",
")",
")",
";",
"}",
"return",
"ret",
";",
"}"
] |
Get a stack of PageFlowControllers, not of PushedPageFlows.
|
[
"Get",
"a",
"stack",
"of",
"PageFlowControllers",
"not",
"of",
"PushedPageFlows",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowStack.java#L384-L394
|
146,446
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XAbstractAttributeMapBufferedImpl.java
|
XAbstractAttributeMapBufferedImpl.deserialize
|
protected synchronized XAttributeMap deserialize() throws IOException {
if(this.size == 0) {
return new XAttributeMapLazyImpl<XAttributeMapImpl>(XAttributeMapImpl.class);
} else {
if(cacheMap != null && cacheMap.get() != null) {
return cacheMap.get();
} else {
storage.seek(0);
XAttributeMap deserialized = this.serializer.deserialize(storage);
cacheMap = new WeakReference<XAttributeMap>(deserialized);
return deserialized;
}
}
}
|
java
|
protected synchronized XAttributeMap deserialize() throws IOException {
if(this.size == 0) {
return new XAttributeMapLazyImpl<XAttributeMapImpl>(XAttributeMapImpl.class);
} else {
if(cacheMap != null && cacheMap.get() != null) {
return cacheMap.get();
} else {
storage.seek(0);
XAttributeMap deserialized = this.serializer.deserialize(storage);
cacheMap = new WeakReference<XAttributeMap>(deserialized);
return deserialized;
}
}
}
|
[
"protected",
"synchronized",
"XAttributeMap",
"deserialize",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"size",
"==",
"0",
")",
"{",
"return",
"new",
"XAttributeMapLazyImpl",
"<",
"XAttributeMapImpl",
">",
"(",
"XAttributeMapImpl",
".",
"class",
")",
";",
"}",
"else",
"{",
"if",
"(",
"cacheMap",
"!=",
"null",
"&&",
"cacheMap",
".",
"get",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"cacheMap",
".",
"get",
"(",
")",
";",
"}",
"else",
"{",
"storage",
".",
"seek",
"(",
"0",
")",
";",
"XAttributeMap",
"deserialized",
"=",
"this",
".",
"serializer",
".",
"deserialize",
"(",
"storage",
")",
";",
"cacheMap",
"=",
"new",
"WeakReference",
"<",
"XAttributeMap",
">",
"(",
"deserialized",
")",
";",
"return",
"deserialized",
";",
"}",
"}",
"}"
] |
Retrieves a quick-access representation of this attribute map
for actual usage. De-buffers the attribute map and creates an
in-memory representation which should be discarded after use
to free memory.
@return In-memory copy of this attribute map.
|
[
"Retrieves",
"a",
"quick",
"-",
"access",
"representation",
"of",
"this",
"attribute",
"map",
"for",
"actual",
"usage",
".",
"De",
"-",
"buffers",
"the",
"attribute",
"map",
"and",
"creates",
"an",
"in",
"-",
"memory",
"representation",
"which",
"should",
"be",
"discarded",
"after",
"use",
"to",
"free",
"memory",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XAbstractAttributeMapBufferedImpl.java#L128-L141
|
146,447
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XAbstractAttributeMapBufferedImpl.java
|
XAbstractAttributeMapBufferedImpl.serialize
|
protected synchronized void serialize(XAttributeMap map) throws IOException {
storage.seek(0);
serializer.serialize(map, storage);
cacheMap = new WeakReference<XAttributeMap>(map);
this.size = map.size();
map = null;
}
|
java
|
protected synchronized void serialize(XAttributeMap map) throws IOException {
storage.seek(0);
serializer.serialize(map, storage);
cacheMap = new WeakReference<XAttributeMap>(map);
this.size = map.size();
map = null;
}
|
[
"protected",
"synchronized",
"void",
"serialize",
"(",
"XAttributeMap",
"map",
")",
"throws",
"IOException",
"{",
"storage",
".",
"seek",
"(",
"0",
")",
";",
"serializer",
".",
"serialize",
"(",
"map",
",",
"storage",
")",
";",
"cacheMap",
"=",
"new",
"WeakReference",
"<",
"XAttributeMap",
">",
"(",
"map",
")",
";",
"this",
".",
"size",
"=",
"map",
".",
"size",
"(",
")",
";",
"map",
"=",
"null",
";",
"}"
] |
Serializes the given attribute map to a disk-buffered representation.
@param map Attribute map to be serialized.
|
[
"Serializes",
"the",
"given",
"attribute",
"map",
"to",
"a",
"disk",
"-",
"buffered",
"representation",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XAbstractAttributeMapBufferedImpl.java#L148-L154
|
146,448
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAxiomImplWithoutEntityAndAnonCaching.java
|
OWLAxiomImplWithoutEntityAndAnonCaching.mergeAnnos
|
@Nonnull
protected Set<OWLAnnotation> mergeAnnos(Set<OWLAnnotation> annos) {
Set<OWLAnnotation> merged = new HashSet<>(annos);
merged.addAll(annotations);
return merged;
}
|
java
|
@Nonnull
protected Set<OWLAnnotation> mergeAnnos(Set<OWLAnnotation> annos) {
Set<OWLAnnotation> merged = new HashSet<>(annos);
merged.addAll(annotations);
return merged;
}
|
[
"@",
"Nonnull",
"protected",
"Set",
"<",
"OWLAnnotation",
">",
"mergeAnnos",
"(",
"Set",
"<",
"OWLAnnotation",
">",
"annos",
")",
"{",
"Set",
"<",
"OWLAnnotation",
">",
"merged",
"=",
"new",
"HashSet",
"<>",
"(",
"annos",
")",
";",
"merged",
".",
"addAll",
"(",
"annotations",
")",
";",
"return",
"merged",
";",
"}"
] |
A convenience method for implementation that returns a set containing the
annotations on this axiom plus the annotations in the specified set.
@param annos
The annotations to add to the annotations on this axiom
@return The annotations
|
[
"A",
"convenience",
"method",
"for",
"implementation",
"that",
"returns",
"a",
"set",
"containing",
"the",
"annotations",
"on",
"this",
"axiom",
"plus",
"the",
"annotations",
"in",
"the",
"specified",
"set",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAxiomImplWithoutEntityAndAnonCaching.java#L132-L137
|
146,449
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.add
|
public Vector add(Vector vec) {
x += vec.x;
y += vec.y;
z += vec.z;
return this;
}
|
java
|
public Vector add(Vector vec) {
x += vec.x;
y += vec.y;
z += vec.z;
return this;
}
|
[
"public",
"Vector",
"add",
"(",
"Vector",
"vec",
")",
"{",
"x",
"+=",
"vec",
".",
"x",
";",
"y",
"+=",
"vec",
".",
"y",
";",
"z",
"+=",
"vec",
".",
"z",
";",
"return",
"this",
";",
"}"
] |
Adds a vector to this one
@param vec The other vector
@return the same vector
|
[
"Adds",
"a",
"vector",
"to",
"this",
"one"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L101-L106
|
146,450
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.subtract
|
public Vector subtract(Vector vec) {
x -= vec.x;
y -= vec.y;
z -= vec.z;
return this;
}
|
java
|
public Vector subtract(Vector vec) {
x -= vec.x;
y -= vec.y;
z -= vec.z;
return this;
}
|
[
"public",
"Vector",
"subtract",
"(",
"Vector",
"vec",
")",
"{",
"x",
"-=",
"vec",
".",
"x",
";",
"y",
"-=",
"vec",
".",
"y",
";",
"z",
"-=",
"vec",
".",
"z",
";",
"return",
"this",
";",
"}"
] |
Subtracts a vector from this one.
@param vec The other vector
@return the same vector
|
[
"Subtracts",
"a",
"vector",
"from",
"this",
"one",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L114-L119
|
146,451
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.multiply
|
public Vector multiply(Vector vec) {
x *= vec.x;
y *= vec.y;
z *= vec.z;
return this;
}
|
java
|
public Vector multiply(Vector vec) {
x *= vec.x;
y *= vec.y;
z *= vec.z;
return this;
}
|
[
"public",
"Vector",
"multiply",
"(",
"Vector",
"vec",
")",
"{",
"x",
"*=",
"vec",
".",
"x",
";",
"y",
"*=",
"vec",
".",
"y",
";",
"z",
"*=",
"vec",
".",
"z",
";",
"return",
"this",
";",
"}"
] |
Multiplies the vector by another.
@param vec The other vector
@return the same vector
|
[
"Multiplies",
"the",
"vector",
"by",
"another",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L127-L132
|
146,452
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.divide
|
public Vector divide(Vector vec) {
x /= vec.x;
y /= vec.y;
z /= vec.z;
return this;
}
|
java
|
public Vector divide(Vector vec) {
x /= vec.x;
y /= vec.y;
z /= vec.z;
return this;
}
|
[
"public",
"Vector",
"divide",
"(",
"Vector",
"vec",
")",
"{",
"x",
"/=",
"vec",
".",
"x",
";",
"y",
"/=",
"vec",
".",
"y",
";",
"z",
"/=",
"vec",
".",
"z",
";",
"return",
"this",
";",
"}"
] |
Divides the vector by another.
@param vec The other vector
@return the same vector
|
[
"Divides",
"the",
"vector",
"by",
"another",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L140-L145
|
146,453
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.copy
|
public Vector copy(Vector vec) {
x = vec.x;
y = vec.y;
z = vec.z;
return this;
}
|
java
|
public Vector copy(Vector vec) {
x = vec.x;
y = vec.y;
z = vec.z;
return this;
}
|
[
"public",
"Vector",
"copy",
"(",
"Vector",
"vec",
")",
"{",
"x",
"=",
"vec",
".",
"x",
";",
"y",
"=",
"vec",
".",
"y",
";",
"z",
"=",
"vec",
".",
"z",
";",
"return",
"this",
";",
"}"
] |
Copies another vector
@param vec The other vector
@return the same vector
|
[
"Copies",
"another",
"vector"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L153-L158
|
146,454
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.lengthSquared
|
public double lengthSquared() {
return NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z);
}
|
java
|
public double lengthSquared() {
return NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z);
}
|
[
"public",
"double",
"lengthSquared",
"(",
")",
"{",
"return",
"NumberConversions",
".",
"square",
"(",
"x",
")",
"+",
"NumberConversions",
".",
"square",
"(",
"y",
")",
"+",
"NumberConversions",
".",
"square",
"(",
"z",
")",
";",
"}"
] |
Gets the magnitude of the vector squared.
@return the magnitude
|
[
"Gets",
"the",
"magnitude",
"of",
"the",
"vector",
"squared",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L178-L180
|
146,455
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.distanceSquared
|
public double distanceSquared(Vector o) {
return NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z);
}
|
java
|
public double distanceSquared(Vector o) {
return NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z);
}
|
[
"public",
"double",
"distanceSquared",
"(",
"Vector",
"o",
")",
"{",
"return",
"NumberConversions",
".",
"square",
"(",
"x",
"-",
"o",
".",
"x",
")",
"+",
"NumberConversions",
".",
"square",
"(",
"y",
"-",
"o",
".",
"y",
")",
"+",
"NumberConversions",
".",
"square",
"(",
"z",
"-",
"o",
".",
"z",
")",
";",
"}"
] |
Get the squared distance between this vector and another.
@param o The other vector
@return the distance
|
[
"Get",
"the",
"squared",
"distance",
"between",
"this",
"vector",
"and",
"another",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L202-L204
|
146,456
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.angle
|
public float angle(Vector other) {
double dot = dot(other) / (length() * other.length());
return (float) Math.acos(dot);
}
|
java
|
public float angle(Vector other) {
double dot = dot(other) / (length() * other.length());
return (float) Math.acos(dot);
}
|
[
"public",
"float",
"angle",
"(",
"Vector",
"other",
")",
"{",
"double",
"dot",
"=",
"dot",
"(",
"other",
")",
"/",
"(",
"length",
"(",
")",
"*",
"other",
".",
"length",
"(",
")",
")",
";",
"return",
"(",
"float",
")",
"Math",
".",
"acos",
"(",
"dot",
")",
";",
"}"
] |
Gets the angle between this vector and another in radians.
@param other The other vector
@return angle in radians
|
[
"Gets",
"the",
"angle",
"between",
"this",
"vector",
"and",
"another",
"in",
"radians",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L212-L216
|
146,457
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.midpoint
|
public Vector midpoint(Vector other) {
x = (x + other.x) / 2;
y = (y + other.y) / 2;
z = (z + other.z) / 2;
return this;
}
|
java
|
public Vector midpoint(Vector other) {
x = (x + other.x) / 2;
y = (y + other.y) / 2;
z = (z + other.z) / 2;
return this;
}
|
[
"public",
"Vector",
"midpoint",
"(",
"Vector",
"other",
")",
"{",
"x",
"=",
"(",
"x",
"+",
"other",
".",
"x",
")",
"/",
"2",
";",
"y",
"=",
"(",
"y",
"+",
"other",
".",
"y",
")",
"/",
"2",
";",
"z",
"=",
"(",
"z",
"+",
"other",
".",
"z",
")",
"/",
"2",
";",
"return",
"this",
";",
"}"
] |
Sets this vector to the midpoint between this vector and another.
@param other The other vector
@return this same vector (now a midpoint)
|
[
"Sets",
"this",
"vector",
"to",
"the",
"midpoint",
"between",
"this",
"vector",
"and",
"another",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L224-L229
|
146,458
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.getMidpoint
|
public Vector getMidpoint(Vector other) {
double x = (this.x + other.x) / 2;
double y = (this.y + other.y) / 2;
double z = (this.z + other.z) / 2;
return new Vector(x, y, z);
}
|
java
|
public Vector getMidpoint(Vector other) {
double x = (this.x + other.x) / 2;
double y = (this.y + other.y) / 2;
double z = (this.z + other.z) / 2;
return new Vector(x, y, z);
}
|
[
"public",
"Vector",
"getMidpoint",
"(",
"Vector",
"other",
")",
"{",
"double",
"x",
"=",
"(",
"this",
".",
"x",
"+",
"other",
".",
"x",
")",
"/",
"2",
";",
"double",
"y",
"=",
"(",
"this",
".",
"y",
"+",
"other",
".",
"y",
")",
"/",
"2",
";",
"double",
"z",
"=",
"(",
"this",
".",
"z",
"+",
"other",
".",
"z",
")",
"/",
"2",
";",
"return",
"new",
"Vector",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"}"
] |
Gets a new midpoint vector between this vector and another.
@param other The other vector
@return a new midpoint vector
|
[
"Gets",
"a",
"new",
"midpoint",
"vector",
"between",
"this",
"vector",
"and",
"another",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L237-L242
|
146,459
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.isInSphere
|
public boolean isInSphere(Vector origin, double radius) {
return (NumberConversions.square(origin.x - x) + NumberConversions.square(origin.y - y) + NumberConversions.square(origin.z - z)) <= NumberConversions.square(radius);
}
|
java
|
public boolean isInSphere(Vector origin, double radius) {
return (NumberConversions.square(origin.x - x) + NumberConversions.square(origin.y - y) + NumberConversions.square(origin.z - z)) <= NumberConversions.square(radius);
}
|
[
"public",
"boolean",
"isInSphere",
"(",
"Vector",
"origin",
",",
"double",
"radius",
")",
"{",
"return",
"(",
"NumberConversions",
".",
"square",
"(",
"origin",
".",
"x",
"-",
"x",
")",
"+",
"NumberConversions",
".",
"square",
"(",
"origin",
".",
"y",
"-",
"y",
")",
"+",
"NumberConversions",
".",
"square",
"(",
"origin",
".",
"z",
"-",
"z",
")",
")",
"<=",
"NumberConversions",
".",
"square",
"(",
"radius",
")",
";",
"}"
] |
Returns whether this vector is within a sphere.
@param origin Sphere origin.
@param radius Sphere radius
@return whether this vector is in the sphere
|
[
"Returns",
"whether",
"this",
"vector",
"is",
"within",
"a",
"sphere",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L368-L370
|
146,460
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.getMinimum
|
public static Vector getMinimum(Vector v1, Vector v2) {
return new Vector(Math.min(v1.x, v2.x), Math.min(v1.y, v2.y), Math.min(v1.z, v2.z));
}
|
java
|
public static Vector getMinimum(Vector v1, Vector v2) {
return new Vector(Math.min(v1.x, v2.x), Math.min(v1.y, v2.y), Math.min(v1.z, v2.z));
}
|
[
"public",
"static",
"Vector",
"getMinimum",
"(",
"Vector",
"v1",
",",
"Vector",
"v2",
")",
"{",
"return",
"new",
"Vector",
"(",
"Math",
".",
"min",
"(",
"v1",
".",
"x",
",",
"v2",
".",
"x",
")",
",",
"Math",
".",
"min",
"(",
"v1",
".",
"y",
",",
"v2",
".",
"y",
")",
",",
"Math",
".",
"min",
"(",
"v1",
".",
"z",
",",
"v2",
".",
"z",
")",
")",
";",
"}"
] |
Gets the minimum components of two vectors.
@param v1 The first vector.
@param v2 The second vector.
@return minimum
|
[
"Gets",
"the",
"minimum",
"components",
"of",
"two",
"vectors",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L599-L601
|
146,461
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Vector.java
|
Vector.getMaximum
|
public static Vector getMaximum(Vector v1, Vector v2) {
return new Vector(Math.max(v1.x, v2.x), Math.max(v1.y, v2.y), Math.max(v1.z, v2.z));
}
|
java
|
public static Vector getMaximum(Vector v1, Vector v2) {
return new Vector(Math.max(v1.x, v2.x), Math.max(v1.y, v2.y), Math.max(v1.z, v2.z));
}
|
[
"public",
"static",
"Vector",
"getMaximum",
"(",
"Vector",
"v1",
",",
"Vector",
"v2",
")",
"{",
"return",
"new",
"Vector",
"(",
"Math",
".",
"max",
"(",
"v1",
".",
"x",
",",
"v2",
".",
"x",
")",
",",
"Math",
".",
"max",
"(",
"v1",
".",
"y",
",",
"v2",
".",
"y",
")",
",",
"Math",
".",
"max",
"(",
"v1",
".",
"z",
",",
"v2",
".",
"z",
")",
")",
";",
"}"
] |
Gets the maximum components of two vectors.
@param v1 The first vector.
@param v2 The second vector.
@return maximum
|
[
"Gets",
"the",
"maximum",
"components",
"of",
"two",
"vectors",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L610-L612
|
146,462
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptBlock.java
|
ScriptBlock.setPlacement
|
public void setPlacement(String placement)
{
if (placement.equals("after"))
_placement = ScriptPlacement.PLACE_AFTER;
else if (placement.equals("before"))
_placement = ScriptPlacement.PLACE_BEFORE;
else
_placement = ScriptPlacement.PLACE_INLINE;
}
|
java
|
public void setPlacement(String placement)
{
if (placement.equals("after"))
_placement = ScriptPlacement.PLACE_AFTER;
else if (placement.equals("before"))
_placement = ScriptPlacement.PLACE_BEFORE;
else
_placement = ScriptPlacement.PLACE_INLINE;
}
|
[
"public",
"void",
"setPlacement",
"(",
"String",
"placement",
")",
"{",
"if",
"(",
"placement",
".",
"equals",
"(",
"\"after\"",
")",
")",
"_placement",
"=",
"ScriptPlacement",
".",
"PLACE_AFTER",
";",
"else",
"if",
"(",
"placement",
".",
"equals",
"(",
"\"before\"",
")",
")",
"_placement",
"=",
"ScriptPlacement",
".",
"PLACE_BEFORE",
";",
"else",
"_placement",
"=",
"ScriptPlacement",
".",
"PLACE_INLINE",
";",
"}"
] |
Place the JavaScript inside in relationship to the frameword generated JavaScript.
@param placement The placement of the JavaScript
@jsptagref.attributedescription String value 'after' or 'before'. Places the JavaScript
before or after the JavaScript provided by the framework.
@jsptagref.databindable false
@jsptagref.attributesyntaxvalue <i>string_or_expression_output</i>
@netui:attribute rtexprvalue="true"
description="The String literal or expression used to output the content."
|
[
"Place",
"the",
"JavaScript",
"inside",
"in",
"relationship",
"to",
"the",
"frameword",
"generated",
"JavaScript",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptBlock.java#L59-L67
|
146,463
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java
|
XGlobalAttributeNameMap.getAvailableMappings
|
public Collection<XAttributeNameMap> getAvailableMappings() {
HashSet<XAttributeNameMap> result = new HashSet<XAttributeNameMap>();
result.addAll(mappings.values());
return Collections.unmodifiableCollection(result);
}
|
java
|
public Collection<XAttributeNameMap> getAvailableMappings() {
HashSet<XAttributeNameMap> result = new HashSet<XAttributeNameMap>();
result.addAll(mappings.values());
return Collections.unmodifiableCollection(result);
}
|
[
"public",
"Collection",
"<",
"XAttributeNameMap",
">",
"getAvailableMappings",
"(",
")",
"{",
"HashSet",
"<",
"XAttributeNameMap",
">",
"result",
"=",
"new",
"HashSet",
"<",
"XAttributeNameMap",
">",
"(",
")",
";",
"result",
".",
"addAll",
"(",
"mappings",
".",
"values",
"(",
")",
")",
";",
"return",
"Collections",
".",
"unmodifiableCollection",
"(",
"result",
")",
";",
"}"
] |
Returns all available mappings. Note that
returned mappings may be empty.
@return A collection of all available mappings.
|
[
"Returns",
"all",
"available",
"mappings",
".",
"Note",
"that",
"returned",
"mappings",
"may",
"be",
"empty",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java#L145-L149
|
146,464
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java
|
XGlobalAttributeNameMap.getMapping
|
public XAttributeNameMap getMapping(String name) {
XAttributeNameMapImpl mapping = mappings.get(name);
if(mapping == null) {
mapping = new XAttributeNameMapImpl(name);
mappings.put(name, mapping);
}
return mapping;
}
|
java
|
public XAttributeNameMap getMapping(String name) {
XAttributeNameMapImpl mapping = mappings.get(name);
if(mapping == null) {
mapping = new XAttributeNameMapImpl(name);
mappings.put(name, mapping);
}
return mapping;
}
|
[
"public",
"XAttributeNameMap",
"getMapping",
"(",
"String",
"name",
")",
"{",
"XAttributeNameMapImpl",
"mapping",
"=",
"mappings",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"mapping",
"==",
"null",
")",
"{",
"mapping",
"=",
"new",
"XAttributeNameMapImpl",
"(",
"name",
")",
";",
"mappings",
".",
"put",
"(",
"name",
",",
"mapping",
")",
";",
"}",
"return",
"mapping",
";",
"}"
] |
Provides access to a specific attribute name
mapping by its name. If the requested mapping does
not exist yet, a new mapping will be created, added
to the set of managed mappings, and returned. This
means, this method will always return a mapping,
but this could be empty.
@param name Name of the requested mapping.
@return The requested mapping, as stored in this
facility (or newly created).
|
[
"Provides",
"access",
"to",
"a",
"specific",
"attribute",
"name",
"mapping",
"by",
"its",
"name",
".",
"If",
"the",
"requested",
"mapping",
"does",
"not",
"exist",
"yet",
"a",
"new",
"mapping",
"will",
"be",
"created",
"added",
"to",
"the",
"set",
"of",
"managed",
"mappings",
"and",
"returned",
".",
"This",
"means",
"this",
"method",
"will",
"always",
"return",
"a",
"mapping",
"but",
"this",
"could",
"be",
"empty",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java#L163-L170
|
146,465
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java
|
TwoPhaseAnnotationProcessor.check
|
public void check()
{
for (AnnotationTypeDeclaration atd : _atds)
{
Collection<Declaration> decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith(atd);
for (Declaration decl : decls)
{
check(decl);
}
}
}
|
java
|
public void check()
{
for (AnnotationTypeDeclaration atd : _atds)
{
Collection<Declaration> decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith(atd);
for (Declaration decl : decls)
{
check(decl);
}
}
}
|
[
"public",
"void",
"check",
"(",
")",
"{",
"for",
"(",
"AnnotationTypeDeclaration",
"atd",
":",
"_atds",
")",
"{",
"Collection",
"<",
"Declaration",
">",
"decls",
"=",
"getAnnotationProcessorEnvironment",
"(",
")",
".",
"getDeclarationsAnnotatedWith",
"(",
"atd",
")",
";",
"for",
"(",
"Declaration",
"decl",
":",
"decls",
")",
"{",
"check",
"(",
"decl",
")",
";",
"}",
"}",
"}"
] |
Performs semantic validation of input Declarations that are annotated with
annotations claimed by this AnnotationProcessor.
|
[
"Performs",
"semantic",
"validation",
"of",
"input",
"Declarations",
"that",
"are",
"annotated",
"with",
"annotations",
"claimed",
"by",
"this",
"AnnotationProcessor",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L97-L107
|
146,466
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java
|
TwoPhaseAnnotationProcessor.generate
|
public void generate() throws CodeGenerationException
{
for (AnnotationTypeDeclaration atd : _atds)
{
Collection<Declaration> decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith(atd);
for (Declaration decl : decls)
{
generate(decl);
}
}
}
|
java
|
public void generate() throws CodeGenerationException
{
for (AnnotationTypeDeclaration atd : _atds)
{
Collection<Declaration> decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith(atd);
for (Declaration decl : decls)
{
generate(decl);
}
}
}
|
[
"public",
"void",
"generate",
"(",
")",
"throws",
"CodeGenerationException",
"{",
"for",
"(",
"AnnotationTypeDeclaration",
"atd",
":",
"_atds",
")",
"{",
"Collection",
"<",
"Declaration",
">",
"decls",
"=",
"getAnnotationProcessorEnvironment",
"(",
")",
".",
"getDeclarationsAnnotatedWith",
"(",
"atd",
")",
";",
"for",
"(",
"Declaration",
"decl",
":",
"decls",
")",
"{",
"generate",
"(",
"decl",
")",
";",
"}",
"}",
"}"
] |
Emits additional artifacts for input Declarations that are annotated with
annotations claimed by this AnnotationProcessor.
|
[
"Emits",
"additional",
"artifacts",
"for",
"input",
"Declarations",
"that",
"are",
"annotated",
"with",
"annotations",
"claimed",
"by",
"this",
"AnnotationProcessor",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L113-L123
|
146,467
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java
|
TwoPhaseAnnotationProcessor.printError
|
public void printError( Declaration d, String id, Object... args )
{
addError( d, id, args );
}
|
java
|
public void printError( Declaration d, String id, Object... args )
{
addError( d, id, args );
}
|
[
"public",
"void",
"printError",
"(",
"Declaration",
"d",
",",
"String",
"id",
",",
"Object",
"...",
"args",
")",
"{",
"addError",
"(",
"d",
",",
"id",
",",
"args",
")",
";",
"}"
] |
Report an error detected during the "check" phase. The presence of errors
will suppress execution of the "generate" phase.
|
[
"Report",
"an",
"error",
"detected",
"during",
"the",
"check",
"phase",
".",
"The",
"presence",
"of",
"errors",
"will",
"suppress",
"execution",
"of",
"the",
"generate",
"phase",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L157-L160
|
146,468
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java
|
TwoPhaseAnnotationProcessor.printWarning
|
public void printWarning( Declaration d, String id, Object... args )
{
addWarning( d, id, args );
}
|
java
|
public void printWarning( Declaration d, String id, Object... args )
{
addWarning( d, id, args );
}
|
[
"public",
"void",
"printWarning",
"(",
"Declaration",
"d",
",",
"String",
"id",
",",
"Object",
"...",
"args",
")",
"{",
"addWarning",
"(",
"d",
",",
"id",
",",
"args",
")",
";",
"}"
] |
Report a warning detected during the "check" phase. The presence of warnings
will not affect execution of the "generate" phase.
|
[
"Report",
"a",
"warning",
"detected",
"during",
"the",
"check",
"phase",
".",
"The",
"presence",
"of",
"warnings",
"will",
"not",
"affect",
"execution",
"of",
"the",
"generate",
"phase",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L166-L169
|
146,469
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RadioButtonGroup.java
|
RadioButtonGroup.doStartTag
|
public int doStartTag()
throws JspException
{
// evaluate the datasource and disabled state.
Object val = evaluateDataSource();
if (val != null)
_match = val.toString();
// Store this tag itself as a page attribute
pageContext.setAttribute(RADIOBUTTONGROUP_KEY, this);
_defaultRadio = evaluateDefaultValue();
// see if there are errors in the evaluation
if (hasErrors())
return SKIP_BODY;
ServletRequest req = pageContext.getRequest();
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
_writer = new WriteRenderAppender(pageContext);
if (isVertical()) {
_cr.TABLE(_writer);
}
// if this is a repeater then we shouid prime the pump...
_dynamicAttrs = evaluateOptionsDataSource();
assert (_dynamicAttrs != null);
assert (_dynamicAttrs instanceof Map ||
_dynamicAttrs instanceof Iterator);
if (_repeater) {
if (_dynamicAttrs instanceof Map) {
_dynamicAttrs = ((Map) _dynamicAttrs).entrySet().iterator();
}
if (!(_dynamicAttrs instanceof Iterator)) {
String s = Bundle.getString("Tags_OptionsDSIteratorError");
registerTagError(s, null);
return SKIP_BODY;
}
while (((Iterator) _dynamicAttrs).hasNext()) {
_repCurItem = ((Iterator) _dynamicAttrs).next();
if (_repCurItem != null)
break;
}
if (isVertical())
_cr.TR_TD(_writer);
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
}
//write(results.toString());
// This is basically this is if enough for 5 options
_saveBody = new InternalStringBuilder(640);
return EVAL_BODY_INCLUDE;
}
|
java
|
public int doStartTag()
throws JspException
{
// evaluate the datasource and disabled state.
Object val = evaluateDataSource();
if (val != null)
_match = val.toString();
// Store this tag itself as a page attribute
pageContext.setAttribute(RADIOBUTTONGROUP_KEY, this);
_defaultRadio = evaluateDefaultValue();
// see if there are errors in the evaluation
if (hasErrors())
return SKIP_BODY;
ServletRequest req = pageContext.getRequest();
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
_writer = new WriteRenderAppender(pageContext);
if (isVertical()) {
_cr.TABLE(_writer);
}
// if this is a repeater then we shouid prime the pump...
_dynamicAttrs = evaluateOptionsDataSource();
assert (_dynamicAttrs != null);
assert (_dynamicAttrs instanceof Map ||
_dynamicAttrs instanceof Iterator);
if (_repeater) {
if (_dynamicAttrs instanceof Map) {
_dynamicAttrs = ((Map) _dynamicAttrs).entrySet().iterator();
}
if (!(_dynamicAttrs instanceof Iterator)) {
String s = Bundle.getString("Tags_OptionsDSIteratorError");
registerTagError(s, null);
return SKIP_BODY;
}
while (((Iterator) _dynamicAttrs).hasNext()) {
_repCurItem = ((Iterator) _dynamicAttrs).next();
if (_repCurItem != null)
break;
}
if (isVertical())
_cr.TR_TD(_writer);
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
}
//write(results.toString());
// This is basically this is if enough for 5 options
_saveBody = new InternalStringBuilder(640);
return EVAL_BODY_INCLUDE;
}
|
[
"public",
"int",
"doStartTag",
"(",
")",
"throws",
"JspException",
"{",
"// evaluate the datasource and disabled state.",
"Object",
"val",
"=",
"evaluateDataSource",
"(",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"_match",
"=",
"val",
".",
"toString",
"(",
")",
";",
"// Store this tag itself as a page attribute",
"pageContext",
".",
"setAttribute",
"(",
"RADIOBUTTONGROUP_KEY",
",",
"this",
")",
";",
"_defaultRadio",
"=",
"evaluateDefaultValue",
"(",
")",
";",
"// see if there are errors in the evaluation",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"SKIP_BODY",
";",
"ServletRequest",
"req",
"=",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"if",
"(",
"_cr",
"==",
"null",
")",
"_cr",
"=",
"TagRenderingBase",
".",
"Factory",
".",
"getConstantRendering",
"(",
"req",
")",
";",
"_writer",
"=",
"new",
"WriteRenderAppender",
"(",
"pageContext",
")",
";",
"if",
"(",
"isVertical",
"(",
")",
")",
"{",
"_cr",
".",
"TABLE",
"(",
"_writer",
")",
";",
"}",
"// if this is a repeater then we shouid prime the pump...",
"_dynamicAttrs",
"=",
"evaluateOptionsDataSource",
"(",
")",
";",
"assert",
"(",
"_dynamicAttrs",
"!=",
"null",
")",
";",
"assert",
"(",
"_dynamicAttrs",
"instanceof",
"Map",
"||",
"_dynamicAttrs",
"instanceof",
"Iterator",
")",
";",
"if",
"(",
"_repeater",
")",
"{",
"if",
"(",
"_dynamicAttrs",
"instanceof",
"Map",
")",
"{",
"_dynamicAttrs",
"=",
"(",
"(",
"Map",
")",
"_dynamicAttrs",
")",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"}",
"if",
"(",
"!",
"(",
"_dynamicAttrs",
"instanceof",
"Iterator",
")",
")",
"{",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_OptionsDSIteratorError\"",
")",
";",
"registerTagError",
"(",
"s",
",",
"null",
")",
";",
"return",
"SKIP_BODY",
";",
"}",
"while",
"(",
"(",
"(",
"Iterator",
")",
"_dynamicAttrs",
")",
".",
"hasNext",
"(",
")",
")",
"{",
"_repCurItem",
"=",
"(",
"(",
"Iterator",
")",
"_dynamicAttrs",
")",
".",
"next",
"(",
")",
";",
"if",
"(",
"_repCurItem",
"!=",
"null",
")",
"break",
";",
"}",
"if",
"(",
"isVertical",
"(",
")",
")",
"_cr",
".",
"TR_TD",
"(",
"_writer",
")",
";",
"DataAccessProviderStack",
".",
"addDataAccessProvider",
"(",
"this",
",",
"pageContext",
")",
";",
"}",
"//write(results.toString());",
"// This is basically this is if enough for 5 options",
"_saveBody",
"=",
"new",
"InternalStringBuilder",
"(",
"640",
")",
";",
"return",
"EVAL_BODY_INCLUDE",
";",
"}"
] |
Determine the match for the RadioButtonGroup
@throws JspException if a JSP exception has occurred
|
[
"Determine",
"the",
"match",
"for",
"the",
"RadioButtonGroup"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RadioButtonGroup.java#L271-L326
|
146,470
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RadioButtonGroup.java
|
RadioButtonGroup.doEndTag
|
public int doEndTag() throws JspException
{
if (hasErrors())
return reportAndExit(EVAL_PAGE);
String idScript = null;
String altText = null;
char accessKey = 0x00;
// Remove the page scope attributes we created
pageContext.removeAttribute(RADIOBUTTONGROUP_KEY);
ServletRequest req = pageContext.getRequest();
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
//InternalStringBuilder results = new InternalStringBuilder(128);
if (_saveBody != null)
write(_saveBody.toString());
// if this is a repeater we output the content during the body processing
if (_repeater) {
// Render a tag representing the end of our current form
if (isVertical())
_cr.end_TABLE(_writer);
if (idScript != null)
write(idScript);
//write(results.toString());
localRelease();
return EVAL_PAGE;
}
// Render a tag representing the end of our current form
if (_dynamicAttrs instanceof Map) {
Map dynamicRadiosMap = (Map) _dynamicAttrs;
Iterator keyIterator = dynamicRadiosMap.keySet().iterator();
int idx = 0;
while (keyIterator.hasNext()) {
Object optionValue = keyIterator.next();
String optionDisplay = null;
if (dynamicRadiosMap.get(optionValue) != null) {
optionDisplay = dynamicRadiosMap.get(optionValue).toString();
}
else {
optionDisplay = "";
}
if (optionValue != null) {
addOption(_writer, INPUT_RADIO, optionValue.toString(), optionDisplay, idx++, altText, accessKey, _disabled);
}
if (hasErrors()) {
reportErrors();
localRelease();
return EVAL_PAGE;
}
write("\n");
}
}
else {
assert(_dynamicAttrs instanceof Iterator);
Iterator it = (Iterator) _dynamicAttrs;
int idx = 0;
while (it.hasNext()) {
Object o = it.next();
if (o == null)
continue;
if (o instanceof GroupOption) {
GroupOption go = (GroupOption) o;
addOption(_writer, INPUT_RADIO, go.getValue(), go.getName(), idx++, go.getAlt(), go.getAccessKey(), _disabled);
}
else {
String radioValue = o.toString();
addOption(_writer, INPUT_RADIO, radioValue, radioValue, idx++, altText, accessKey, _disabled);
}
if (hasErrors()) {
reportErrors();
localRelease();
return EVAL_PAGE;
}
write("\n");
}
}
if (isVertical()) {
_cr.end_TABLE(_writer);
}
if (idScript != null)
write(idScript);
//write(results.toString());
localRelease();
return EVAL_PAGE;
}
|
java
|
public int doEndTag() throws JspException
{
if (hasErrors())
return reportAndExit(EVAL_PAGE);
String idScript = null;
String altText = null;
char accessKey = 0x00;
// Remove the page scope attributes we created
pageContext.removeAttribute(RADIOBUTTONGROUP_KEY);
ServletRequest req = pageContext.getRequest();
if (_cr == null)
_cr = TagRenderingBase.Factory.getConstantRendering(req);
//InternalStringBuilder results = new InternalStringBuilder(128);
if (_saveBody != null)
write(_saveBody.toString());
// if this is a repeater we output the content during the body processing
if (_repeater) {
// Render a tag representing the end of our current form
if (isVertical())
_cr.end_TABLE(_writer);
if (idScript != null)
write(idScript);
//write(results.toString());
localRelease();
return EVAL_PAGE;
}
// Render a tag representing the end of our current form
if (_dynamicAttrs instanceof Map) {
Map dynamicRadiosMap = (Map) _dynamicAttrs;
Iterator keyIterator = dynamicRadiosMap.keySet().iterator();
int idx = 0;
while (keyIterator.hasNext()) {
Object optionValue = keyIterator.next();
String optionDisplay = null;
if (dynamicRadiosMap.get(optionValue) != null) {
optionDisplay = dynamicRadiosMap.get(optionValue).toString();
}
else {
optionDisplay = "";
}
if (optionValue != null) {
addOption(_writer, INPUT_RADIO, optionValue.toString(), optionDisplay, idx++, altText, accessKey, _disabled);
}
if (hasErrors()) {
reportErrors();
localRelease();
return EVAL_PAGE;
}
write("\n");
}
}
else {
assert(_dynamicAttrs instanceof Iterator);
Iterator it = (Iterator) _dynamicAttrs;
int idx = 0;
while (it.hasNext()) {
Object o = it.next();
if (o == null)
continue;
if (o instanceof GroupOption) {
GroupOption go = (GroupOption) o;
addOption(_writer, INPUT_RADIO, go.getValue(), go.getName(), idx++, go.getAlt(), go.getAccessKey(), _disabled);
}
else {
String radioValue = o.toString();
addOption(_writer, INPUT_RADIO, radioValue, radioValue, idx++, altText, accessKey, _disabled);
}
if (hasErrors()) {
reportErrors();
localRelease();
return EVAL_PAGE;
}
write("\n");
}
}
if (isVertical()) {
_cr.end_TABLE(_writer);
}
if (idScript != null)
write(idScript);
//write(results.toString());
localRelease();
return EVAL_PAGE;
}
|
[
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"reportAndExit",
"(",
"EVAL_PAGE",
")",
";",
"String",
"idScript",
"=",
"null",
";",
"String",
"altText",
"=",
"null",
";",
"char",
"accessKey",
"=",
"0x00",
";",
"// Remove the page scope attributes we created",
"pageContext",
".",
"removeAttribute",
"(",
"RADIOBUTTONGROUP_KEY",
")",
";",
"ServletRequest",
"req",
"=",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"if",
"(",
"_cr",
"==",
"null",
")",
"_cr",
"=",
"TagRenderingBase",
".",
"Factory",
".",
"getConstantRendering",
"(",
"req",
")",
";",
"//InternalStringBuilder results = new InternalStringBuilder(128);",
"if",
"(",
"_saveBody",
"!=",
"null",
")",
"write",
"(",
"_saveBody",
".",
"toString",
"(",
")",
")",
";",
"// if this is a repeater we output the content during the body processing",
"if",
"(",
"_repeater",
")",
"{",
"// Render a tag representing the end of our current form",
"if",
"(",
"isVertical",
"(",
")",
")",
"_cr",
".",
"end_TABLE",
"(",
"_writer",
")",
";",
"if",
"(",
"idScript",
"!=",
"null",
")",
"write",
"(",
"idScript",
")",
";",
"//write(results.toString());",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}",
"// Render a tag representing the end of our current form",
"if",
"(",
"_dynamicAttrs",
"instanceof",
"Map",
")",
"{",
"Map",
"dynamicRadiosMap",
"=",
"(",
"Map",
")",
"_dynamicAttrs",
";",
"Iterator",
"keyIterator",
"=",
"dynamicRadiosMap",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"int",
"idx",
"=",
"0",
";",
"while",
"(",
"keyIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"optionValue",
"=",
"keyIterator",
".",
"next",
"(",
")",
";",
"String",
"optionDisplay",
"=",
"null",
";",
"if",
"(",
"dynamicRadiosMap",
".",
"get",
"(",
"optionValue",
")",
"!=",
"null",
")",
"{",
"optionDisplay",
"=",
"dynamicRadiosMap",
".",
"get",
"(",
"optionValue",
")",
".",
"toString",
"(",
")",
";",
"}",
"else",
"{",
"optionDisplay",
"=",
"\"\"",
";",
"}",
"if",
"(",
"optionValue",
"!=",
"null",
")",
"{",
"addOption",
"(",
"_writer",
",",
"INPUT_RADIO",
",",
"optionValue",
".",
"toString",
"(",
")",
",",
"optionDisplay",
",",
"idx",
"++",
",",
"altText",
",",
"accessKey",
",",
"_disabled",
")",
";",
"}",
"if",
"(",
"hasErrors",
"(",
")",
")",
"{",
"reportErrors",
"(",
")",
";",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}",
"write",
"(",
"\"\\n\"",
")",
";",
"}",
"}",
"else",
"{",
"assert",
"(",
"_dynamicAttrs",
"instanceof",
"Iterator",
")",
";",
"Iterator",
"it",
"=",
"(",
"Iterator",
")",
"_dynamicAttrs",
";",
"int",
"idx",
"=",
"0",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"o",
"=",
"it",
".",
"next",
"(",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"continue",
";",
"if",
"(",
"o",
"instanceof",
"GroupOption",
")",
"{",
"GroupOption",
"go",
"=",
"(",
"GroupOption",
")",
"o",
";",
"addOption",
"(",
"_writer",
",",
"INPUT_RADIO",
",",
"go",
".",
"getValue",
"(",
")",
",",
"go",
".",
"getName",
"(",
")",
",",
"idx",
"++",
",",
"go",
".",
"getAlt",
"(",
")",
",",
"go",
".",
"getAccessKey",
"(",
")",
",",
"_disabled",
")",
";",
"}",
"else",
"{",
"String",
"radioValue",
"=",
"o",
".",
"toString",
"(",
")",
";",
"addOption",
"(",
"_writer",
",",
"INPUT_RADIO",
",",
"radioValue",
",",
"radioValue",
",",
"idx",
"++",
",",
"altText",
",",
"accessKey",
",",
"_disabled",
")",
";",
"}",
"if",
"(",
"hasErrors",
"(",
")",
")",
"{",
"reportErrors",
"(",
")",
";",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}",
"write",
"(",
"\"\\n\"",
")",
";",
"}",
"}",
"if",
"(",
"isVertical",
"(",
")",
")",
"{",
"_cr",
".",
"end_TABLE",
"(",
"_writer",
")",
";",
"}",
"if",
"(",
"idScript",
"!=",
"null",
")",
"write",
"(",
"idScript",
")",
";",
"//write(results.toString());",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}"
] |
Render the set of RadioButtonOptions.
@throws JspException if a JSP exception has occurred
|
[
"Render",
"the",
"set",
"of",
"RadioButtonOptions",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RadioButtonGroup.java#L369-L467
|
146,471
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/MultipartRequestUtils.java
|
MultipartRequestUtils.preHandleMultipartRequest
|
static void preHandleMultipartRequest(HttpServletRequest request)
throws ServletException
{
MultipartRequestHandler multipartHandler = getCachedMultipartHandler(request);
if (multipartHandler == null)
{
multipartHandler = getMultipartHandler(request);
if (multipartHandler != null)
{
//
// Run the request through the handler, and cache the handler in the outer request.
//
multipartHandler.handleRequest(request);
HttpServletRequest outerRequest = ScopedServletUtils.getOuterRequest(request);
outerRequest.setAttribute(PREHANDLED_MULTIPART_REQUEST_ATTR, multipartHandler);
}
}
}
|
java
|
static void preHandleMultipartRequest(HttpServletRequest request)
throws ServletException
{
MultipartRequestHandler multipartHandler = getCachedMultipartHandler(request);
if (multipartHandler == null)
{
multipartHandler = getMultipartHandler(request);
if (multipartHandler != null)
{
//
// Run the request through the handler, and cache the handler in the outer request.
//
multipartHandler.handleRequest(request);
HttpServletRequest outerRequest = ScopedServletUtils.getOuterRequest(request);
outerRequest.setAttribute(PREHANDLED_MULTIPART_REQUEST_ATTR, multipartHandler);
}
}
}
|
[
"static",
"void",
"preHandleMultipartRequest",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"ServletException",
"{",
"MultipartRequestHandler",
"multipartHandler",
"=",
"getCachedMultipartHandler",
"(",
"request",
")",
";",
"if",
"(",
"multipartHandler",
"==",
"null",
")",
"{",
"multipartHandler",
"=",
"getMultipartHandler",
"(",
"request",
")",
";",
"if",
"(",
"multipartHandler",
"!=",
"null",
")",
"{",
"//",
"// Run the request through the handler, and cache the handler in the outer request.",
"//",
"multipartHandler",
".",
"handleRequest",
"(",
"request",
")",
";",
"HttpServletRequest",
"outerRequest",
"=",
"ScopedServletUtils",
".",
"getOuterRequest",
"(",
"request",
")",
";",
"outerRequest",
".",
"setAttribute",
"(",
"PREHANDLED_MULTIPART_REQUEST_ATTR",
",",
"multipartHandler",
")",
";",
"}",
"}",
"}"
] |
Can be called early in the request processing cycle to cache a single multipart handler for the request.
|
[
"Can",
"be",
"called",
"early",
"in",
"the",
"request",
"processing",
"cycle",
"to",
"cache",
"a",
"single",
"multipart",
"handler",
"for",
"the",
"request",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/MultipartRequestUtils.java#L195-L214
|
146,472
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRootElement.java
|
TreeRootElement.changeSelected
|
public void changeSelected(String selectNode, ServletRequest request)
{
_selectedNode = TreeHelpers.changeSelected(this, _selectedNode, selectNode, request);
}
|
java
|
public void changeSelected(String selectNode, ServletRequest request)
{
_selectedNode = TreeHelpers.changeSelected(this, _selectedNode, selectNode, request);
}
|
[
"public",
"void",
"changeSelected",
"(",
"String",
"selectNode",
",",
"ServletRequest",
"request",
")",
"{",
"_selectedNode",
"=",
"TreeHelpers",
".",
"changeSelected",
"(",
"this",
",",
"_selectedNode",
",",
"selectNode",
",",
"request",
")",
";",
"}"
] |
Change the node that is selected. This is an optimization were the
root node can track which node is currently selected so it can unselect
that node instead of searching the whole tree to find the selected node.
@param selectNode
|
[
"Change",
"the",
"node",
"that",
"is",
"selected",
".",
"This",
"is",
"an",
"optimization",
"were",
"the",
"root",
"node",
"can",
"track",
"which",
"node",
"is",
"currently",
"selected",
"so",
"it",
"can",
"unselect",
"that",
"node",
"instead",
"of",
"searching",
"the",
"whole",
"tree",
"to",
"find",
"the",
"selected",
"node",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRootElement.java#L61-L64
|
146,473
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/AbstractACModel.java
|
AbstractACModel.checkValidity
|
public void checkValidity() throws ACMValidationException {
if (context == null) {
throw new ACMValidationException("Invalid state of AC model: No context assigned");
}
if (!getContext().containsActivities()) {
return;
}
for (String activity : getContext().getActivities()) {
try {
if (!isExecutable(activity)) {
throw new ACMValidationException("Model contains non-executable transactions: " + activity);
}
} catch (CompatibilityException e) {
throw new ACMValidationException("Error during validation check: " + e.getMessage());
}
}
}
|
java
|
public void checkValidity() throws ACMValidationException {
if (context == null) {
throw new ACMValidationException("Invalid state of AC model: No context assigned");
}
if (!getContext().containsActivities()) {
return;
}
for (String activity : getContext().getActivities()) {
try {
if (!isExecutable(activity)) {
throw new ACMValidationException("Model contains non-executable transactions: " + activity);
}
} catch (CompatibilityException e) {
throw new ACMValidationException("Error during validation check: " + e.getMessage());
}
}
}
|
[
"public",
"void",
"checkValidity",
"(",
")",
"throws",
"ACMValidationException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"ACMValidationException",
"(",
"\"Invalid state of AC model: No context assigned\"",
")",
";",
"}",
"if",
"(",
"!",
"getContext",
"(",
")",
".",
"containsActivities",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"String",
"activity",
":",
"getContext",
"(",
")",
".",
"getActivities",
"(",
")",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isExecutable",
"(",
"activity",
")",
")",
"{",
"throw",
"new",
"ACMValidationException",
"(",
"\"Model contains non-executable transactions: \"",
"+",
"activity",
")",
";",
"}",
"}",
"catch",
"(",
"CompatibilityException",
"e",
")",
"{",
"throw",
"new",
"ACMValidationException",
"(",
"\"Error during validation check: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}",
"}"
] |
An Access Control Model is considered valid, if all transactions are
executable.
@throws ACMValidationException
|
[
"An",
"Access",
"Control",
"Model",
"is",
"considered",
"valid",
"if",
"all",
"transactions",
"are",
"executable",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/AbstractACModel.java#L212-L228
|
146,474
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/util/XRegistry.java
|
XRegistry.register
|
public void register(T instance) {
if(!isContained(instance)) {
registry.add(instance);
if(current == null) {
current = instance;
}
}
}
|
java
|
public void register(T instance) {
if(!isContained(instance)) {
registry.add(instance);
if(current == null) {
current = instance;
}
}
}
|
[
"public",
"void",
"register",
"(",
"T",
"instance",
")",
"{",
"if",
"(",
"!",
"isContained",
"(",
"instance",
")",
")",
"{",
"registry",
".",
"add",
"(",
"instance",
")",
";",
"if",
"(",
"current",
"==",
"null",
")",
"{",
"current",
"=",
"instance",
";",
"}",
"}",
"}"
] |
Registers a new instance with this registry.
@param instance Instance to be registered.
|
[
"Registers",
"a",
"new",
"instance",
"with",
"this",
"registry",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/util/XRegistry.java#L88-L95
|
146,475
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/util/XRegistry.java
|
XRegistry.isContained
|
protected boolean isContained(T instance) {
for(T ref : registry) {
if(areEqual(instance, ref)) {
return true;
}
}
return false;
}
|
java
|
protected boolean isContained(T instance) {
for(T ref : registry) {
if(areEqual(instance, ref)) {
return true;
}
}
return false;
}
|
[
"protected",
"boolean",
"isContained",
"(",
"T",
"instance",
")",
"{",
"for",
"(",
"T",
"ref",
":",
"registry",
")",
"{",
"if",
"(",
"areEqual",
"(",
"instance",
",",
"ref",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] |
Checks whether the given instance is already
contained in the registry.
@param instance Instance to check against registry.
@return Whether the given instance is already registered.
|
[
"Checks",
"whether",
"the",
"given",
"instance",
"is",
"already",
"contained",
"in",
"the",
"registry",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/util/XRegistry.java#L127-L134
|
146,476
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java
|
AptProperty.getReadMethod
|
public String getReadMethod()
{
StringBuffer sb = new StringBuffer();
if (getType().equals("boolean"))
sb.append("is");
else
sb.append("get");
sb.append(getAccessorName());
return sb.toString();
}
|
java
|
public String getReadMethod()
{
StringBuffer sb = new StringBuffer();
if (getType().equals("boolean"))
sb.append("is");
else
sb.append("get");
sb.append(getAccessorName());
return sb.toString();
}
|
[
"public",
"String",
"getReadMethod",
"(",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"if",
"(",
"getType",
"(",
")",
".",
"equals",
"(",
"\"boolean\"",
")",
")",
"sb",
".",
"append",
"(",
"\"is\"",
")",
";",
"else",
"sb",
".",
"append",
"(",
"\"get\"",
")",
";",
"sb",
".",
"append",
"(",
"getAccessorName",
"(",
")",
")",
";",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] |
Returns the name of the property reading accessor method
|
[
"Returns",
"the",
"name",
"of",
"the",
"property",
"reading",
"accessor",
"method"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java#L90-L99
|
146,477
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java
|
AptProperty.getType
|
public String getType()
{
if ( _propDecl == null || _propDecl.getReturnType() == null )
return "";
return _propDecl.getReturnType().toString();
}
|
java
|
public String getType()
{
if ( _propDecl == null || _propDecl.getReturnType() == null )
return "";
return _propDecl.getReturnType().toString();
}
|
[
"public",
"String",
"getType",
"(",
")",
"{",
"if",
"(",
"_propDecl",
"==",
"null",
"||",
"_propDecl",
".",
"getReturnType",
"(",
")",
"==",
"null",
")",
"return",
"\"\"",
";",
"return",
"_propDecl",
".",
"getReturnType",
"(",
")",
".",
"toString",
"(",
")",
";",
"}"
] |
Returns the type of the Property
|
[
"Returns",
"the",
"type",
"of",
"the",
"Property"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java#L134-L140
|
146,478
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java
|
AptProperty.isBound
|
public boolean isBound()
{
//
// Constrained properties are implicitly bound. Refer to section 7.4.3 of the JavaBeans
// spec for the rationale.
//
PropertyInfo propInfo = getPropertyInfo();
return propInfo != null && (propInfo.bound() || propInfo.constrained());
}
|
java
|
public boolean isBound()
{
//
// Constrained properties are implicitly bound. Refer to section 7.4.3 of the JavaBeans
// spec for the rationale.
//
PropertyInfo propInfo = getPropertyInfo();
return propInfo != null && (propInfo.bound() || propInfo.constrained());
}
|
[
"public",
"boolean",
"isBound",
"(",
")",
"{",
"//",
"// Constrained properties are implicitly bound. Refer to section 7.4.3 of the JavaBeans",
"// spec for the rationale.",
"//",
"PropertyInfo",
"propInfo",
"=",
"getPropertyInfo",
"(",
")",
";",
"return",
"propInfo",
"!=",
"null",
"&&",
"(",
"propInfo",
".",
"bound",
"(",
")",
"||",
"propInfo",
".",
"constrained",
"(",
")",
")",
";",
"}"
] |
Returns 'true' is the property is a bound property that will support registration of
a PropertyChangeListener for change notifications.
|
[
"Returns",
"true",
"is",
"the",
"property",
"is",
"a",
"bound",
"property",
"that",
"will",
"support",
"registration",
"of",
"a",
"PropertyChangeListener",
"for",
"change",
"notifications",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java#L179-L187
|
146,479
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java
|
AptProperty.getEditorClass
|
public String getEditorClass()
{
PropertyInfo pi = getPropertyInfo();
if (pi == null)
return null;
//
// This is trickier, because APT doesn't allow access to Class-valued annotations,
// because the type may not yet have been compiled.
//
Collection<AnnotationMirror> annotMirrors = _propDecl.getAnnotationMirrors();
for (AnnotationMirror am: annotMirrors)
{
if (am.getAnnotationType().toString().equals(
"org.apache.beehive.controls.api.packaging.PropertyInfo"))
{
Map<AnnotationTypeElementDeclaration,AnnotationValue> avs =
am.getElementValues();
for (AnnotationTypeElementDeclaration ated: avs.keySet())
{
if (ated.toString().equals("editorClass()"))
{
//
// Get the annotation value, and ignore the default value which implies
// no editor class (because 'null' cannot be a default value)
//
String editorClass = avs.get(ated).getValue().toString();
if (editorClass.equals("org.apache.beehive.controls.api.packaging.PropertyInfo.NoEditor.class"))
return null;
return editorClass;
}
}
break;
}
}
return null;
}
|
java
|
public String getEditorClass()
{
PropertyInfo pi = getPropertyInfo();
if (pi == null)
return null;
//
// This is trickier, because APT doesn't allow access to Class-valued annotations,
// because the type may not yet have been compiled.
//
Collection<AnnotationMirror> annotMirrors = _propDecl.getAnnotationMirrors();
for (AnnotationMirror am: annotMirrors)
{
if (am.getAnnotationType().toString().equals(
"org.apache.beehive.controls.api.packaging.PropertyInfo"))
{
Map<AnnotationTypeElementDeclaration,AnnotationValue> avs =
am.getElementValues();
for (AnnotationTypeElementDeclaration ated: avs.keySet())
{
if (ated.toString().equals("editorClass()"))
{
//
// Get the annotation value, and ignore the default value which implies
// no editor class (because 'null' cannot be a default value)
//
String editorClass = avs.get(ated).getValue().toString();
if (editorClass.equals("org.apache.beehive.controls.api.packaging.PropertyInfo.NoEditor.class"))
return null;
return editorClass;
}
}
break;
}
}
return null;
}
|
[
"public",
"String",
"getEditorClass",
"(",
")",
"{",
"PropertyInfo",
"pi",
"=",
"getPropertyInfo",
"(",
")",
";",
"if",
"(",
"pi",
"==",
"null",
")",
"return",
"null",
";",
"//",
"// This is trickier, because APT doesn't allow access to Class-valued annotations,",
"// because the type may not yet have been compiled.",
"//",
"Collection",
"<",
"AnnotationMirror",
">",
"annotMirrors",
"=",
"_propDecl",
".",
"getAnnotationMirrors",
"(",
")",
";",
"for",
"(",
"AnnotationMirror",
"am",
":",
"annotMirrors",
")",
"{",
"if",
"(",
"am",
".",
"getAnnotationType",
"(",
")",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"\"org.apache.beehive.controls.api.packaging.PropertyInfo\"",
")",
")",
"{",
"Map",
"<",
"AnnotationTypeElementDeclaration",
",",
"AnnotationValue",
">",
"avs",
"=",
"am",
".",
"getElementValues",
"(",
")",
";",
"for",
"(",
"AnnotationTypeElementDeclaration",
"ated",
":",
"avs",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"ated",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"\"editorClass()\"",
")",
")",
"{",
"//",
"// Get the annotation value, and ignore the default value which implies",
"// no editor class (because 'null' cannot be a default value)",
"//",
"String",
"editorClass",
"=",
"avs",
".",
"get",
"(",
"ated",
")",
".",
"getValue",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"editorClass",
".",
"equals",
"(",
"\"org.apache.beehive.controls.api.packaging.PropertyInfo.NoEditor.class\"",
")",
")",
"return",
"null",
";",
"return",
"editorClass",
";",
"}",
"}",
"break",
";",
"}",
"}",
"return",
"null",
";",
"}"
] |
Returns the class name of the property editor class, or null
|
[
"Returns",
"the",
"class",
"name",
"of",
"the",
"property",
"editor",
"class",
"or",
"null"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptProperty.java#L202-L239
|
146,480
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/ControlAnnotationProcessor.java
|
ControlAnnotationProcessor.getGenerator
|
protected CodeGenerator getGenerator()
{
if (_generator == null)
{
//
// Locate the class that wraps the Velocity code generation process
//
AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();
try
{
_generator = new VelocityGenerator(env);
}
catch (Exception e)
{
throw new CodeGenerationException("Unable to create code generator", e);
}
}
return _generator;
}
|
java
|
protected CodeGenerator getGenerator()
{
if (_generator == null)
{
//
// Locate the class that wraps the Velocity code generation process
//
AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();
try
{
_generator = new VelocityGenerator(env);
}
catch (Exception e)
{
throw new CodeGenerationException("Unable to create code generator", e);
}
}
return _generator;
}
|
[
"protected",
"CodeGenerator",
"getGenerator",
"(",
")",
"{",
"if",
"(",
"_generator",
"==",
"null",
")",
"{",
"//",
"// Locate the class that wraps the Velocity code generation process",
"//",
"AnnotationProcessorEnvironment",
"env",
"=",
"getAnnotationProcessorEnvironment",
"(",
")",
";",
"try",
"{",
"_generator",
"=",
"new",
"VelocityGenerator",
"(",
"env",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"CodeGenerationException",
"(",
"\"Unable to create code generator\"",
",",
"e",
")",
";",
"}",
"}",
"return",
"_generator",
";",
"}"
] |
Returns the CodeGenerator instance supporting this processor, instantiating a new
generator instance if necessary.
|
[
"Returns",
"the",
"CodeGenerator",
"instance",
"supporting",
"this",
"processor",
"instantiating",
"a",
"new",
"generator",
"instance",
"if",
"necessary",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/ControlAnnotationProcessor.java#L143-L162
|
146,481
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/ParameterMap.java
|
ParameterMap.setMap
|
public void setMap(Map map) throws JspException
{
if (map == null) {
String s = Bundle.getString("Tags_MapAttrValueRequired", new Object[]{"map"});
registerTagError(s, null);
}
_map = map;
}
|
java
|
public void setMap(Map map) throws JspException
{
if (map == null) {
String s = Bundle.getString("Tags_MapAttrValueRequired", new Object[]{"map"});
registerTagError(s, null);
}
_map = map;
}
|
[
"public",
"void",
"setMap",
"(",
"Map",
"map",
")",
"throws",
"JspException",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_MapAttrValueRequired\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"map\"",
"}",
")",
";",
"registerTagError",
"(",
"s",
",",
"null",
")",
";",
"}",
"_map",
"=",
"map",
";",
"}"
] |
Sets the map expression.
@param map the map expression.
@jsptagref.attributedescription A data binding expression pointing to a {@link java.util.Map java.util.Map} of parameters.
The expression can point at any implementation of the java.util.Map interface,
including {@link java.util.AbstractMap java.util.AbstractMap},
{@link java.util.HashMap java.util.HashMap},
{@link java.util.Hashtable java.util.Hashtable}, etc.
@jsptagref.databindable Read Only
@jsptagref.attributesyntaxvalue <i>string_mapObject</i>
@netui:attribute required="true" rtexprvalue="true" type="java.util.Map"
description="A JSP 2.0 EL expression pointing to a java.util.Map of parameters."
|
[
"Sets",
"the",
"map",
"expression",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/ParameterMap.java#L91-L98
|
146,482
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/ParameterMap.java
|
ParameterMap.doStartTag
|
public int doStartTag() throws JspException
{
if (hasErrors())
return reportAndExit(SKIP_BODY);
Tag parentTag = findAncestorWithClass(this, IUrlParams.class);
if (parentTag != null) {
// this map shouldn't be null because the attribute is required.
assert(_map != null);
IUrlParams parent = (IUrlParams) parentTag;
Iterator it = _map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry key = (Map.Entry) it.next();
parent.addParameter(key.getKey().toString(), key.getValue(), null);
}
}
else {
String msg = Bundle.getString("Tags_InvalidParameterMapParent");
registerTagError(msg, null);
reportErrors();
}
localRelease();
return SKIP_BODY;
}
|
java
|
public int doStartTag() throws JspException
{
if (hasErrors())
return reportAndExit(SKIP_BODY);
Tag parentTag = findAncestorWithClass(this, IUrlParams.class);
if (parentTag != null) {
// this map shouldn't be null because the attribute is required.
assert(_map != null);
IUrlParams parent = (IUrlParams) parentTag;
Iterator it = _map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry key = (Map.Entry) it.next();
parent.addParameter(key.getKey().toString(), key.getValue(), null);
}
}
else {
String msg = Bundle.getString("Tags_InvalidParameterMapParent");
registerTagError(msg, null);
reportErrors();
}
localRelease();
return SKIP_BODY;
}
|
[
"public",
"int",
"doStartTag",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"reportAndExit",
"(",
"SKIP_BODY",
")",
";",
"Tag",
"parentTag",
"=",
"findAncestorWithClass",
"(",
"this",
",",
"IUrlParams",
".",
"class",
")",
";",
"if",
"(",
"parentTag",
"!=",
"null",
")",
"{",
"// this map shouldn't be null because the attribute is required.",
"assert",
"(",
"_map",
"!=",
"null",
")",
";",
"IUrlParams",
"parent",
"=",
"(",
"IUrlParams",
")",
"parentTag",
";",
"Iterator",
"it",
"=",
"_map",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Map",
".",
"Entry",
"key",
"=",
"(",
"Map",
".",
"Entry",
")",
"it",
".",
"next",
"(",
")",
";",
"parent",
".",
"addParameter",
"(",
"key",
".",
"getKey",
"(",
")",
".",
"toString",
"(",
")",
",",
"key",
".",
"getValue",
"(",
")",
",",
"null",
")",
";",
"}",
"}",
"else",
"{",
"String",
"msg",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_InvalidParameterMapParent\"",
")",
";",
"registerTagError",
"(",
"msg",
",",
"null",
")",
";",
"reportErrors",
"(",
")",
";",
"}",
"localRelease",
"(",
")",
";",
"return",
"SKIP_BODY",
";",
"}"
] |
Add each parameter in the URL parameter map to the Parameter's parent.
@throws JspException if a JSP exception has occurred
|
[
"Add",
"each",
"parameter",
"in",
"the",
"URL",
"parameter",
"map",
"to",
"the",
"Parameter",
"s",
"parent",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/ParameterMap.java#L104-L128
|
146,483
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowToXmlObjectMapper.java
|
RowToXmlObjectMapper.getResultSetMappings
|
private void getResultSetMappings() throws SQLException {
//
// special case for XmlObject, find factory class
//
if (_schemaType.isDocumentType()) {
return;
}
final String[] keys = getKeysFromResultSet();
//
// find setters for return class
//
HashMap<String, Method> mapFields = new HashMap<String, Method>(_columnCount * 2);
for (int i = 1; i <= _columnCount; i++) {
mapFields.put(keys[i], null);
}
// public methods
Method[] classMethods = _returnTypeClass.getMethods();
for (Method method : classMethods) {
if (isSetterMethod(method)) {
final String fieldName = method.getName().substring(3).toUpperCase();
if (mapFields.containsKey(fieldName)) {
mapFields.put(fieldName, method);
}
}
}
// finally actually init the fields array
_setterMethods = new SetterMethod[_columnCount + 1];
for (int i = 1; i < _setterMethods.length; i++) {
Method setterMethod = mapFields.get(keys[i]);
if (setterMethod == null) {
throw new ControlException("Unable to map the SQL column " + keys[i]
+ " to a field on the " + _returnTypeClass.getName() +
" class. Mapping is done using a case insensitive comparision of SQL ResultSet "
+ "columns to public setter methods on the return class.");
}
_setterMethods[i] = new SetterMethod(setterMethod);
}
}
|
java
|
private void getResultSetMappings() throws SQLException {
//
// special case for XmlObject, find factory class
//
if (_schemaType.isDocumentType()) {
return;
}
final String[] keys = getKeysFromResultSet();
//
// find setters for return class
//
HashMap<String, Method> mapFields = new HashMap<String, Method>(_columnCount * 2);
for (int i = 1; i <= _columnCount; i++) {
mapFields.put(keys[i], null);
}
// public methods
Method[] classMethods = _returnTypeClass.getMethods();
for (Method method : classMethods) {
if (isSetterMethod(method)) {
final String fieldName = method.getName().substring(3).toUpperCase();
if (mapFields.containsKey(fieldName)) {
mapFields.put(fieldName, method);
}
}
}
// finally actually init the fields array
_setterMethods = new SetterMethod[_columnCount + 1];
for (int i = 1; i < _setterMethods.length; i++) {
Method setterMethod = mapFields.get(keys[i]);
if (setterMethod == null) {
throw new ControlException("Unable to map the SQL column " + keys[i]
+ " to a field on the " + _returnTypeClass.getName() +
" class. Mapping is done using a case insensitive comparision of SQL ResultSet "
+ "columns to public setter methods on the return class.");
}
_setterMethods[i] = new SetterMethod(setterMethod);
}
}
|
[
"private",
"void",
"getResultSetMappings",
"(",
")",
"throws",
"SQLException",
"{",
"//",
"// special case for XmlObject, find factory class",
"//",
"if",
"(",
"_schemaType",
".",
"isDocumentType",
"(",
")",
")",
"{",
"return",
";",
"}",
"final",
"String",
"[",
"]",
"keys",
"=",
"getKeysFromResultSet",
"(",
")",
";",
"//",
"// find setters for return class",
"//",
"HashMap",
"<",
"String",
",",
"Method",
">",
"mapFields",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Method",
">",
"(",
"_columnCount",
"*",
"2",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"_columnCount",
";",
"i",
"++",
")",
"{",
"mapFields",
".",
"put",
"(",
"keys",
"[",
"i",
"]",
",",
"null",
")",
";",
"}",
"// public methods",
"Method",
"[",
"]",
"classMethods",
"=",
"_returnTypeClass",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
"Method",
"method",
":",
"classMethods",
")",
"{",
"if",
"(",
"isSetterMethod",
"(",
"method",
")",
")",
"{",
"final",
"String",
"fieldName",
"=",
"method",
".",
"getName",
"(",
")",
".",
"substring",
"(",
"3",
")",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"mapFields",
".",
"containsKey",
"(",
"fieldName",
")",
")",
"{",
"mapFields",
".",
"put",
"(",
"fieldName",
",",
"method",
")",
";",
"}",
"}",
"}",
"// finally actually init the fields array",
"_setterMethods",
"=",
"new",
"SetterMethod",
"[",
"_columnCount",
"+",
"1",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"_setterMethods",
".",
"length",
";",
"i",
"++",
")",
"{",
"Method",
"setterMethod",
"=",
"mapFields",
".",
"get",
"(",
"keys",
"[",
"i",
"]",
")",
";",
"if",
"(",
"setterMethod",
"==",
"null",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Unable to map the SQL column \"",
"+",
"keys",
"[",
"i",
"]",
"+",
"\" to a field on the \"",
"+",
"_returnTypeClass",
".",
"getName",
"(",
")",
"+",
"\" class. Mapping is done using a case insensitive comparision of SQL ResultSet \"",
"+",
"\"columns to public setter methods on the return class.\"",
")",
";",
"}",
"_setterMethods",
"[",
"i",
"]",
"=",
"new",
"SetterMethod",
"(",
"setterMethod",
")",
";",
"}",
"}"
] |
Build the necessary structures to do the mapping
@throws SQLException
|
[
"Build",
"the",
"necessary",
"structures",
"to",
"do",
"the",
"mapping"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowToXmlObjectMapper.java#L159-L204
|
146,484
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowToXmlObjectMapper.java
|
RowToXmlObjectMapper.getSchemaType
|
private SchemaType getSchemaType(Class returnType) {
SchemaType schemaType = null;
if (XmlObject.class.isAssignableFrom(returnType)) {
try {
Field f = returnType.getField("type");
if (SchemaType.class.isAssignableFrom(f.getType()) && Modifier.isStatic(f.getModifiers())) {
schemaType = (SchemaType) f.get(null);
}
} catch (NoSuchFieldException x) {
} catch (IllegalAccessException x) {
}
}
return schemaType;
}
|
java
|
private SchemaType getSchemaType(Class returnType) {
SchemaType schemaType = null;
if (XmlObject.class.isAssignableFrom(returnType)) {
try {
Field f = returnType.getField("type");
if (SchemaType.class.isAssignableFrom(f.getType()) && Modifier.isStatic(f.getModifiers())) {
schemaType = (SchemaType) f.get(null);
}
} catch (NoSuchFieldException x) {
} catch (IllegalAccessException x) {
}
}
return schemaType;
}
|
[
"private",
"SchemaType",
"getSchemaType",
"(",
"Class",
"returnType",
")",
"{",
"SchemaType",
"schemaType",
"=",
"null",
";",
"if",
"(",
"XmlObject",
".",
"class",
".",
"isAssignableFrom",
"(",
"returnType",
")",
")",
"{",
"try",
"{",
"Field",
"f",
"=",
"returnType",
".",
"getField",
"(",
"\"type\"",
")",
";",
"if",
"(",
"SchemaType",
".",
"class",
".",
"isAssignableFrom",
"(",
"f",
".",
"getType",
"(",
")",
")",
"&&",
"Modifier",
".",
"isStatic",
"(",
"f",
".",
"getModifiers",
"(",
")",
")",
")",
"{",
"schemaType",
"=",
"(",
"SchemaType",
")",
"f",
".",
"get",
"(",
"null",
")",
";",
"}",
"}",
"catch",
"(",
"NoSuchFieldException",
"x",
")",
"{",
"}",
"catch",
"(",
"IllegalAccessException",
"x",
")",
"{",
"}",
"}",
"return",
"schemaType",
";",
"}"
] |
Get the SchemaType for the specified class.
@param returnType Class to get the SchemaType for.
@return SchemaType
|
[
"Get",
"the",
"SchemaType",
"for",
"the",
"specified",
"class",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowToXmlObjectMapper.java#L240-L253
|
146,485
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
|
ScriptContainer.addScriptFunction
|
public void addScriptFunction(ScriptPlacement placement, String script)
{
assert (script != null) : "The paramter 'script' must not be null";
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.addScriptFunction(placement, script);
return;
}
// get the list of function blocks and add this script to it.
if (placement == null || placement == ScriptPlacement.PLACE_INFRAMEWORK) {
if (_funcBlocks == null) {
_funcBlocks = new ArrayList/*<String>*/();
}
assert (_funcBlocks != null) : "_funcBlocks should not be null";
_funcBlocks.add(script);
}
else if (placement == ScriptPlacement.PLACE_BEFORE) {
if (_codeBefore == null)
_codeBefore = new ArrayList/*<String>*/();
_codeBefore.add(script);
}
else if (placement == ScriptPlacement.PLACE_AFTER) {
if (_codeAfter == null)
_codeAfter = new ArrayList/*<String>*/();
_codeAfter.add(script);
}
else {
assert(false) : "unsupported placement:" + placement;
}
}
|
java
|
public void addScriptFunction(ScriptPlacement placement, String script)
{
assert (script != null) : "The paramter 'script' must not be null";
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.addScriptFunction(placement, script);
return;
}
// get the list of function blocks and add this script to it.
if (placement == null || placement == ScriptPlacement.PLACE_INFRAMEWORK) {
if (_funcBlocks == null) {
_funcBlocks = new ArrayList/*<String>*/();
}
assert (_funcBlocks != null) : "_funcBlocks should not be null";
_funcBlocks.add(script);
}
else if (placement == ScriptPlacement.PLACE_BEFORE) {
if (_codeBefore == null)
_codeBefore = new ArrayList/*<String>*/();
_codeBefore.add(script);
}
else if (placement == ScriptPlacement.PLACE_AFTER) {
if (_codeAfter == null)
_codeAfter = new ArrayList/*<String>*/();
_codeAfter.add(script);
}
else {
assert(false) : "unsupported placement:" + placement;
}
}
|
[
"public",
"void",
"addScriptFunction",
"(",
"ScriptPlacement",
"placement",
",",
"String",
"script",
")",
"{",
"assert",
"(",
"script",
"!=",
"null",
")",
":",
"\"The paramter 'script' must not be null\"",
";",
"IScriptReporter",
"sr",
"=",
"getParentScriptReporter",
"(",
")",
";",
"if",
"(",
"sr",
"!=",
"null",
")",
"{",
"sr",
".",
"addScriptFunction",
"(",
"placement",
",",
"script",
")",
";",
"return",
";",
"}",
"// get the list of function blocks and add this script to it.",
"if",
"(",
"placement",
"==",
"null",
"||",
"placement",
"==",
"ScriptPlacement",
".",
"PLACE_INFRAMEWORK",
")",
"{",
"if",
"(",
"_funcBlocks",
"==",
"null",
")",
"{",
"_funcBlocks",
"=",
"new",
"ArrayList",
"/*<String>*/",
"(",
")",
";",
"}",
"assert",
"(",
"_funcBlocks",
"!=",
"null",
")",
":",
"\"_funcBlocks should not be null\"",
";",
"_funcBlocks",
".",
"add",
"(",
"script",
")",
";",
"}",
"else",
"if",
"(",
"placement",
"==",
"ScriptPlacement",
".",
"PLACE_BEFORE",
")",
"{",
"if",
"(",
"_codeBefore",
"==",
"null",
")",
"_codeBefore",
"=",
"new",
"ArrayList",
"/*<String>*/",
"(",
")",
";",
"_codeBefore",
".",
"add",
"(",
"script",
")",
";",
"}",
"else",
"if",
"(",
"placement",
"==",
"ScriptPlacement",
".",
"PLACE_AFTER",
")",
"{",
"if",
"(",
"_codeAfter",
"==",
"null",
")",
"_codeAfter",
"=",
"new",
"ArrayList",
"/*<String>*/",
"(",
")",
";",
"_codeAfter",
".",
"add",
"(",
"script",
")",
";",
"}",
"else",
"{",
"assert",
"(",
"false",
")",
":",
"\"unsupported placement:\"",
"+",
"placement",
";",
"}",
"}"
] |
This method will add Script as a function.
@param placement
@param script the text of the function. This value must not be null.
|
[
"This",
"method",
"will",
"add",
"Script",
"as",
"a",
"function",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L105-L135
|
146,486
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
|
ScriptContainer.addLegacyTagIdMappings
|
public void addLegacyTagIdMappings(String tagId, String tagName)
{
assert (tagId != null) : "The parameter 'tagId' must not be null";
assert (tagName != null) : "The parameter 'tagName' must not be null";
if (_idMap == null) {
_idMap = new HashMap/*<String, String>*/();
}
assert (_idMap != null) : "_idMap should not be null";
_idMap.put(tagId, tagName);
}
|
java
|
public void addLegacyTagIdMappings(String tagId, String tagName)
{
assert (tagId != null) : "The parameter 'tagId' must not be null";
assert (tagName != null) : "The parameter 'tagName' must not be null";
if (_idMap == null) {
_idMap = new HashMap/*<String, String>*/();
}
assert (_idMap != null) : "_idMap should not be null";
_idMap.put(tagId, tagName);
}
|
[
"public",
"void",
"addLegacyTagIdMappings",
"(",
"String",
"tagId",
",",
"String",
"tagName",
")",
"{",
"assert",
"(",
"tagId",
"!=",
"null",
")",
":",
"\"The parameter 'tagId' must not be null\"",
";",
"assert",
"(",
"tagName",
"!=",
"null",
")",
":",
"\"The parameter 'tagName' must not be null\"",
";",
"if",
"(",
"_idMap",
"==",
"null",
")",
"{",
"_idMap",
"=",
"new",
"HashMap",
"/*<String, String>*/",
"(",
")",
";",
"}",
"assert",
"(",
"_idMap",
"!=",
"null",
")",
":",
"\"_idMap should not be null\"",
";",
"_idMap",
".",
"put",
"(",
"tagId",
",",
"tagName",
")",
";",
"}"
] |
Adds a tagID and tagName to the Html's getId javascript function.
@param tagId the id of a child tag.
@param tagName the name of a child tag.
|
[
"Adds",
"a",
"tagID",
"and",
"tagName",
"to",
"the",
"Html",
"s",
"getId",
"javascript",
"function",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L142-L153
|
146,487
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
|
ScriptContainer.addTagIdMappings
|
public void addTagIdMappings(String tagId, String realId, String realName)
{
assert (tagId != null) : "The parameter 'tagId' must not be null";
assert (realId != null) : "The parameter 'realId' must not be null";
_writeId = true;
if (realName != null) {
if (_idToNameMap == null)
_idToNameMap = new HashMap/*<String, String>*/();
_idToNameMap.put(tagId, realName);
}
}
|
java
|
public void addTagIdMappings(String tagId, String realId, String realName)
{
assert (tagId != null) : "The parameter 'tagId' must not be null";
assert (realId != null) : "The parameter 'realId' must not be null";
_writeId = true;
if (realName != null) {
if (_idToNameMap == null)
_idToNameMap = new HashMap/*<String, String>*/();
_idToNameMap.put(tagId, realName);
}
}
|
[
"public",
"void",
"addTagIdMappings",
"(",
"String",
"tagId",
",",
"String",
"realId",
",",
"String",
"realName",
")",
"{",
"assert",
"(",
"tagId",
"!=",
"null",
")",
":",
"\"The parameter 'tagId' must not be null\"",
";",
"assert",
"(",
"realId",
"!=",
"null",
")",
":",
"\"The parameter 'realId' must not be null\"",
";",
"_writeId",
"=",
"true",
";",
"if",
"(",
"realName",
"!=",
"null",
")",
"{",
"if",
"(",
"_idToNameMap",
"==",
"null",
")",
"_idToNameMap",
"=",
"new",
"HashMap",
"/*<String, String>*/",
"(",
")",
";",
"_idToNameMap",
".",
"put",
"(",
"tagId",
",",
"realName",
")",
";",
"}",
"}"
] |
This will add the mapping between the tagId and the real name to the NameMap hashmap.
@param tagId
@param realId
@param realName
|
[
"This",
"will",
"add",
"the",
"mapping",
"between",
"the",
"tagId",
"and",
"the",
"real",
"name",
"to",
"the",
"NameMap",
"hashmap",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L161-L173
|
146,488
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
|
ScriptContainer.writeScript
|
public void writeScript(AbstractRenderAppender sb)
{
assert(sb != null) : "The paramter 'sb' must not be null;";
if (_writeScript)
return;
_writeScript = true;
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.writeScript(sb);
return;
}
writeBeforeBlocks(sb);
writeFrameworkScript(sb);
writeAfterBlocks(sb);
}
|
java
|
public void writeScript(AbstractRenderAppender sb)
{
assert(sb != null) : "The paramter 'sb' must not be null;";
if (_writeScript)
return;
_writeScript = true;
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.writeScript(sb);
return;
}
writeBeforeBlocks(sb);
writeFrameworkScript(sb);
writeAfterBlocks(sb);
}
|
[
"public",
"void",
"writeScript",
"(",
"AbstractRenderAppender",
"sb",
")",
"{",
"assert",
"(",
"sb",
"!=",
"null",
")",
":",
"\"The paramter 'sb' must not be null;\"",
";",
"if",
"(",
"_writeScript",
")",
"return",
";",
"_writeScript",
"=",
"true",
";",
"IScriptReporter",
"sr",
"=",
"getParentScriptReporter",
"(",
")",
";",
"if",
"(",
"sr",
"!=",
"null",
")",
"{",
"sr",
".",
"writeScript",
"(",
"sb",
")",
";",
"return",
";",
"}",
"writeBeforeBlocks",
"(",
"sb",
")",
";",
"writeFrameworkScript",
"(",
"sb",
")",
";",
"writeAfterBlocks",
"(",
"sb",
")",
";",
"}"
] |
This method will output all of the Script associated with the script reporter.
@param sb The script is written into the provided InternalStringBuilder. This value must not be null.
|
[
"This",
"method",
"will",
"output",
"all",
"of",
"the",
"Script",
"associated",
"with",
"the",
"script",
"reporter",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L179-L195
|
146,489
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
|
ScriptContainer.getRealIdScope
|
protected String getRealIdScope()
{
ServletRequest request = pageContext.getRequest();
// default to the set idScope.
String idScope = _idScope;
// if there isn't a set idScope and generate scope is on, generate the scope id.
if (_idScope == null && _genScope) {
int id = getNextId(request);
idScope = "n" + Integer.toString(id);
_idScope = idScope;
}
// if there's still no idScope and we're in a ScopedRequest, use the scope-key from the request.
if (_idScope == null) {
ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(request);
if (scopedRequest != null) {
_idScope = scopedRequest.getScopeKey().toString();
idScope = _idScope;
}
}
return idScope;
}
|
java
|
protected String getRealIdScope()
{
ServletRequest request = pageContext.getRequest();
// default to the set idScope.
String idScope = _idScope;
// if there isn't a set idScope and generate scope is on, generate the scope id.
if (_idScope == null && _genScope) {
int id = getNextId(request);
idScope = "n" + Integer.toString(id);
_idScope = idScope;
}
// if there's still no idScope and we're in a ScopedRequest, use the scope-key from the request.
if (_idScope == null) {
ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(request);
if (scopedRequest != null) {
_idScope = scopedRequest.getScopeKey().toString();
idScope = _idScope;
}
}
return idScope;
}
|
[
"protected",
"String",
"getRealIdScope",
"(",
")",
"{",
"ServletRequest",
"request",
"=",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"// default to the set idScope.",
"String",
"idScope",
"=",
"_idScope",
";",
"// if there isn't a set idScope and generate scope is on, generate the scope id.",
"if",
"(",
"_idScope",
"==",
"null",
"&&",
"_genScope",
")",
"{",
"int",
"id",
"=",
"getNextId",
"(",
"request",
")",
";",
"idScope",
"=",
"\"n\"",
"+",
"Integer",
".",
"toString",
"(",
"id",
")",
";",
"_idScope",
"=",
"idScope",
";",
"}",
"// if there's still no idScope and we're in a ScopedRequest, use the scope-key from the request.",
"if",
"(",
"_idScope",
"==",
"null",
")",
"{",
"ScopedRequest",
"scopedRequest",
"=",
"ScopedServletUtils",
".",
"unwrapRequest",
"(",
"request",
")",
";",
"if",
"(",
"scopedRequest",
"!=",
"null",
")",
"{",
"_idScope",
"=",
"scopedRequest",
".",
"getScopeKey",
"(",
")",
".",
"toString",
"(",
")",
";",
"idScope",
"=",
"_idScope",
";",
"}",
"}",
"return",
"idScope",
";",
"}"
] |
This method will return the real scope id for the script container.
@return String
|
[
"This",
"method",
"will",
"return",
"the",
"real",
"scope",
"id",
"for",
"the",
"script",
"container",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L311-L335
|
146,490
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
|
ScriptContainer.writeFrameworkScript
|
protected void writeFrameworkScript(AbstractRenderAppender sb)
{
boolean script = false;
ScriptRequestState jsu = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest());
boolean writeLegacy = false;
boolean writeName = false;
String val;
// if we are writing out legacy JavaScript support output the idMap
if (TagConfig.isLegacyJavaScript()) {
val = processIdMap(_idMap, "idMappingEntry", _idScope);
if (val != null) {
writeIdMap(this, "idMappingTable", val);
writeLegacy = true;
}
}
// if we are writing out default JavaScript support we create the name map
if (TagConfig.isDefaultJavaScript()) {
String idScope = getJavaScriptId();
if (idScope.equals(""))
idScope = null;
val = processIdMap(_idToNameMap, "tagIdNameMappingEntry", idScope);
if (val != null) {
writeIdMap(this, "tagIdNameMappingTable", val);
writeName = true;
}
}
if (writeLegacy || _writeId || writeName)
jsu.writeNetuiNameFunctions(this, writeLegacy, _writeId, writeName);
ScriptTag.State state = null;
ScriptTag br = null;
if (_funcBlocks != null && _funcBlocks.size() > 0) {
if (!script) {
state = new ScriptTag.State();
state.suppressComments = false;
br = (ScriptTag) TagRenderingBase.Factory.getRendering(TagRenderingBase.SCRIPT_TAG, pageContext.getRequest());
br.doStartTag(sb, state);
script = true;
}
String s = ScriptRequestState.getString("functionComment", null);
sb.append(s);
int cnt = _funcBlocks.size();
for (int i = 0; i < cnt; i++) {
sb.append((String)_funcBlocks.get(i));
if (i != cnt - 1) {
sb.append("\n");
}
}
}
if (script) {
assert(br != null);
br.doEndTag(sb, false);
}
}
|
java
|
protected void writeFrameworkScript(AbstractRenderAppender sb)
{
boolean script = false;
ScriptRequestState jsu = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest());
boolean writeLegacy = false;
boolean writeName = false;
String val;
// if we are writing out legacy JavaScript support output the idMap
if (TagConfig.isLegacyJavaScript()) {
val = processIdMap(_idMap, "idMappingEntry", _idScope);
if (val != null) {
writeIdMap(this, "idMappingTable", val);
writeLegacy = true;
}
}
// if we are writing out default JavaScript support we create the name map
if (TagConfig.isDefaultJavaScript()) {
String idScope = getJavaScriptId();
if (idScope.equals(""))
idScope = null;
val = processIdMap(_idToNameMap, "tagIdNameMappingEntry", idScope);
if (val != null) {
writeIdMap(this, "tagIdNameMappingTable", val);
writeName = true;
}
}
if (writeLegacy || _writeId || writeName)
jsu.writeNetuiNameFunctions(this, writeLegacy, _writeId, writeName);
ScriptTag.State state = null;
ScriptTag br = null;
if (_funcBlocks != null && _funcBlocks.size() > 0) {
if (!script) {
state = new ScriptTag.State();
state.suppressComments = false;
br = (ScriptTag) TagRenderingBase.Factory.getRendering(TagRenderingBase.SCRIPT_TAG, pageContext.getRequest());
br.doStartTag(sb, state);
script = true;
}
String s = ScriptRequestState.getString("functionComment", null);
sb.append(s);
int cnt = _funcBlocks.size();
for (int i = 0; i < cnt; i++) {
sb.append((String)_funcBlocks.get(i));
if (i != cnt - 1) {
sb.append("\n");
}
}
}
if (script) {
assert(br != null);
br.doEndTag(sb, false);
}
}
|
[
"protected",
"void",
"writeFrameworkScript",
"(",
"AbstractRenderAppender",
"sb",
")",
"{",
"boolean",
"script",
"=",
"false",
";",
"ScriptRequestState",
"jsu",
"=",
"ScriptRequestState",
".",
"getScriptRequestState",
"(",
"(",
"HttpServletRequest",
")",
"pageContext",
".",
"getRequest",
"(",
")",
")",
";",
"boolean",
"writeLegacy",
"=",
"false",
";",
"boolean",
"writeName",
"=",
"false",
";",
"String",
"val",
";",
"// if we are writing out legacy JavaScript support output the idMap",
"if",
"(",
"TagConfig",
".",
"isLegacyJavaScript",
"(",
")",
")",
"{",
"val",
"=",
"processIdMap",
"(",
"_idMap",
",",
"\"idMappingEntry\"",
",",
"_idScope",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"writeIdMap",
"(",
"this",
",",
"\"idMappingTable\"",
",",
"val",
")",
";",
"writeLegacy",
"=",
"true",
";",
"}",
"}",
"// if we are writing out default JavaScript support we create the name map",
"if",
"(",
"TagConfig",
".",
"isDefaultJavaScript",
"(",
")",
")",
"{",
"String",
"idScope",
"=",
"getJavaScriptId",
"(",
")",
";",
"if",
"(",
"idScope",
".",
"equals",
"(",
"\"\"",
")",
")",
"idScope",
"=",
"null",
";",
"val",
"=",
"processIdMap",
"(",
"_idToNameMap",
",",
"\"tagIdNameMappingEntry\"",
",",
"idScope",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"writeIdMap",
"(",
"this",
",",
"\"tagIdNameMappingTable\"",
",",
"val",
")",
";",
"writeName",
"=",
"true",
";",
"}",
"}",
"if",
"(",
"writeLegacy",
"||",
"_writeId",
"||",
"writeName",
")",
"jsu",
".",
"writeNetuiNameFunctions",
"(",
"this",
",",
"writeLegacy",
",",
"_writeId",
",",
"writeName",
")",
";",
"ScriptTag",
".",
"State",
"state",
"=",
"null",
";",
"ScriptTag",
"br",
"=",
"null",
";",
"if",
"(",
"_funcBlocks",
"!=",
"null",
"&&",
"_funcBlocks",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"script",
")",
"{",
"state",
"=",
"new",
"ScriptTag",
".",
"State",
"(",
")",
";",
"state",
".",
"suppressComments",
"=",
"false",
";",
"br",
"=",
"(",
"ScriptTag",
")",
"TagRenderingBase",
".",
"Factory",
".",
"getRendering",
"(",
"TagRenderingBase",
".",
"SCRIPT_TAG",
",",
"pageContext",
".",
"getRequest",
"(",
")",
")",
";",
"br",
".",
"doStartTag",
"(",
"sb",
",",
"state",
")",
";",
"script",
"=",
"true",
";",
"}",
"String",
"s",
"=",
"ScriptRequestState",
".",
"getString",
"(",
"\"functionComment\"",
",",
"null",
")",
";",
"sb",
".",
"append",
"(",
"s",
")",
";",
"int",
"cnt",
"=",
"_funcBlocks",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cnt",
";",
"i",
"++",
")",
"{",
"sb",
".",
"append",
"(",
"(",
"String",
")",
"_funcBlocks",
".",
"get",
"(",
"i",
")",
")",
";",
"if",
"(",
"i",
"!=",
"cnt",
"-",
"1",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"}",
"}",
"}",
"if",
"(",
"script",
")",
"{",
"assert",
"(",
"br",
"!=",
"null",
")",
";",
"br",
".",
"doEndTag",
"(",
"sb",
",",
"false",
")",
";",
"}",
"}"
] |
This will write the script block.
|
[
"This",
"will",
"write",
"the",
"script",
"block",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L371-L429
|
146,491
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.getImplInitializer
|
protected synchronized ImplInitializer getImplInitializer()
{
if (_implInitializer == null)
{
try
{
Class initClass = _implClass.getClassLoader().loadClass(
_implClass.getName() + "Initializer");
_implInitializer = (ImplInitializer)initClass.newInstance();
}
catch (Exception e)
{
throw new ControlException("Control initialization failure", e);
}
}
return _implInitializer;
}
|
java
|
protected synchronized ImplInitializer getImplInitializer()
{
if (_implInitializer == null)
{
try
{
Class initClass = _implClass.getClassLoader().loadClass(
_implClass.getName() + "Initializer");
_implInitializer = (ImplInitializer)initClass.newInstance();
}
catch (Exception e)
{
throw new ControlException("Control initialization failure", e);
}
}
return _implInitializer;
}
|
[
"protected",
"synchronized",
"ImplInitializer",
"getImplInitializer",
"(",
")",
"{",
"if",
"(",
"_implInitializer",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"initClass",
"=",
"_implClass",
".",
"getClassLoader",
"(",
")",
".",
"loadClass",
"(",
"_implClass",
".",
"getName",
"(",
")",
"+",
"\"Initializer\"",
")",
";",
"_implInitializer",
"=",
"(",
"ImplInitializer",
")",
"initClass",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Control initialization failure\"",
",",
"e",
")",
";",
"}",
"}",
"return",
"_implInitializer",
";",
"}"
] |
Obtains an instance of the appropriate ImplInitializer class
|
[
"Obtains",
"an",
"instance",
"of",
"the",
"appropriate",
"ImplInitializer",
"class"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L235-L251
|
146,492
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.ensureControl
|
public synchronized Object ensureControl()
{
if (_control == null)
{
//
// See if the property map specifies an implementation class for the control;
// if not, use default binding.
//
String implBinding = null;
BaseProperties bp = _properties.getPropertySet( BaseProperties.class );
if ( bp != null )
implBinding = bp.controlImplementation();
else
implBinding = ControlUtils.getDefaultControlBinding(_controlIntf);
try
{
_implClass = _controlIntf.getClassLoader().loadClass(implBinding);
//
// Validate that the specified implementation class has an @ControlImplementation
// annotation, else downstream requirements (such as having a valid control init
// class) will not be met.
//
if (_implClass.getAnnotation(ControlImplementation.class) == null)
{
throw new ControlException("@" + ControlImplementation.class.getName() + " annotation is missing from control implementation class: " + _implClass.getName());
}
}
catch (ClassNotFoundException cnfe)
{
throw new ControlException("Unable to load control implementation: " + implBinding, cnfe);
}
//
// Cache the threading policy associated with the impl
//
Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
if ( thr != null )
_threadingPolicy = thr.value();
else
_threadingPolicy = ThreadingPolicy.SINGLE_THREADED; // default to single-threaded
ensureThreadingBehaviour();
try
{
//
// Create and initialize the new instance
//
_control = _implClass.newInstance();
try
{
/*
Run the ImplInitializer. This class is code generated based on metadata from a control
implementation. If a Control implementation declares event handlers for the
ControlBeanContext or for the ResourceContext, executing this code generated class
will add the appropriate LifeCycle and / or Resource event listeners.
*/
getImplInitializer().initialize(this, _control);
_hasServices = true;
}
catch (Exception e)
{
throw new ControlException("Control initialization failure", e);
}
//
// Once the control is initialized, then allow the associated context
// to do any initialization.
//
ControlBeanContext cbcs = getBeanContextProxy();
/*
Implementation note: this call will run the LifeCycleListener(s) that have
been wired-up to the ControlBeanContext object associated with this ControlBean.
*/
cbcs.initializeControl();
}
catch (RuntimeException re) {
// never mask RuntimeExceptions
throw re;
}
catch (Exception e)
{
throw new ControlException("Unable to create control instance", e);
}
}
//
// If the implementation instance does not currently have contextual services, they
// are lazily restored here.
//
if (!_hasServices)
{
getImplInitializer().initServices(this, _control);
_hasServices = true;
}
return _control;
}
|
java
|
public synchronized Object ensureControl()
{
if (_control == null)
{
//
// See if the property map specifies an implementation class for the control;
// if not, use default binding.
//
String implBinding = null;
BaseProperties bp = _properties.getPropertySet( BaseProperties.class );
if ( bp != null )
implBinding = bp.controlImplementation();
else
implBinding = ControlUtils.getDefaultControlBinding(_controlIntf);
try
{
_implClass = _controlIntf.getClassLoader().loadClass(implBinding);
//
// Validate that the specified implementation class has an @ControlImplementation
// annotation, else downstream requirements (such as having a valid control init
// class) will not be met.
//
if (_implClass.getAnnotation(ControlImplementation.class) == null)
{
throw new ControlException("@" + ControlImplementation.class.getName() + " annotation is missing from control implementation class: " + _implClass.getName());
}
}
catch (ClassNotFoundException cnfe)
{
throw new ControlException("Unable to load control implementation: " + implBinding, cnfe);
}
//
// Cache the threading policy associated with the impl
//
Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
if ( thr != null )
_threadingPolicy = thr.value();
else
_threadingPolicy = ThreadingPolicy.SINGLE_THREADED; // default to single-threaded
ensureThreadingBehaviour();
try
{
//
// Create and initialize the new instance
//
_control = _implClass.newInstance();
try
{
/*
Run the ImplInitializer. This class is code generated based on metadata from a control
implementation. If a Control implementation declares event handlers for the
ControlBeanContext or for the ResourceContext, executing this code generated class
will add the appropriate LifeCycle and / or Resource event listeners.
*/
getImplInitializer().initialize(this, _control);
_hasServices = true;
}
catch (Exception e)
{
throw new ControlException("Control initialization failure", e);
}
//
// Once the control is initialized, then allow the associated context
// to do any initialization.
//
ControlBeanContext cbcs = getBeanContextProxy();
/*
Implementation note: this call will run the LifeCycleListener(s) that have
been wired-up to the ControlBeanContext object associated with this ControlBean.
*/
cbcs.initializeControl();
}
catch (RuntimeException re) {
// never mask RuntimeExceptions
throw re;
}
catch (Exception e)
{
throw new ControlException("Unable to create control instance", e);
}
}
//
// If the implementation instance does not currently have contextual services, they
// are lazily restored here.
//
if (!_hasServices)
{
getImplInitializer().initServices(this, _control);
_hasServices = true;
}
return _control;
}
|
[
"public",
"synchronized",
"Object",
"ensureControl",
"(",
")",
"{",
"if",
"(",
"_control",
"==",
"null",
")",
"{",
"//",
"// See if the property map specifies an implementation class for the control; ",
"// if not, use default binding.",
"//",
"String",
"implBinding",
"=",
"null",
";",
"BaseProperties",
"bp",
"=",
"_properties",
".",
"getPropertySet",
"(",
"BaseProperties",
".",
"class",
")",
";",
"if",
"(",
"bp",
"!=",
"null",
")",
"implBinding",
"=",
"bp",
".",
"controlImplementation",
"(",
")",
";",
"else",
"implBinding",
"=",
"ControlUtils",
".",
"getDefaultControlBinding",
"(",
"_controlIntf",
")",
";",
"try",
"{",
"_implClass",
"=",
"_controlIntf",
".",
"getClassLoader",
"(",
")",
".",
"loadClass",
"(",
"implBinding",
")",
";",
"//",
"// Validate that the specified implementation class has an @ControlImplementation",
"// annotation, else downstream requirements (such as having a valid control init",
"// class) will not be met.",
"//",
"if",
"(",
"_implClass",
".",
"getAnnotation",
"(",
"ControlImplementation",
".",
"class",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"@\"",
"+",
"ControlImplementation",
".",
"class",
".",
"getName",
"(",
")",
"+",
"\" annotation is missing from control implementation class: \"",
"+",
"_implClass",
".",
"getName",
"(",
")",
")",
";",
"}",
"}",
"catch",
"(",
"ClassNotFoundException",
"cnfe",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Unable to load control implementation: \"",
"+",
"implBinding",
",",
"cnfe",
")",
";",
"}",
"//",
"// Cache the threading policy associated with the impl",
"//",
"Threading",
"thr",
"=",
"(",
"Threading",
")",
"_implClass",
".",
"getAnnotation",
"(",
"Threading",
".",
"class",
")",
";",
"if",
"(",
"thr",
"!=",
"null",
")",
"_threadingPolicy",
"=",
"thr",
".",
"value",
"(",
")",
";",
"else",
"_threadingPolicy",
"=",
"ThreadingPolicy",
".",
"SINGLE_THREADED",
";",
"// default to single-threaded",
"ensureThreadingBehaviour",
"(",
")",
";",
"try",
"{",
"//",
"// Create and initialize the new instance",
"//",
"_control",
"=",
"_implClass",
".",
"newInstance",
"(",
")",
";",
"try",
"{",
"/*\n Run the ImplInitializer. This class is code generated based on metadata from a control\n implementation. If a Control implementation declares event handlers for the\n ControlBeanContext or for the ResourceContext, executing this code generated class\n will add the appropriate LifeCycle and / or Resource event listeners.\n */",
"getImplInitializer",
"(",
")",
".",
"initialize",
"(",
"this",
",",
"_control",
")",
";",
"_hasServices",
"=",
"true",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Control initialization failure\"",
",",
"e",
")",
";",
"}",
"//",
"// Once the control is initialized, then allow the associated context",
"// to do any initialization.",
"//",
"ControlBeanContext",
"cbcs",
"=",
"getBeanContextProxy",
"(",
")",
";",
"/*\n Implementation note: this call will run the LifeCycleListener(s) that have\n been wired-up to the ControlBeanContext object associated with this ControlBean.\n */",
"cbcs",
".",
"initializeControl",
"(",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"re",
")",
"{",
"// never mask RuntimeExceptions",
"throw",
"re",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Unable to create control instance\"",
",",
"e",
")",
";",
"}",
"}",
"//",
"// If the implementation instance does not currently have contextual services, they",
"// are lazily restored here.",
"//",
"if",
"(",
"!",
"_hasServices",
")",
"{",
"getImplInitializer",
"(",
")",
".",
"initServices",
"(",
"this",
",",
"_control",
")",
";",
"_hasServices",
"=",
"true",
";",
"}",
"return",
"_control",
";",
"}"
] |
Returns the target control instance associated with this ControlBean, performing lazy
instantiation and initialization of the instance.
REVIEW: could probably improve the granularity of locking here, but start w/ just
synchronizing the entire fn.
|
[
"Returns",
"the",
"target",
"control",
"instance",
"associated",
"with",
"this",
"ControlBean",
"performing",
"lazy",
"instantiation",
"and",
"initialization",
"of",
"the",
"instance",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L260-L362
|
146,493
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.preInvoke
|
protected void preInvoke(Method m, Object [] args, String [] interceptorNames)
throws InterceptorPivotException
{
//
// If the implementation expects single threaded behavior and our container does
// not guarantee it, then enforce it locally here
//
if (_invokeLock != null)
{
try { _invokeLock.acquire(); } catch (InterruptedException ie) { }
}
//
// Process interceptors
//
if ( interceptorNames != null )
{
for ( String n : interceptorNames )
{
Interceptor i = ensureInterceptor( n );
try
{
i.preInvoke( this, m, args );
}
catch (InterceptorPivotException ipe)
{
ipe.setInterceptorName(n);
throw ipe;
}
}
}
Vector<InvokeListener> invokeListeners = getInvokeListeners();
if (invokeListeners.size() > 0)
{
for (InvokeListener listener : invokeListeners)
listener.preInvoke(m, args);
}
}
|
java
|
protected void preInvoke(Method m, Object [] args, String [] interceptorNames)
throws InterceptorPivotException
{
//
// If the implementation expects single threaded behavior and our container does
// not guarantee it, then enforce it locally here
//
if (_invokeLock != null)
{
try { _invokeLock.acquire(); } catch (InterruptedException ie) { }
}
//
// Process interceptors
//
if ( interceptorNames != null )
{
for ( String n : interceptorNames )
{
Interceptor i = ensureInterceptor( n );
try
{
i.preInvoke( this, m, args );
}
catch (InterceptorPivotException ipe)
{
ipe.setInterceptorName(n);
throw ipe;
}
}
}
Vector<InvokeListener> invokeListeners = getInvokeListeners();
if (invokeListeners.size() > 0)
{
for (InvokeListener listener : invokeListeners)
listener.preInvoke(m, args);
}
}
|
[
"protected",
"void",
"preInvoke",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
",",
"String",
"[",
"]",
"interceptorNames",
")",
"throws",
"InterceptorPivotException",
"{",
"//",
"// If the implementation expects single threaded behavior and our container does",
"// not guarantee it, then enforce it locally here",
"//",
"if",
"(",
"_invokeLock",
"!=",
"null",
")",
"{",
"try",
"{",
"_invokeLock",
".",
"acquire",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"ie",
")",
"{",
"}",
"}",
"//",
"// Process interceptors",
"//",
"if",
"(",
"interceptorNames",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"n",
":",
"interceptorNames",
")",
"{",
"Interceptor",
"i",
"=",
"ensureInterceptor",
"(",
"n",
")",
";",
"try",
"{",
"i",
".",
"preInvoke",
"(",
"this",
",",
"m",
",",
"args",
")",
";",
"}",
"catch",
"(",
"InterceptorPivotException",
"ipe",
")",
"{",
"ipe",
".",
"setInterceptorName",
"(",
"n",
")",
";",
"throw",
"ipe",
";",
"}",
"}",
"}",
"Vector",
"<",
"InvokeListener",
">",
"invokeListeners",
"=",
"getInvokeListeners",
"(",
")",
";",
"if",
"(",
"invokeListeners",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"for",
"(",
"InvokeListener",
"listener",
":",
"invokeListeners",
")",
"listener",
".",
"preInvoke",
"(",
"m",
",",
"args",
")",
";",
"}",
"}"
] |
The preinvoke method is called before all operations on the control. In addition to
providing a basic hook for logging, context initialization, resource management,
and other common services, it also provides a hook for interceptors.
|
[
"The",
"preinvoke",
"method",
"is",
"called",
"before",
"all",
"operations",
"on",
"the",
"control",
".",
"In",
"addition",
"to",
"providing",
"a",
"basic",
"hook",
"for",
"logging",
"context",
"initialization",
"resource",
"management",
"and",
"other",
"common",
"services",
"it",
"also",
"provides",
"a",
"hook",
"for",
"interceptors",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L376-L414
|
146,494
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.preInvoke
|
protected void preInvoke(Method m, Object [] args)
{
try
{
preInvoke(m, args, null);
}
catch (InterceptorPivotException ipe)
{
//this will never happen because no interceptor is passed.
}
}
|
java
|
protected void preInvoke(Method m, Object [] args)
{
try
{
preInvoke(m, args, null);
}
catch (InterceptorPivotException ipe)
{
//this will never happen because no interceptor is passed.
}
}
|
[
"protected",
"void",
"preInvoke",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"preInvoke",
"(",
"m",
",",
"args",
",",
"null",
")",
";",
"}",
"catch",
"(",
"InterceptorPivotException",
"ipe",
")",
"{",
"//this will never happen because no interceptor is passed.",
"}",
"}"
] |
The preinvoke method is called before all operations on the control. It is the basic
hook for logging, context initialization, resource management, and other common
services
|
[
"The",
"preinvoke",
"method",
"is",
"called",
"before",
"all",
"operations",
"on",
"the",
"control",
".",
"It",
"is",
"the",
"basic",
"hook",
"for",
"logging",
"context",
"initialization",
"resource",
"management",
"and",
"other",
"common",
"services"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L421-L431
|
146,495
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.postInvoke
|
protected void postInvoke(Method m, Object [] args, Object retval, Throwable t)
{
postInvoke(m, args, retval, t, null, null);
}
|
java
|
protected void postInvoke(Method m, Object [] args, Object retval, Throwable t)
{
postInvoke(m, args, retval, t, null, null);
}
|
[
"protected",
"void",
"postInvoke",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
",",
"Object",
"retval",
",",
"Throwable",
"t",
")",
"{",
"postInvoke",
"(",
"m",
",",
"args",
",",
"retval",
",",
"t",
",",
"null",
",",
"null",
")",
";",
"}"
] |
The postInvoke method is called after all operations on the control. It is the basic
hook for logging, context initialization, resource management, and other common
services.
|
[
"The",
"postInvoke",
"method",
"is",
"called",
"after",
"all",
"operations",
"on",
"the",
"control",
".",
"It",
"is",
"the",
"basic",
"hook",
"for",
"logging",
"context",
"initialization",
"resource",
"management",
"and",
"other",
"common",
"services",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L491-L494
|
146,496
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.setEventNotifier
|
protected <T> void setEventNotifier(Class<T> eventSet, T notifier)
{
_notifiers.put(eventSet,notifier);
//
// Register this notifier for all EventSet interfaces up the interface inheritance
// hiearachy as well
//
List<Class> superEventSets = new ArrayList<Class>();
getSuperEventSets(eventSet, superEventSets);
Iterator<Class> i = superEventSets.iterator();
while (i.hasNext())
{
Class superEventSet = i.next();
_notifiers.put(superEventSet,notifier);
}
}
|
java
|
protected <T> void setEventNotifier(Class<T> eventSet, T notifier)
{
_notifiers.put(eventSet,notifier);
//
// Register this notifier for all EventSet interfaces up the interface inheritance
// hiearachy as well
//
List<Class> superEventSets = new ArrayList<Class>();
getSuperEventSets(eventSet, superEventSets);
Iterator<Class> i = superEventSets.iterator();
while (i.hasNext())
{
Class superEventSet = i.next();
_notifiers.put(superEventSet,notifier);
}
}
|
[
"protected",
"<",
"T",
">",
"void",
"setEventNotifier",
"(",
"Class",
"<",
"T",
">",
"eventSet",
",",
"T",
"notifier",
")",
"{",
"_notifiers",
".",
"put",
"(",
"eventSet",
",",
"notifier",
")",
";",
"//",
"// Register this notifier for all EventSet interfaces up the interface inheritance",
"// hiearachy as well",
"//",
"List",
"<",
"Class",
">",
"superEventSets",
"=",
"new",
"ArrayList",
"<",
"Class",
">",
"(",
")",
";",
"getSuperEventSets",
"(",
"eventSet",
",",
"superEventSets",
")",
";",
"Iterator",
"<",
"Class",
">",
"i",
"=",
"superEventSets",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"Class",
"superEventSet",
"=",
"i",
".",
"next",
"(",
")",
";",
"_notifiers",
".",
"put",
"(",
"superEventSet",
",",
"notifier",
")",
";",
"}",
"}"
] |
Sets the EventNotifier for this ControlBean
|
[
"Sets",
"the",
"EventNotifier",
"for",
"this",
"ControlBean"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L500-L516
|
146,497
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.getSuperEventSets
|
private void getSuperEventSets(Class eventSet, List<Class> superEventSets)
{
Class[] superInterfaces = eventSet.getInterfaces();
if (superInterfaces != null)
{
for (int i=0; i < superInterfaces.length; i++)
{
Class superInterface = superInterfaces[i];
if (superInterface.isAnnotationPresent(EventSet.class))
{
superEventSets.add(superInterface);
// Continue traversing up the EventSet inheritance hierarchy
getSuperEventSets(superInterface, superEventSets);
}
}
}
}
|
java
|
private void getSuperEventSets(Class eventSet, List<Class> superEventSets)
{
Class[] superInterfaces = eventSet.getInterfaces();
if (superInterfaces != null)
{
for (int i=0; i < superInterfaces.length; i++)
{
Class superInterface = superInterfaces[i];
if (superInterface.isAnnotationPresent(EventSet.class))
{
superEventSets.add(superInterface);
// Continue traversing up the EventSet inheritance hierarchy
getSuperEventSets(superInterface, superEventSets);
}
}
}
}
|
[
"private",
"void",
"getSuperEventSets",
"(",
"Class",
"eventSet",
",",
"List",
"<",
"Class",
">",
"superEventSets",
")",
"{",
"Class",
"[",
"]",
"superInterfaces",
"=",
"eventSet",
".",
"getInterfaces",
"(",
")",
";",
"if",
"(",
"superInterfaces",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"superInterfaces",
".",
"length",
";",
"i",
"++",
")",
"{",
"Class",
"superInterface",
"=",
"superInterfaces",
"[",
"i",
"]",
";",
"if",
"(",
"superInterface",
".",
"isAnnotationPresent",
"(",
"EventSet",
".",
"class",
")",
")",
"{",
"superEventSets",
".",
"add",
"(",
"superInterface",
")",
";",
"// Continue traversing up the EventSet inheritance hierarchy",
"getSuperEventSets",
"(",
"superInterface",
",",
"superEventSets",
")",
";",
"}",
"}",
"}",
"}"
] |
Finds all of the EventSets extended by the input EventSet, and adds them to
the provided list.
@param eventSet
@param superEventSets
|
[
"Finds",
"all",
"of",
"the",
"EventSets",
"extended",
"by",
"the",
"input",
"EventSet",
"and",
"adds",
"them",
"to",
"the",
"provided",
"list",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L524-L541
|
146,498
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.getControlService
|
protected Object getControlService(Class serviceClass, Object selector)
throws TooManyListenersException
{
//
// Get the associated context object, then use it to locate the (parent) bean context.
// Services are always provided by the parent context.
//
ControlBeanContext cbc = getControlBeanContext();
BeanContext bc = cbc.getBeanContext();
if (bc == null || !(bc instanceof BeanContextServices))
throw new ControlException("Can't locate service context: " + bc);
//
// Call getService on the parent context, using this bean as the requestor and the
// associated peer context instance as the child and event listener parameters.
//
return ((BeanContextServices)bc).getService(cbc, this, serviceClass, selector, cbc);
}
|
java
|
protected Object getControlService(Class serviceClass, Object selector)
throws TooManyListenersException
{
//
// Get the associated context object, then use it to locate the (parent) bean context.
// Services are always provided by the parent context.
//
ControlBeanContext cbc = getControlBeanContext();
BeanContext bc = cbc.getBeanContext();
if (bc == null || !(bc instanceof BeanContextServices))
throw new ControlException("Can't locate service context: " + bc);
//
// Call getService on the parent context, using this bean as the requestor and the
// associated peer context instance as the child and event listener parameters.
//
return ((BeanContextServices)bc).getService(cbc, this, serviceClass, selector, cbc);
}
|
[
"protected",
"Object",
"getControlService",
"(",
"Class",
"serviceClass",
",",
"Object",
"selector",
")",
"throws",
"TooManyListenersException",
"{",
"//",
"// Get the associated context object, then use it to locate the (parent) bean context.",
"// Services are always provided by the parent context.",
"//",
"ControlBeanContext",
"cbc",
"=",
"getControlBeanContext",
"(",
")",
";",
"BeanContext",
"bc",
"=",
"cbc",
".",
"getBeanContext",
"(",
")",
";",
"if",
"(",
"bc",
"==",
"null",
"||",
"!",
"(",
"bc",
"instanceof",
"BeanContextServices",
")",
")",
"throw",
"new",
"ControlException",
"(",
"\"Can't locate service context: \"",
"+",
"bc",
")",
";",
"//",
"// Call getService on the parent context, using this bean as the requestor and the",
"// associated peer context instance as the child and event listener parameters.",
"//",
"return",
"(",
"(",
"BeanContextServices",
")",
"bc",
")",
".",
"getService",
"(",
"cbc",
",",
"this",
",",
"serviceClass",
",",
"selector",
",",
"cbc",
")",
";",
"}"
] |
Locates and obtains a context service from the BeanContextServices instance
supporting this bean.
The base design for the BeanContextServicesSupport is that it will delegate up to peers
in a nesting context, so a nested control bean will look 'up' to find a service provider.
|
[
"Locates",
"and",
"obtains",
"a",
"context",
"service",
"from",
"the",
"BeanContextServices",
"instance",
"supporting",
"this",
"bean",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L615-L633
|
146,499
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
|
ControlBean.setControlProperty
|
protected void setControlProperty(PropertyKey key, Object o)
{
AnnotationConstraintValidator.validate(key, o);
_properties.setProperty(key, o);
}
|
java
|
protected void setControlProperty(PropertyKey key, Object o)
{
AnnotationConstraintValidator.validate(key, o);
_properties.setProperty(key, o);
}
|
[
"protected",
"void",
"setControlProperty",
"(",
"PropertyKey",
"key",
",",
"Object",
"o",
")",
"{",
"AnnotationConstraintValidator",
".",
"validate",
"(",
"key",
",",
"o",
")",
";",
"_properties",
".",
"setProperty",
"(",
"key",
",",
"o",
")",
";",
"}"
] |
Sets a property on the ControlBean instance. All generated property setter methods
will delegate down to this method.
|
[
"Sets",
"a",
"property",
"on",
"the",
"ControlBean",
"instance",
".",
"All",
"generated",
"property",
"setter",
"methods",
"will",
"delegate",
"down",
"to",
"this",
"method",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L639-L643
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.