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,900
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/TextArea.java
|
TextArea.setAttribute
|
public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(DISABLED)) {
setDisabled(Boolean.parseBoolean(value));
return;
}
else if (name.equals(READONLY)) {
_state.readonly = new Boolean(value).booleanValue();
return;
}
else if (name.equals(COLS)) {
_state.cols = Integer.parseInt(value);
return;
}
else if (name.equals(ROWS)) {
_state.rows = Integer.parseInt(value);
return;
}
}
super.setAttribute(name, value, facet);
}
|
java
|
public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(DISABLED)) {
setDisabled(Boolean.parseBoolean(value));
return;
}
else if (name.equals(READONLY)) {
_state.readonly = new Boolean(value).booleanValue();
return;
}
else if (name.equals(COLS)) {
_state.cols = Integer.parseInt(value);
return;
}
else if (name.equals(ROWS)) {
_state.rows = Integer.parseInt(value);
return;
}
}
super.setAttribute(name, value, facet);
}
|
[
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"DISABLED",
")",
")",
"{",
"setDisabled",
"(",
"Boolean",
".",
"parseBoolean",
"(",
"value",
")",
")",
";",
"return",
";",
"}",
"else",
"if",
"(",
"name",
".",
"equals",
"(",
"READONLY",
")",
")",
"{",
"_state",
".",
"readonly",
"=",
"new",
"Boolean",
"(",
"value",
")",
".",
"booleanValue",
"(",
")",
";",
"return",
";",
"}",
"else",
"if",
"(",
"name",
".",
"equals",
"(",
"COLS",
")",
")",
"{",
"_state",
".",
"cols",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
")",
";",
"return",
";",
"}",
"else",
"if",
"(",
"name",
".",
"equals",
"(",
"ROWS",
")",
")",
"{",
"_state",
".",
"rows",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
")",
";",
"return",
";",
"}",
"}",
"super",
".",
"setAttribute",
"(",
"name",
",",
"value",
",",
"facet",
")",
";",
"}"
] |
Base support for the attribute tag.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param facet The name of a facet to which the attribute will be applied. This is optional.
@throws JspException A JspException may be thrown if there is an error setting the attribute.
|
[
"Base",
"support",
"for",
"the",
"attribute",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/TextArea.java#L79-L102
|
146,901
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/TextArea.java
|
TextArea.doEndTag
|
public int doEndTag() throws JspException
{
ServletRequest req = pageContext.getRequest();
Object textObject = null;
// Get the value of the data source. The object will not be null.
Object val = evaluateDataSource();
textObject = (val != null) ? val : "";
assert(textObject != null);
// setup the rest of the state.
ByRef ref = new ByRef();
nameHtmlControl(_state, ref);
_state.disabled = isDisabled();
// if there were expression errors report them
if (hasErrors())
return reportAndExit(EVAL_PAGE);
// if there were format errors then report them
if (_formatErrors) {
if (bodyContent != null) {
String value = bodyContent.getString().trim();
bodyContent.clearBody();
write(value);
}
}
// create the input tag.
WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.TEXT_AREA_TAG, req);
br.doStartTag(writer, _state);
// create the text value which will be found inside the textarea.
if ((textObject == null) || (textObject.toString().length() == 0)) {
textObject = _defaultValue;
}
String text = formatText(textObject);
if (text != null) {
// make sure leading blank line in the text value is not interpreted
// just as formatting... force a new line for formatting
if (text.startsWith("\n") || text.startsWith("\r")) {
writer.append("\n");
}
HtmlUtils.filter(text, writer);
}
//results.append(text);
br.doEndTag(writer);
// if there are errors report them...
if (hasErrors())
return reportAndExit(EVAL_PAGE);
// report any script
if (!ref.isNull())
write((String) ref.getRef());
localRelease();
return EVAL_PAGE;
}
|
java
|
public int doEndTag() throws JspException
{
ServletRequest req = pageContext.getRequest();
Object textObject = null;
// Get the value of the data source. The object will not be null.
Object val = evaluateDataSource();
textObject = (val != null) ? val : "";
assert(textObject != null);
// setup the rest of the state.
ByRef ref = new ByRef();
nameHtmlControl(_state, ref);
_state.disabled = isDisabled();
// if there were expression errors report them
if (hasErrors())
return reportAndExit(EVAL_PAGE);
// if there were format errors then report them
if (_formatErrors) {
if (bodyContent != null) {
String value = bodyContent.getString().trim();
bodyContent.clearBody();
write(value);
}
}
// create the input tag.
WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.TEXT_AREA_TAG, req);
br.doStartTag(writer, _state);
// create the text value which will be found inside the textarea.
if ((textObject == null) || (textObject.toString().length() == 0)) {
textObject = _defaultValue;
}
String text = formatText(textObject);
if (text != null) {
// make sure leading blank line in the text value is not interpreted
// just as formatting... force a new line for formatting
if (text.startsWith("\n") || text.startsWith("\r")) {
writer.append("\n");
}
HtmlUtils.filter(text, writer);
}
//results.append(text);
br.doEndTag(writer);
// if there are errors report them...
if (hasErrors())
return reportAndExit(EVAL_PAGE);
// report any script
if (!ref.isNull())
write((String) ref.getRef());
localRelease();
return EVAL_PAGE;
}
|
[
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"ServletRequest",
"req",
"=",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"Object",
"textObject",
"=",
"null",
";",
"// Get the value of the data source. The object will not be null.",
"Object",
"val",
"=",
"evaluateDataSource",
"(",
")",
";",
"textObject",
"=",
"(",
"val",
"!=",
"null",
")",
"?",
"val",
":",
"\"\"",
";",
"assert",
"(",
"textObject",
"!=",
"null",
")",
";",
"// setup the rest of the state.",
"ByRef",
"ref",
"=",
"new",
"ByRef",
"(",
")",
";",
"nameHtmlControl",
"(",
"_state",
",",
"ref",
")",
";",
"_state",
".",
"disabled",
"=",
"isDisabled",
"(",
")",
";",
"// if there were expression errors report them",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"reportAndExit",
"(",
"EVAL_PAGE",
")",
";",
"// if there were format errors then report them",
"if",
"(",
"_formatErrors",
")",
"{",
"if",
"(",
"bodyContent",
"!=",
"null",
")",
"{",
"String",
"value",
"=",
"bodyContent",
".",
"getString",
"(",
")",
".",
"trim",
"(",
")",
";",
"bodyContent",
".",
"clearBody",
"(",
")",
";",
"write",
"(",
"value",
")",
";",
"}",
"}",
"// create the input tag.",
"WriteRenderAppender",
"writer",
"=",
"new",
"WriteRenderAppender",
"(",
"pageContext",
")",
";",
"TagRenderingBase",
"br",
"=",
"TagRenderingBase",
".",
"Factory",
".",
"getRendering",
"(",
"TagRenderingBase",
".",
"TEXT_AREA_TAG",
",",
"req",
")",
";",
"br",
".",
"doStartTag",
"(",
"writer",
",",
"_state",
")",
";",
"// create the text value which will be found inside the textarea.",
"if",
"(",
"(",
"textObject",
"==",
"null",
")",
"||",
"(",
"textObject",
".",
"toString",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"{",
"textObject",
"=",
"_defaultValue",
";",
"}",
"String",
"text",
"=",
"formatText",
"(",
"textObject",
")",
";",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"// make sure leading blank line in the text value is not interpreted",
"// just as formatting... force a new line for formatting",
"if",
"(",
"text",
".",
"startsWith",
"(",
"\"\\n\"",
")",
"||",
"text",
".",
"startsWith",
"(",
"\"\\r\"",
")",
")",
"{",
"writer",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"}",
"HtmlUtils",
".",
"filter",
"(",
"text",
",",
"writer",
")",
";",
"}",
"//results.append(text);",
"br",
".",
"doEndTag",
"(",
"writer",
")",
";",
"// if there are errors report them...",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"reportAndExit",
"(",
"EVAL_PAGE",
")",
";",
"// report any script",
"if",
"(",
"!",
"ref",
".",
"isNull",
"(",
")",
")",
"write",
"(",
"(",
"String",
")",
"ref",
".",
"getRef",
"(",
")",
")",
";",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}"
] |
Render the TextArea.
@throws JspException if a JSP exception has occurred
|
[
"Render",
"the",
"TextArea",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/TextArea.java#L159-L221
|
146,902
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java
|
URLTemplatesFactory.getURLTemplatesFactory
|
public static URLTemplatesFactory getURLTemplatesFactory( ServletContext servletContext )
{
assert servletContext != null : "The ServletContext cannot be null.";
if ( servletContext == null )
{
throw new IllegalArgumentException( "The ServletContext cannot be null." );
}
return ( URLTemplatesFactory ) servletContext.getAttribute( URL_TEMPLATE_FACTORY_ATTR );
}
|
java
|
public static URLTemplatesFactory getURLTemplatesFactory( ServletContext servletContext )
{
assert servletContext != null : "The ServletContext cannot be null.";
if ( servletContext == null )
{
throw new IllegalArgumentException( "The ServletContext cannot be null." );
}
return ( URLTemplatesFactory ) servletContext.getAttribute( URL_TEMPLATE_FACTORY_ATTR );
}
|
[
"public",
"static",
"URLTemplatesFactory",
"getURLTemplatesFactory",
"(",
"ServletContext",
"servletContext",
")",
"{",
"assert",
"servletContext",
"!=",
"null",
":",
"\"The ServletContext cannot be null.\"",
";",
"if",
"(",
"servletContext",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The ServletContext cannot be null.\"",
")",
";",
"}",
"return",
"(",
"URLTemplatesFactory",
")",
"servletContext",
".",
"getAttribute",
"(",
"URL_TEMPLATE_FACTORY_ATTR",
")",
";",
"}"
] |
Gets the URLTemplatesFactory instance from a ServletContext attribute.
@param servletContext the current ServletContext.
@return the URLTemplatesFactory instance from the ServletContext.
|
[
"Gets",
"the",
"URLTemplatesFactory",
"instance",
"from",
"a",
"ServletContext",
"attribute",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java#L64-L74
|
146,903
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java
|
URLTemplatesFactory.initServletContext
|
public static void initServletContext( ServletContext servletContext, URLTemplatesFactory templatesFactory )
{
assert servletContext != null : "The ServletContext cannot be null.";
if ( servletContext == null )
{
throw new IllegalArgumentException( "The ServletContext cannot be null." );
}
servletContext.setAttribute( URL_TEMPLATE_FACTORY_ATTR, templatesFactory );
}
|
java
|
public static void initServletContext( ServletContext servletContext, URLTemplatesFactory templatesFactory )
{
assert servletContext != null : "The ServletContext cannot be null.";
if ( servletContext == null )
{
throw new IllegalArgumentException( "The ServletContext cannot be null." );
}
servletContext.setAttribute( URL_TEMPLATE_FACTORY_ATTR, templatesFactory );
}
|
[
"public",
"static",
"void",
"initServletContext",
"(",
"ServletContext",
"servletContext",
",",
"URLTemplatesFactory",
"templatesFactory",
")",
"{",
"assert",
"servletContext",
"!=",
"null",
":",
"\"The ServletContext cannot be null.\"",
";",
"if",
"(",
"servletContext",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The ServletContext cannot be null.\"",
")",
";",
"}",
"servletContext",
".",
"setAttribute",
"(",
"URL_TEMPLATE_FACTORY_ATTR",
",",
"templatesFactory",
")",
";",
"}"
] |
Adds a given URLTemplatesFactory instance as an attribute on the ServletContext.
@param servletContext the current ServletContext.
@param templatesFactory the URLTemplatesFactory instance to add as an attribute of the context
|
[
"Adds",
"a",
"given",
"URLTemplatesFactory",
"instance",
"as",
"an",
"attribute",
"on",
"the",
"ServletContext",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java#L82-L92
|
146,904
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java
|
URLTemplatesFactory.getURLTemplatesFactory
|
public static URLTemplatesFactory getURLTemplatesFactory(ServletRequest servletRequest)
{
assert servletRequest != null : "The ServletRequest cannot be null.";
if (servletRequest == null) {
throw new IllegalArgumentException("The ServletRequest cannot be null.");
}
return (URLTemplatesFactory) servletRequest.getAttribute(URL_TEMPLATE_FACTORY_ATTR);
}
|
java
|
public static URLTemplatesFactory getURLTemplatesFactory(ServletRequest servletRequest)
{
assert servletRequest != null : "The ServletRequest cannot be null.";
if (servletRequest == null) {
throw new IllegalArgumentException("The ServletRequest cannot be null.");
}
return (URLTemplatesFactory) servletRequest.getAttribute(URL_TEMPLATE_FACTORY_ATTR);
}
|
[
"public",
"static",
"URLTemplatesFactory",
"getURLTemplatesFactory",
"(",
"ServletRequest",
"servletRequest",
")",
"{",
"assert",
"servletRequest",
"!=",
"null",
":",
"\"The ServletRequest cannot be null.\"",
";",
"if",
"(",
"servletRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The ServletRequest cannot be null.\"",
")",
";",
"}",
"return",
"(",
"URLTemplatesFactory",
")",
"servletRequest",
".",
"getAttribute",
"(",
"URL_TEMPLATE_FACTORY_ATTR",
")",
";",
"}"
] |
Gets the URLTemplatesFactory instance from a ServletRequest attribute.
@param servletRequest the current ServletRequest.
@return the URLTemplatesFactory instance from the ServletRequest.
|
[
"Gets",
"the",
"URLTemplatesFactory",
"instance",
"from",
"a",
"ServletRequest",
"attribute",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java#L100-L109
|
146,905
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java
|
URLTemplatesFactory.initServletRequest
|
public static void initServletRequest(ServletRequest servletRequest, URLTemplatesFactory templatesFactory)
{
assert servletRequest != null : "The ServletRequest cannot be null.";
if (servletRequest == null) {
throw new IllegalArgumentException("The ServletRequest cannot be null.");
}
servletRequest.setAttribute(URL_TEMPLATE_FACTORY_ATTR, templatesFactory);
}
|
java
|
public static void initServletRequest(ServletRequest servletRequest, URLTemplatesFactory templatesFactory)
{
assert servletRequest != null : "The ServletRequest cannot be null.";
if (servletRequest == null) {
throw new IllegalArgumentException("The ServletRequest cannot be null.");
}
servletRequest.setAttribute(URL_TEMPLATE_FACTORY_ATTR, templatesFactory);
}
|
[
"public",
"static",
"void",
"initServletRequest",
"(",
"ServletRequest",
"servletRequest",
",",
"URLTemplatesFactory",
"templatesFactory",
")",
"{",
"assert",
"servletRequest",
"!=",
"null",
":",
"\"The ServletRequest cannot be null.\"",
";",
"if",
"(",
"servletRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The ServletRequest cannot be null.\"",
")",
";",
"}",
"servletRequest",
".",
"setAttribute",
"(",
"URL_TEMPLATE_FACTORY_ATTR",
",",
"templatesFactory",
")",
";",
"}"
] |
Adds a given URLTemplatesFactory instance as an attribute on the ServletRequest.
@param servletRequest the current ServletRequest.
@param templatesFactory the URLTemplatesFactory instance to add as an attribute of the request
|
[
"Adds",
"a",
"given",
"URLTemplatesFactory",
"instance",
"as",
"an",
"attribute",
"on",
"the",
"ServletRequest",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java#L117-L126
|
146,906
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEntityCollectionContainerCollector.java
|
OWLEntityCollectionContainerCollector.reset
|
public void reset(Set<OWLEntity> toReturn) {
objects = toReturn;
if (anonymousIndividuals != null) {
verifyNotNull(anonymousIndividuals).clear();
}
}
|
java
|
public void reset(Set<OWLEntity> toReturn) {
objects = toReturn;
if (anonymousIndividuals != null) {
verifyNotNull(anonymousIndividuals).clear();
}
}
|
[
"public",
"void",
"reset",
"(",
"Set",
"<",
"OWLEntity",
">",
"toReturn",
")",
"{",
"objects",
"=",
"toReturn",
";",
"if",
"(",
"anonymousIndividuals",
"!=",
"null",
")",
"{",
"verifyNotNull",
"(",
"anonymousIndividuals",
")",
".",
"clear",
"(",
")",
";",
"}",
"}"
] |
XXX not in the interface
|
[
"XXX",
"not",
"in",
"the",
"interface"
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEntityCollectionContainerCollector.java#L83-L88
|
146,907
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java
|
PageFlowControlContainerFactory.getSessionVar
|
private static Object getSessionVar(HttpServletRequest request, ServletContext servletContext, String name)
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
RequestContext rc = new RequestContext( unwrappedRequest, null );
String attrName = ScopedServletUtils.getScopedSessionAttrName(name, unwrappedRequest);
return sh.getAttribute( rc, attrName );
}
|
java
|
private static Object getSessionVar(HttpServletRequest request, ServletContext servletContext, String name)
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
RequestContext rc = new RequestContext( unwrappedRequest, null );
String attrName = ScopedServletUtils.getScopedSessionAttrName(name, unwrappedRequest);
return sh.getAttribute( rc, attrName );
}
|
[
"private",
"static",
"Object",
"getSessionVar",
"(",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
",",
"String",
"name",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"servletContext",
")",
".",
"getStorageHandler",
"(",
")",
";",
"HttpServletRequest",
"unwrappedRequest",
"=",
"PageFlowUtils",
".",
"unwrapMultipart",
"(",
"request",
")",
";",
"RequestContext",
"rc",
"=",
"new",
"RequestContext",
"(",
"unwrappedRequest",
",",
"null",
")",
";",
"String",
"attrName",
"=",
"ScopedServletUtils",
".",
"getScopedSessionAttrName",
"(",
"name",
",",
"unwrappedRequest",
")",
";",
"return",
"sh",
".",
"getAttribute",
"(",
"rc",
",",
"attrName",
")",
";",
"}"
] |
This is a generic routine that will retrieve a value from the Session through the
StorageHandler.
@param request
@param servletContext
@param name The name of the value to be retrieved
@return The requested value from the session
|
[
"This",
"is",
"a",
"generic",
"routine",
"that",
"will",
"retrieve",
"a",
"value",
"from",
"the",
"Session",
"through",
"the",
"StorageHandler",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java#L59-L67
|
146,908
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.isXMLNameStartCharacter
|
public static boolean isXMLNameStartCharacter(int codePoint) {
return codePoint == ':' || codePoint >= 'A' && codePoint <= 'Z' || codePoint == '_' || codePoint >= 'a'
&& codePoint <= 'z' || codePoint >= 0xC0 && codePoint <= 0xD6 || codePoint >= 0xD8 && codePoint <= 0xF6
|| codePoint >= 0xF8 && codePoint <= 0x2FF || codePoint >= 0x370 && codePoint <= 0x37D || codePoint >= 0x37F
&& codePoint <= 0x1FFF || codePoint >= 0x200C && codePoint <= 0x200D || codePoint >= 0x2070
&& codePoint <= 0x218F || codePoint >= 0x2C00 && codePoint <= 0x2FEF || codePoint >= 0x3001
&& codePoint <= 0xD7FF || codePoint >= 0xF900 && codePoint <= 0xFDCF || codePoint >= 0xFDF0
&& codePoint <= 0xFFFD || codePoint >= 0x10000 && codePoint <= 0xEFFFF;
}
|
java
|
public static boolean isXMLNameStartCharacter(int codePoint) {
return codePoint == ':' || codePoint >= 'A' && codePoint <= 'Z' || codePoint == '_' || codePoint >= 'a'
&& codePoint <= 'z' || codePoint >= 0xC0 && codePoint <= 0xD6 || codePoint >= 0xD8 && codePoint <= 0xF6
|| codePoint >= 0xF8 && codePoint <= 0x2FF || codePoint >= 0x370 && codePoint <= 0x37D || codePoint >= 0x37F
&& codePoint <= 0x1FFF || codePoint >= 0x200C && codePoint <= 0x200D || codePoint >= 0x2070
&& codePoint <= 0x218F || codePoint >= 0x2C00 && codePoint <= 0x2FEF || codePoint >= 0x3001
&& codePoint <= 0xD7FF || codePoint >= 0xF900 && codePoint <= 0xFDCF || codePoint >= 0xFDF0
&& codePoint <= 0xFFFD || codePoint >= 0x10000 && codePoint <= 0xEFFFF;
}
|
[
"public",
"static",
"boolean",
"isXMLNameStartCharacter",
"(",
"int",
"codePoint",
")",
"{",
"return",
"codePoint",
"==",
"'",
"'",
"||",
"codePoint",
">=",
"'",
"'",
"&&",
"codePoint",
"<=",
"'",
"'",
"||",
"codePoint",
"==",
"'",
"'",
"||",
"codePoint",
">=",
"'",
"'",
"&&",
"codePoint",
"<=",
"'",
"'",
"||",
"codePoint",
">=",
"0xC0",
"&&",
"codePoint",
"<=",
"0xD6",
"||",
"codePoint",
">=",
"0xD8",
"&&",
"codePoint",
"<=",
"0xF6",
"||",
"codePoint",
">=",
"0xF8",
"&&",
"codePoint",
"<=",
"0x2FF",
"||",
"codePoint",
">=",
"0x370",
"&&",
"codePoint",
"<=",
"0x37D",
"||",
"codePoint",
">=",
"0x37F",
"&&",
"codePoint",
"<=",
"0x1FFF",
"||",
"codePoint",
">=",
"0x200C",
"&&",
"codePoint",
"<=",
"0x200D",
"||",
"codePoint",
">=",
"0x2070",
"&&",
"codePoint",
"<=",
"0x218F",
"||",
"codePoint",
">=",
"0x2C00",
"&&",
"codePoint",
"<=",
"0x2FEF",
"||",
"codePoint",
">=",
"0x3001",
"&&",
"codePoint",
"<=",
"0xD7FF",
"||",
"codePoint",
">=",
"0xF900",
"&&",
"codePoint",
"<=",
"0xFDCF",
"||",
"codePoint",
">=",
"0xFDF0",
"&&",
"codePoint",
"<=",
"0xFFFD",
"||",
"codePoint",
">=",
"0x10000",
"&&",
"codePoint",
"<=",
"0xEFFFF",
";",
"}"
] |
Determines if a character is an XML name start character.
@param codePoint
The code point of the character to be tested. For UTF-16
characters the code point corresponds to the value of the char
that represents the character.
@return {@code true} if {@code codePoint} is an XML name start character,
otherwise {@code false}
|
[
"Determines",
"if",
"a",
"character",
"is",
"an",
"XML",
"name",
"start",
"character",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L55-L63
|
146,909
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.isXMLNameChar
|
public static boolean isXMLNameChar(int codePoint) {
return isXMLNameStartCharacter(codePoint) || codePoint == '-' || codePoint == '.' || codePoint >= '0'
&& codePoint <= '9' || codePoint == 0xB7 || codePoint >= 0x0300 && codePoint <= 0x036F
|| codePoint >= 0x203F && codePoint <= 0x2040;
}
|
java
|
public static boolean isXMLNameChar(int codePoint) {
return isXMLNameStartCharacter(codePoint) || codePoint == '-' || codePoint == '.' || codePoint >= '0'
&& codePoint <= '9' || codePoint == 0xB7 || codePoint >= 0x0300 && codePoint <= 0x036F
|| codePoint >= 0x203F && codePoint <= 0x2040;
}
|
[
"public",
"static",
"boolean",
"isXMLNameChar",
"(",
"int",
"codePoint",
")",
"{",
"return",
"isXMLNameStartCharacter",
"(",
"codePoint",
")",
"||",
"codePoint",
"==",
"'",
"'",
"||",
"codePoint",
"==",
"'",
"'",
"||",
"codePoint",
">=",
"'",
"'",
"&&",
"codePoint",
"<=",
"'",
"'",
"||",
"codePoint",
"==",
"0xB7",
"||",
"codePoint",
">=",
"0x0300",
"&&",
"codePoint",
"<=",
"0x036F",
"||",
"codePoint",
">=",
"0x203F",
"&&",
"codePoint",
"<=",
"0x2040",
";",
"}"
] |
Determines if a character is an XML name character.
@param codePoint
The code point of the character to be tested. For UTF-8 and UTF-16
characters the code point corresponds to the value of the char
that represents the character.
@return {@code true} if {@code codePoint} is an XML name start character,
otherwise {@code false}
|
[
"Determines",
"if",
"a",
"character",
"is",
"an",
"XML",
"name",
"character",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L75-L79
|
146,910
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.getNCNameSuffixIndex
|
public static int getNCNameSuffixIndex(CharSequence s) {
// identify bnode labels and do not try to split them
if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
return -1;
}
int index = -1;
for (int i = s.length() - 1; i > -1; i--) {
if (!Character.isLowSurrogate(s.charAt(i))) {
int codePoint = Character.codePointAt(s, i);
if (isNCNameStartChar(codePoint)) {
index = i;
}
if (!isNCNameChar(codePoint)) {
break;
}
}
}
return index;
}
|
java
|
public static int getNCNameSuffixIndex(CharSequence s) {
// identify bnode labels and do not try to split them
if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
return -1;
}
int index = -1;
for (int i = s.length() - 1; i > -1; i--) {
if (!Character.isLowSurrogate(s.charAt(i))) {
int codePoint = Character.codePointAt(s, i);
if (isNCNameStartChar(codePoint)) {
index = i;
}
if (!isNCNameChar(codePoint)) {
break;
}
}
}
return index;
}
|
[
"public",
"static",
"int",
"getNCNameSuffixIndex",
"(",
"CharSequence",
"s",
")",
"{",
"// identify bnode labels and do not try to split them",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"1",
"&&",
"s",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
"&&",
"s",
".",
"charAt",
"(",
"1",
")",
"==",
"'",
"'",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"index",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"s",
".",
"length",
"(",
")",
"-",
"1",
";",
"i",
">",
"-",
"1",
";",
"i",
"--",
")",
"{",
"if",
"(",
"!",
"Character",
".",
"isLowSurrogate",
"(",
"s",
".",
"charAt",
"(",
"i",
")",
")",
")",
"{",
"int",
"codePoint",
"=",
"Character",
".",
"codePointAt",
"(",
"s",
",",
"i",
")",
";",
"if",
"(",
"isNCNameStartChar",
"(",
"codePoint",
")",
")",
"{",
"index",
"=",
"i",
";",
"}",
"if",
"(",
"!",
"isNCNameChar",
"(",
"codePoint",
")",
")",
"{",
"break",
";",
"}",
"}",
"}",
"return",
"index",
";",
"}"
] |
Gets the index of the longest NCName that is the suffix of a character
sequence.
@param s
The character sequence.
@return The index of the longest suffix of the specified character
sequence {@code s} that is an NCName, or -1 if the character
sequence {@code s} does not have a suffix that is an NCName.
|
[
"Gets",
"the",
"index",
"of",
"the",
"longest",
"NCName",
"that",
"is",
"the",
"suffix",
"of",
"a",
"character",
"sequence",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L204-L222
|
146,911
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.getNCNameSuffix
|
@Nullable
public static String getNCNameSuffix(CharSequence s) {
if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
return null;
}
int localPartStartIndex = getNCNameSuffixIndex(s);
if (localPartStartIndex > -1) {
return s.toString().substring(localPartStartIndex);
} else {
return null;
}
}
|
java
|
@Nullable
public static String getNCNameSuffix(CharSequence s) {
if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
return null;
}
int localPartStartIndex = getNCNameSuffixIndex(s);
if (localPartStartIndex > -1) {
return s.toString().substring(localPartStartIndex);
} else {
return null;
}
}
|
[
"@",
"Nullable",
"public",
"static",
"String",
"getNCNameSuffix",
"(",
"CharSequence",
"s",
")",
"{",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"1",
"&&",
"s",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
"&&",
"s",
".",
"charAt",
"(",
"1",
")",
"==",
"'",
"'",
")",
"{",
"return",
"null",
";",
"}",
"int",
"localPartStartIndex",
"=",
"getNCNameSuffixIndex",
"(",
"s",
")",
";",
"if",
"(",
"localPartStartIndex",
">",
"-",
"1",
")",
"{",
"return",
"s",
".",
"toString",
"(",
")",
".",
"substring",
"(",
"localPartStartIndex",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
] |
Get the longest NCName that is a suffix of a character sequence.
@param s
The character sequence.
@return The String which is the longest suffix of the character sequence
{@code s} that is an NCName, or {@code null} if the character
sequence {@code s} does not have a suffix that is an NCName.
|
[
"Get",
"the",
"longest",
"NCName",
"that",
"is",
"a",
"suffix",
"of",
"a",
"character",
"sequence",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L233-L244
|
146,912
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.getNCNamePrefix
|
@Nonnull
public static String getNCNamePrefix(CharSequence s) {
if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
return s.toString();
}
int localPartStartIndex = getNCNameSuffixIndex(s);
if (localPartStartIndex > -1) {
return s.toString().substring(0, localPartStartIndex);
} else {
return s.toString();
}
}
|
java
|
@Nonnull
public static String getNCNamePrefix(CharSequence s) {
if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
return s.toString();
}
int localPartStartIndex = getNCNameSuffixIndex(s);
if (localPartStartIndex > -1) {
return s.toString().substring(0, localPartStartIndex);
} else {
return s.toString();
}
}
|
[
"@",
"Nonnull",
"public",
"static",
"String",
"getNCNamePrefix",
"(",
"CharSequence",
"s",
")",
"{",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"1",
"&&",
"s",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
"&&",
"s",
".",
"charAt",
"(",
"1",
")",
"==",
"'",
"'",
")",
"{",
"return",
"s",
".",
"toString",
"(",
")",
";",
"}",
"int",
"localPartStartIndex",
"=",
"getNCNameSuffixIndex",
"(",
"s",
")",
";",
"if",
"(",
"localPartStartIndex",
">",
"-",
"1",
")",
"{",
"return",
"s",
".",
"toString",
"(",
")",
".",
"substring",
"(",
"0",
",",
"localPartStartIndex",
")",
";",
"}",
"else",
"{",
"return",
"s",
".",
"toString",
"(",
")",
";",
"}",
"}"
] |
utility to get the part of a charsequence that is not the NCName
fragment.
@param s
the charsequence to split
@return the prefix split at the last non-ncname character, or the whole
input if no ncname is found
|
[
"utility",
"to",
"get",
"the",
"part",
"of",
"a",
"charsequence",
"that",
"is",
"not",
"the",
"NCName",
"fragment",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L255-L266
|
146,913
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.escapeXML
|
@Nonnull
public static String escapeXML(CharSequence s) {
// double quote -- quot
// ampersand -- amp
// less than -- lt
// greater than -- gt
// apostrophe -- apos
StringBuilder sb = new StringBuilder(s.length() * 2);
for (int i = 0; i < s.length();) {
int codePoint = Character.codePointAt(s, i);
if (codePoint == '<') {
sb.append(LT);
} else if (codePoint == '>') {
sb.append(GT);
} else if (codePoint == '\"') {
sb.append(QUOT);
} else if (codePoint == '&') {
sb.append(AMP);
} else if (codePoint == '\'') {
sb.append(APOS);
} else {
sb.appendCodePoint(codePoint);
}
i += Character.charCount(codePoint);
}
return sb.toString();
}
|
java
|
@Nonnull
public static String escapeXML(CharSequence s) {
// double quote -- quot
// ampersand -- amp
// less than -- lt
// greater than -- gt
// apostrophe -- apos
StringBuilder sb = new StringBuilder(s.length() * 2);
for (int i = 0; i < s.length();) {
int codePoint = Character.codePointAt(s, i);
if (codePoint == '<') {
sb.append(LT);
} else if (codePoint == '>') {
sb.append(GT);
} else if (codePoint == '\"') {
sb.append(QUOT);
} else if (codePoint == '&') {
sb.append(AMP);
} else if (codePoint == '\'') {
sb.append(APOS);
} else {
sb.appendCodePoint(codePoint);
}
i += Character.charCount(codePoint);
}
return sb.toString();
}
|
[
"@",
"Nonnull",
"public",
"static",
"String",
"escapeXML",
"(",
"CharSequence",
"s",
")",
"{",
"// double quote -- quot",
"// ampersand -- amp",
"// less than -- lt",
"// greater than -- gt",
"// apostrophe -- apos",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"s",
".",
"length",
"(",
")",
"*",
"2",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
")",
"{",
"int",
"codePoint",
"=",
"Character",
".",
"codePointAt",
"(",
"s",
",",
"i",
")",
";",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"append",
"(",
"LT",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"append",
"(",
"GT",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"append",
"(",
"QUOT",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"append",
"(",
"AMP",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"append",
"(",
"APOS",
")",
";",
"}",
"else",
"{",
"sb",
".",
"appendCodePoint",
"(",
"codePoint",
")",
";",
"}",
"i",
"+=",
"Character",
".",
"charCount",
"(",
"codePoint",
")",
";",
"}",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] |
Escapes a character sequence so that it is valid XML.
@param s
The character sequence.
@return The escaped version of the character sequence.
|
[
"Escapes",
"a",
"character",
"sequence",
"so",
"that",
"it",
"is",
"valid",
"XML",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L275-L301
|
146,914
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.escapeXML
|
public static StringBuilder escapeXML(char[] chars, int start, int count, StringBuilder destination) {
// double quote -- quot
// ampersand -- amp
// less than -- lt
// greater than -- gt
// apostrophe -- apos
for (int i = 0; i < count; i++) {
char codePoint = chars[start + i];
if (codePoint == '<') {
destination.append(LT);
} else if (codePoint == '>') {
destination.append(GT);
} else if (codePoint == '\"') {
destination.append(QUOT);
} else if (codePoint == '&') {
destination.append(AMP);
} else if (codePoint == '\'') {
destination.append(APOS);
} else {
destination.append(codePoint);
}
}
return destination;
}
|
java
|
public static StringBuilder escapeXML(char[] chars, int start, int count, StringBuilder destination) {
// double quote -- quot
// ampersand -- amp
// less than -- lt
// greater than -- gt
// apostrophe -- apos
for (int i = 0; i < count; i++) {
char codePoint = chars[start + i];
if (codePoint == '<') {
destination.append(LT);
} else if (codePoint == '>') {
destination.append(GT);
} else if (codePoint == '\"') {
destination.append(QUOT);
} else if (codePoint == '&') {
destination.append(AMP);
} else if (codePoint == '\'') {
destination.append(APOS);
} else {
destination.append(codePoint);
}
}
return destination;
}
|
[
"public",
"static",
"StringBuilder",
"escapeXML",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"start",
",",
"int",
"count",
",",
"StringBuilder",
"destination",
")",
"{",
"// double quote -- quot",
"// ampersand -- amp",
"// less than -- lt",
"// greater than -- gt",
"// apostrophe -- apos",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"char",
"codePoint",
"=",
"chars",
"[",
"start",
"+",
"i",
"]",
";",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"destination",
".",
"append",
"(",
"LT",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"destination",
".",
"append",
"(",
"GT",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"destination",
".",
"append",
"(",
"QUOT",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"destination",
".",
"append",
"(",
"AMP",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"destination",
".",
"append",
"(",
"APOS",
")",
";",
"}",
"else",
"{",
"destination",
".",
"append",
"(",
"codePoint",
")",
";",
"}",
"}",
"return",
"destination",
";",
"}"
] |
Escapes a subset of a char sequence so that it is valid XML. Escaped or
unchanged characters are added to destination.
@param chars
chars to check
@param start
start index (inclusive)
@param count
number of characters
@param destination
destination for escaped chars
@return The modified destination.
|
[
"Escapes",
"a",
"subset",
"of",
"a",
"char",
"sequence",
"so",
"that",
"it",
"is",
"valid",
"XML",
".",
"Escaped",
"or",
"unchanged",
"characters",
"are",
"added",
"to",
"destination",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L317-L340
|
146,915
|
matthewhorridge/owlapi-gwt
|
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java
|
XMLUtils.escapeXML
|
public static void escapeXML(StringBuilder sb) {
// double quote -- quot
// ampersand -- amp
// less than -- lt
// greater than -- gt
// apostrophe -- apos
for (int i = 0; i < sb.length();) {
int codePoint = Character.codePointAt(sb, i);
int length = Character.charCount(codePoint);
if (codePoint == '<') {
sb.replace(i, i + length, LT);
i += LT.length();
} else if (codePoint == '>') {
sb.replace(i, i + length, GT);
i += GT.length();
} else if (codePoint == '\"') {
sb.replace(i, i + length, QUOT);
i += QUOT.length();
} else if (codePoint == '&') {
sb.replace(i, i + length, AMP);
i += AMP.length();
} else if (codePoint == '\'') {
sb.replace(i, i + length, APOS);
i += APOS.length();
} else {
i += length;
}
}
}
|
java
|
public static void escapeXML(StringBuilder sb) {
// double quote -- quot
// ampersand -- amp
// less than -- lt
// greater than -- gt
// apostrophe -- apos
for (int i = 0; i < sb.length();) {
int codePoint = Character.codePointAt(sb, i);
int length = Character.charCount(codePoint);
if (codePoint == '<') {
sb.replace(i, i + length, LT);
i += LT.length();
} else if (codePoint == '>') {
sb.replace(i, i + length, GT);
i += GT.length();
} else if (codePoint == '\"') {
sb.replace(i, i + length, QUOT);
i += QUOT.length();
} else if (codePoint == '&') {
sb.replace(i, i + length, AMP);
i += AMP.length();
} else if (codePoint == '\'') {
sb.replace(i, i + length, APOS);
i += APOS.length();
} else {
i += length;
}
}
}
|
[
"public",
"static",
"void",
"escapeXML",
"(",
"StringBuilder",
"sb",
")",
"{",
"// double quote -- quot",
"// ampersand -- amp",
"// less than -- lt",
"// greater than -- gt",
"// apostrophe -- apos",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sb",
".",
"length",
"(",
")",
";",
")",
"{",
"int",
"codePoint",
"=",
"Character",
".",
"codePointAt",
"(",
"sb",
",",
"i",
")",
";",
"int",
"length",
"=",
"Character",
".",
"charCount",
"(",
"codePoint",
")",
";",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"replace",
"(",
"i",
",",
"i",
"+",
"length",
",",
"LT",
")",
";",
"i",
"+=",
"LT",
".",
"length",
"(",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"replace",
"(",
"i",
",",
"i",
"+",
"length",
",",
"GT",
")",
";",
"i",
"+=",
"GT",
".",
"length",
"(",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"replace",
"(",
"i",
",",
"i",
"+",
"length",
",",
"QUOT",
")",
";",
"i",
"+=",
"QUOT",
".",
"length",
"(",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"replace",
"(",
"i",
",",
"i",
"+",
"length",
",",
"AMP",
")",
";",
"i",
"+=",
"AMP",
".",
"length",
"(",
")",
";",
"}",
"else",
"if",
"(",
"codePoint",
"==",
"'",
"'",
")",
"{",
"sb",
".",
"replace",
"(",
"i",
",",
"i",
"+",
"length",
",",
"APOS",
")",
";",
"i",
"+=",
"APOS",
".",
"length",
"(",
")",
";",
"}",
"else",
"{",
"i",
"+=",
"length",
";",
"}",
"}",
"}"
] |
Escapes a string builder so that it is valid XML.
@param sb
The string builder to escape.
|
[
"Escapes",
"a",
"string",
"builder",
"so",
"that",
"it",
"is",
"valid",
"XML",
"."
] |
7ab975fb6cef3c8947099983551672a3b5d4e2fd
|
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/io/XMLUtils.java#L348-L376
|
146,916
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestDispatcher.java
|
ScopedRequestDispatcher.forward
|
public void forward( ServletRequest request, ServletResponse response )
throws ServletException, IOException
{
ScopedRequestImpl scopedRequest = ( ScopedRequestImpl ) ScopedServletUtils.unwrapRequest( request );
assert scopedRequest != null : request.getClass().getName();
scopedRequest.setForwardedURI( _uri );
scopedRequest.doForward();
}
|
java
|
public void forward( ServletRequest request, ServletResponse response )
throws ServletException, IOException
{
ScopedRequestImpl scopedRequest = ( ScopedRequestImpl ) ScopedServletUtils.unwrapRequest( request );
assert scopedRequest != null : request.getClass().getName();
scopedRequest.setForwardedURI( _uri );
scopedRequest.doForward();
}
|
[
"public",
"void",
"forward",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"ScopedRequestImpl",
"scopedRequest",
"=",
"(",
"ScopedRequestImpl",
")",
"ScopedServletUtils",
".",
"unwrapRequest",
"(",
"request",
")",
";",
"assert",
"scopedRequest",
"!=",
"null",
":",
"request",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"scopedRequest",
".",
"setForwardedURI",
"(",
"_uri",
")",
";",
"scopedRequest",
".",
"doForward",
"(",
")",
";",
"}"
] |
Does not actually cause a server forward of the request, but informs the ScopedRequest
object that a forward was attempted for a particular URI.
@param request the ScopedRequest, or a wrapper (ServletRequestWrapper) around it.
@param response the ScopedResponse, or a wrapper (ServletResponseWrapper) around it.
|
[
"Does",
"not",
"actually",
"cause",
"a",
"server",
"forward",
"of",
"the",
"request",
"but",
"informs",
"the",
"ScopedRequest",
"object",
"that",
"a",
"forward",
"was",
"attempted",
"for",
"a",
"particular",
"URI",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestDispatcher.java#L69-L76
|
146,917
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestDispatcher.java
|
ScopedRequestDispatcher.include
|
public void include( ServletRequest request, ServletResponse response )
throws ServletException, IOException
{
assert request instanceof HttpServletRequest : request.getClass().getName();
HttpServletRequest httpRequest = ( HttpServletRequest ) request;
//
// First, unwrap the request and response, looking for our ScopedRequest and ScopedResponse.
//
HttpServletRequest outerRequest = ScopedServletUtils.getOuterRequest( httpRequest );
//
// Need to set the "javax.servlet.include.request_uri" attribute on the outer request
// before forwarding with a request dispatcher. This attribute is used to keep track of
// the included URI.
//
outerRequest.setAttribute( REQUEST_URI_INCLUDE, httpRequest.getRequestURI());
if ( logger.isDebugEnabled() )
{
logger.debug( "Delegating to RequestDispatcher for URI " + _uri );
}
try
{
RequestDispatcher realDispatcher = outerRequest.getRequestDispatcher( _uri );
if ( realDispatcher == null )
{
assert response instanceof HttpServletResponse : response.getClass().getName();
( ( HttpServletResponse ) response ).setStatus( HttpServletResponse.SC_NOT_FOUND );
logger.error( "Could not get RequestDispatcher for URI " + _uri );
}
else
{
realDispatcher.include( request, response );
}
}
catch ( ServletException e )
{
logger.error( "Exception during RequestDispatcher.include().", e.getRootCause() );
throw e;
}
}
|
java
|
public void include( ServletRequest request, ServletResponse response )
throws ServletException, IOException
{
assert request instanceof HttpServletRequest : request.getClass().getName();
HttpServletRequest httpRequest = ( HttpServletRequest ) request;
//
// First, unwrap the request and response, looking for our ScopedRequest and ScopedResponse.
//
HttpServletRequest outerRequest = ScopedServletUtils.getOuterRequest( httpRequest );
//
// Need to set the "javax.servlet.include.request_uri" attribute on the outer request
// before forwarding with a request dispatcher. This attribute is used to keep track of
// the included URI.
//
outerRequest.setAttribute( REQUEST_URI_INCLUDE, httpRequest.getRequestURI());
if ( logger.isDebugEnabled() )
{
logger.debug( "Delegating to RequestDispatcher for URI " + _uri );
}
try
{
RequestDispatcher realDispatcher = outerRequest.getRequestDispatcher( _uri );
if ( realDispatcher == null )
{
assert response instanceof HttpServletResponse : response.getClass().getName();
( ( HttpServletResponse ) response ).setStatus( HttpServletResponse.SC_NOT_FOUND );
logger.error( "Could not get RequestDispatcher for URI " + _uri );
}
else
{
realDispatcher.include( request, response );
}
}
catch ( ServletException e )
{
logger.error( "Exception during RequestDispatcher.include().", e.getRootCause() );
throw e;
}
}
|
[
"public",
"void",
"include",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"assert",
"request",
"instanceof",
"HttpServletRequest",
":",
"request",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"HttpServletRequest",
"httpRequest",
"=",
"(",
"HttpServletRequest",
")",
"request",
";",
"//",
"// First, unwrap the request and response, looking for our ScopedRequest and ScopedResponse.",
"//",
"HttpServletRequest",
"outerRequest",
"=",
"ScopedServletUtils",
".",
"getOuterRequest",
"(",
"httpRequest",
")",
";",
"//",
"// Need to set the \"javax.servlet.include.request_uri\" attribute on the outer request",
"// before forwarding with a request dispatcher. This attribute is used to keep track of",
"// the included URI.",
"//",
"outerRequest",
".",
"setAttribute",
"(",
"REQUEST_URI_INCLUDE",
",",
"httpRequest",
".",
"getRequestURI",
"(",
")",
")",
";",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Delegating to RequestDispatcher for URI \"",
"+",
"_uri",
")",
";",
"}",
"try",
"{",
"RequestDispatcher",
"realDispatcher",
"=",
"outerRequest",
".",
"getRequestDispatcher",
"(",
"_uri",
")",
";",
"if",
"(",
"realDispatcher",
"==",
"null",
")",
"{",
"assert",
"response",
"instanceof",
"HttpServletResponse",
":",
"response",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"(",
"(",
"HttpServletResponse",
")",
"response",
")",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_NOT_FOUND",
")",
";",
"logger",
".",
"error",
"(",
"\"Could not get RequestDispatcher for URI \"",
"+",
"_uri",
")",
";",
"}",
"else",
"{",
"realDispatcher",
".",
"include",
"(",
"request",
",",
"response",
")",
";",
"}",
"}",
"catch",
"(",
"ServletException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Exception during RequestDispatcher.include().\"",
",",
"e",
".",
"getRootCause",
"(",
")",
")",
";",
"throw",
"e",
";",
"}",
"}"
] |
Does a server include of the stored URI into the given ScopedRequest and ScopedResponse.
@param request the ScopedRequest, or a wrapper (ServletRequestWrapper) around it.
@param response the ScopedResponse, or a wrapper (ServletResponseWrapper) around it.
|
[
"Does",
"a",
"server",
"include",
"of",
"the",
"stored",
"URI",
"into",
"the",
"given",
"ScopedRequest",
"and",
"ScopedResponse",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestDispatcher.java#L84-L128
|
146,918
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/BundleMap.java
|
BundleMap.containsKey
|
public boolean containsKey(Object key) {
if(key == null)
throw new NullPointerException("Binding to a resource bundle does not accept a null key");
BundleNodeMap map = lookupScriptableBundle(key.toString());
return map != null;
}
|
java
|
public boolean containsKey(Object key) {
if(key == null)
throw new NullPointerException("Binding to a resource bundle does not accept a null key");
BundleNodeMap map = lookupScriptableBundle(key.toString());
return map != null;
}
|
[
"public",
"boolean",
"containsKey",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Binding to a resource bundle does not accept a null key\"",
")",
";",
"BundleNodeMap",
"map",
"=",
"lookupScriptableBundle",
"(",
"key",
".",
"toString",
"(",
")",
")",
";",
"return",
"map",
"!=",
"null",
";",
"}"
] |
Implementation of Map.containsKey for the bundle implicit object.
This method is required by JSP 2.0 EL and performs the lookups of the
various available bundles which have been registered either explicitly or
implicitly.
@param key The name of a bundle to lookup
@return <code>true</code> if the bundle is available; <code>false</code> otherwise
|
[
"Implementation",
"of",
"Map",
".",
"containsKey",
"for",
"the",
"bundle",
"implicit",
"object",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/BundleMap.java#L119-L125
|
146,919
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/BundleMap.java
|
BundleMap.lookupDefaultStrutsBundle
|
private MessageResources lookupDefaultStrutsBundle() {
Object value = _servletRequest.getAttribute(Globals.MESSAGES_KEY);
if(value instanceof MessageResources)
return (MessageResources)value;
else {
if(value != null)
LOGGER.warn("Can not resolve the default module bundle."
+ " The object resolved from the request is of type "
+ value.getClass().toString());
return null;
}
}
|
java
|
private MessageResources lookupDefaultStrutsBundle() {
Object value = _servletRequest.getAttribute(Globals.MESSAGES_KEY);
if(value instanceof MessageResources)
return (MessageResources)value;
else {
if(value != null)
LOGGER.warn("Can not resolve the default module bundle."
+ " The object resolved from the request is of type "
+ value.getClass().toString());
return null;
}
}
|
[
"private",
"MessageResources",
"lookupDefaultStrutsBundle",
"(",
")",
"{",
"Object",
"value",
"=",
"_servletRequest",
".",
"getAttribute",
"(",
"Globals",
".",
"MESSAGES_KEY",
")",
";",
"if",
"(",
"value",
"instanceof",
"MessageResources",
")",
"return",
"(",
"MessageResources",
")",
"value",
";",
"else",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"LOGGER",
".",
"warn",
"(",
"\"Can not resolve the default module bundle.\"",
"+",
"\" The object resolved from the request is of type \"",
"+",
"value",
".",
"getClass",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"return",
"null",
";",
"}",
"}"
] |
Lookup the "default" resource bundle for the current Struts module.
@return a MessageResources object if a "default" bundle exists.
<code>null</code> otherwise
|
[
"Lookup",
"the",
"default",
"resource",
"bundle",
"for",
"the",
"current",
"Struts",
"module",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/BundleMap.java#L211-L222
|
146,920
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/BundleMap.java
|
BundleMap.lookupStrutsBundle
|
private MessageResources lookupStrutsBundle(String name) {
Object value = _servletContext.getAttribute(name);
if(value instanceof MessageResources)
return (MessageResources)value;
else {
if(value != null)
LOGGER.warn("Can not resolve module bundle with name \"" +
name
+ "\". The object resolved from ServletContext is of type "
+ value.getClass().toString());
return null;
}
}
|
java
|
private MessageResources lookupStrutsBundle(String name) {
Object value = _servletContext.getAttribute(name);
if(value instanceof MessageResources)
return (MessageResources)value;
else {
if(value != null)
LOGGER.warn("Can not resolve module bundle with name \"" +
name
+ "\". The object resolved from ServletContext is of type "
+ value.getClass().toString());
return null;
}
}
|
[
"private",
"MessageResources",
"lookupStrutsBundle",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"_servletContext",
".",
"getAttribute",
"(",
"name",
")",
";",
"if",
"(",
"value",
"instanceof",
"MessageResources",
")",
"return",
"(",
"MessageResources",
")",
"value",
";",
"else",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"LOGGER",
".",
"warn",
"(",
"\"Can not resolve module bundle with name \\\"\"",
"+",
"name",
"+",
"\"\\\". The object resolved from ServletContext is of type \"",
"+",
"value",
".",
"getClass",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"return",
"null",
";",
"}",
"}"
] |
Lookup a specific resource bundle for the current Struts module.
@param name
the name of the resource bundle to lookup
@return a MessageResources object if a bundle matching the given name
exists. <code>null</code> otherwise.
|
[
"Lookup",
"a",
"specific",
"resource",
"bundle",
"for",
"the",
"current",
"Struts",
"module",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/BundleMap.java#L232-L244
|
146,921
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java
|
TimeUnit.x
|
static long x(long d, long m, long over) {
if (d > over) return Long.MAX_VALUE;
if (d < -over) return Long.MIN_VALUE;
return d * m;
}
|
java
|
static long x(long d, long m, long over) {
if (d > over) return Long.MAX_VALUE;
if (d < -over) return Long.MIN_VALUE;
return d * m;
}
|
[
"static",
"long",
"x",
"(",
"long",
"d",
",",
"long",
"m",
",",
"long",
"over",
")",
"{",
"if",
"(",
"d",
">",
"over",
")",
"return",
"Long",
".",
"MAX_VALUE",
";",
"if",
"(",
"d",
"<",
"-",
"over",
")",
"return",
"Long",
".",
"MIN_VALUE",
";",
"return",
"d",
"*",
"m",
";",
"}"
] |
Scale d by m, checking for overflow.
This has a short name to make above code more readable.
|
[
"Scale",
"d",
"by",
"m",
"checking",
"for",
"overflow",
".",
"This",
"has",
"a",
"short",
"name",
"to",
"make",
"above",
"code",
"more",
"readable",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java#L160-L164
|
146,922
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java
|
ProcessContextProperties.addActivityWithDataUsage
|
private void addActivityWithDataUsage(String activity) {
Validate.notNull(activity);
Validate.notEmpty(activity);
Set<String> currentActivities = getActivitiesWithDataUsage();
currentActivities.add(activity);
setProperty(ProcessContextProperty.ACTIVITIES_WITH_DATA_USAGE, ArrayUtils.toString(currentActivities.toArray()));
}
|
java
|
private void addActivityWithDataUsage(String activity) {
Validate.notNull(activity);
Validate.notEmpty(activity);
Set<String> currentActivities = getActivitiesWithDataUsage();
currentActivities.add(activity);
setProperty(ProcessContextProperty.ACTIVITIES_WITH_DATA_USAGE, ArrayUtils.toString(currentActivities.toArray()));
}
|
[
"private",
"void",
"addActivityWithDataUsage",
"(",
"String",
"activity",
")",
"{",
"Validate",
".",
"notNull",
"(",
"activity",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"activity",
")",
";",
"Set",
"<",
"String",
">",
"currentActivities",
"=",
"getActivitiesWithDataUsage",
"(",
")",
";",
"currentActivities",
".",
"add",
"(",
"activity",
")",
";",
"setProperty",
"(",
"ProcessContextProperty",
".",
"ACTIVITIES_WITH_DATA_USAGE",
",",
"ArrayUtils",
".",
"toString",
"(",
"currentActivities",
".",
"toArray",
"(",
")",
")",
")",
";",
"}"
] |
Adds an activity to the list of activities with data usage.
@param activity The name of the activity to add.
@throws ParameterException if the activity name is invalid.
|
[
"Adds",
"an",
"activity",
"to",
"the",
"list",
"of",
"activities",
"with",
"data",
"usage",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java#L164-L170
|
146,923
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java
|
ProcessContextProperties.getActivitiesWithDataUsage
|
public Set<String> getActivitiesWithDataUsage() {
Set<String> result = new HashSet<>();
String propertyValue = getProperty(ProcessContextProperty.ACTIVITIES_WITH_DATA_USAGE);
if (propertyValue == null) {
return result;
}
StringTokenizer activityTokens = StringUtils.splitArrayString(propertyValue, " ");
while (activityTokens.hasMoreTokens()) {
result.add(activityTokens.nextToken());
}
return result;
}
|
java
|
public Set<String> getActivitiesWithDataUsage() {
Set<String> result = new HashSet<>();
String propertyValue = getProperty(ProcessContextProperty.ACTIVITIES_WITH_DATA_USAGE);
if (propertyValue == null) {
return result;
}
StringTokenizer activityTokens = StringUtils.splitArrayString(propertyValue, " ");
while (activityTokens.hasMoreTokens()) {
result.add(activityTokens.nextToken());
}
return result;
}
|
[
"public",
"Set",
"<",
"String",
">",
"getActivitiesWithDataUsage",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"String",
"propertyValue",
"=",
"getProperty",
"(",
"ProcessContextProperty",
".",
"ACTIVITIES_WITH_DATA_USAGE",
")",
";",
"if",
"(",
"propertyValue",
"==",
"null",
")",
"{",
"return",
"result",
";",
"}",
"StringTokenizer",
"activityTokens",
"=",
"StringUtils",
".",
"splitArrayString",
"(",
"propertyValue",
",",
"\" \"",
")",
";",
"while",
"(",
"activityTokens",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"result",
".",
"add",
"(",
"activityTokens",
".",
"nextToken",
"(",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Returns the names of all activities with data usage.
@return A set of all activities with data usage.
|
[
"Returns",
"the",
"names",
"of",
"all",
"activities",
"with",
"data",
"usage",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java#L177-L188
|
146,924
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/info/impl/XLogInfoImpl.java
|
XLogInfoImpl.create
|
public static XLogInfo create(XLog log, XEventClassifier defaultClassifier,
Collection<XEventClassifier> classifiers) {
return new XLogInfoImpl(log, defaultClassifier, classifiers);
}
|
java
|
public static XLogInfo create(XLog log, XEventClassifier defaultClassifier,
Collection<XEventClassifier> classifiers) {
return new XLogInfoImpl(log, defaultClassifier, classifiers);
}
|
[
"public",
"static",
"XLogInfo",
"create",
"(",
"XLog",
"log",
",",
"XEventClassifier",
"defaultClassifier",
",",
"Collection",
"<",
"XEventClassifier",
">",
"classifiers",
")",
"{",
"return",
"new",
"XLogInfoImpl",
"(",
"log",
",",
"defaultClassifier",
",",
"classifiers",
")",
";",
"}"
] |
Creates a new log info summary with a collection of custom
event classifiers.
@param log The event log to create an info summary for.
@param defaultClassifier The default event classifier to be used.
@param classifiers A collection of additional event classifiers to
be covered by the created log info instance.
@return The log info summary for this log.
|
[
"Creates",
"a",
"new",
"log",
"info",
"summary",
"with",
"a",
"collection",
"of",
"custom",
"event",
"classifiers",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/impl/XLogInfoImpl.java#L144-L147
|
146,925
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/info/impl/XLogInfoImpl.java
|
XLogInfoImpl.setup
|
protected synchronized void setup() {
registerAttributes(logAttributeInfo, log);
for(XTrace trace : log) {
numberOfTraces++;
registerAttributes(traceAttributeInfo, trace);
XTimeBoundsImpl traceBounds = new XTimeBoundsImpl();
for(XEvent event : trace) {
registerAttributes(eventAttributeInfo, event);
for(XEventClasses classes : this.eventClasses.values()) {
classes.register(event);
}
traceBounds.register(event);
numberOfEvents++;
}
this.traceBoundaries.put(trace, traceBounds);
this.logBoundaries.register(traceBounds);
}
// harmonize event class indices
for(XEventClasses classes : this.eventClasses.values()) {
classes.harmonizeIndices();
}
}
|
java
|
protected synchronized void setup() {
registerAttributes(logAttributeInfo, log);
for(XTrace trace : log) {
numberOfTraces++;
registerAttributes(traceAttributeInfo, trace);
XTimeBoundsImpl traceBounds = new XTimeBoundsImpl();
for(XEvent event : trace) {
registerAttributes(eventAttributeInfo, event);
for(XEventClasses classes : this.eventClasses.values()) {
classes.register(event);
}
traceBounds.register(event);
numberOfEvents++;
}
this.traceBoundaries.put(trace, traceBounds);
this.logBoundaries.register(traceBounds);
}
// harmonize event class indices
for(XEventClasses classes : this.eventClasses.values()) {
classes.harmonizeIndices();
}
}
|
[
"protected",
"synchronized",
"void",
"setup",
"(",
")",
"{",
"registerAttributes",
"(",
"logAttributeInfo",
",",
"log",
")",
";",
"for",
"(",
"XTrace",
"trace",
":",
"log",
")",
"{",
"numberOfTraces",
"++",
";",
"registerAttributes",
"(",
"traceAttributeInfo",
",",
"trace",
")",
";",
"XTimeBoundsImpl",
"traceBounds",
"=",
"new",
"XTimeBoundsImpl",
"(",
")",
";",
"for",
"(",
"XEvent",
"event",
":",
"trace",
")",
"{",
"registerAttributes",
"(",
"eventAttributeInfo",
",",
"event",
")",
";",
"for",
"(",
"XEventClasses",
"classes",
":",
"this",
".",
"eventClasses",
".",
"values",
"(",
")",
")",
"{",
"classes",
".",
"register",
"(",
"event",
")",
";",
"}",
"traceBounds",
".",
"register",
"(",
"event",
")",
";",
"numberOfEvents",
"++",
";",
"}",
"this",
".",
"traceBoundaries",
".",
"put",
"(",
"trace",
",",
"traceBounds",
")",
";",
"this",
".",
"logBoundaries",
".",
"register",
"(",
"traceBounds",
")",
";",
"}",
"// harmonize event class indices",
"for",
"(",
"XEventClasses",
"classes",
":",
"this",
".",
"eventClasses",
".",
"values",
"(",
")",
")",
"{",
"classes",
".",
"harmonizeIndices",
"(",
")",
";",
"}",
"}"
] |
Creates the internal data structures of this summary on setup
from the log.
|
[
"Creates",
"the",
"internal",
"data",
"structures",
"of",
"this",
"summary",
"on",
"setup",
"from",
"the",
"log",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/impl/XLogInfoImpl.java#L232-L253
|
146,926
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/info/impl/XLogInfoImpl.java
|
XLogInfoImpl.registerAttributes
|
protected void registerAttributes(XAttributeInfoImpl attributeInfo, XAttributable attributable) {
if (attributable.hasAttributes()) {
for(XAttribute attribute : attributable.getAttributes().values()) {
// register attribute in appropriate map
attributeInfo.register(attribute);
// register meta-attributes globally
registerAttributes(metaAttributeInfo, attribute);
}
}
}
|
java
|
protected void registerAttributes(XAttributeInfoImpl attributeInfo, XAttributable attributable) {
if (attributable.hasAttributes()) {
for(XAttribute attribute : attributable.getAttributes().values()) {
// register attribute in appropriate map
attributeInfo.register(attribute);
// register meta-attributes globally
registerAttributes(metaAttributeInfo, attribute);
}
}
}
|
[
"protected",
"void",
"registerAttributes",
"(",
"XAttributeInfoImpl",
"attributeInfo",
",",
"XAttributable",
"attributable",
")",
"{",
"if",
"(",
"attributable",
".",
"hasAttributes",
"(",
")",
")",
"{",
"for",
"(",
"XAttribute",
"attribute",
":",
"attributable",
".",
"getAttributes",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"// register attribute in appropriate map",
"attributeInfo",
".",
"register",
"(",
"attribute",
")",
";",
"// register meta-attributes globally",
"registerAttributes",
"(",
"metaAttributeInfo",
",",
"attribute",
")",
";",
"}",
"}",
"}"
] |
Registers all attributes of a given attributable, i.e.
model type hierarchy element, in the given attribute info registry.
@param attributeInfo Attribute info registry to use for registration.
@param attributable Attributable whose attributes to register.
|
[
"Registers",
"all",
"attributes",
"of",
"a",
"given",
"attributable",
"i",
".",
"e",
".",
"model",
"type",
"hierarchy",
"element",
"in",
"the",
"given",
"attribute",
"info",
"registry",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/impl/XLogInfoImpl.java#L262-L271
|
146,927
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/CheckBoxOption.java
|
CheckBoxOption.setValue
|
public void setValue(Object value)
throws JspException
{
if (value != null)
_state.value = value.toString();
else
_state.value = null;
}
|
java
|
public void setValue(Object value)
throws JspException
{
if (value != null)
_state.value = value.toString();
else
_state.value = null;
}
|
[
"public",
"void",
"setValue",
"(",
"Object",
"value",
")",
"throws",
"JspException",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"_state",
".",
"value",
"=",
"value",
".",
"toString",
"(",
")",
";",
"else",
"_state",
".",
"value",
"=",
"null",
";",
"}"
] |
Set the value of this CheckBoxOption.
@param value the CheckBoxOption value
@jsptagref.attributedescription A String literal or a data binding expression. The value attribute determines the value submitted
by the checkbox.
@jsptagref.databindable true
@jsptagref.attributesyntaxvalue <i>string_literal_or_expression_value</i>
@netui:attribute required="false" rtexprvalue="true"
description="A String literal or a data binding expression. The value attribute determines the value submitted
by the checkbox."
|
[
"Set",
"the",
"value",
"of",
"this",
"CheckBoxOption",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/CheckBoxOption.java#L150-L157
|
146,928
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
|
JdbcControlImpl.onAquire
|
@EventHandler(field = "_resourceContext", eventSet = ResourceEvents.class, eventName = "onAcquire")
public void onAquire() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onAquire()");
}
try {
getConnection();
} catch (SQLException se) {
throw new ControlException("SQL Exception while attempting to connect to database.", se);
}
}
|
java
|
@EventHandler(field = "_resourceContext", eventSet = ResourceEvents.class, eventName = "onAcquire")
public void onAquire() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onAquire()");
}
try {
getConnection();
} catch (SQLException se) {
throw new ControlException("SQL Exception while attempting to connect to database.", se);
}
}
|
[
"@",
"EventHandler",
"(",
"field",
"=",
"\"_resourceContext\"",
",",
"eventSet",
"=",
"ResourceEvents",
".",
"class",
",",
"eventName",
"=",
"\"onAcquire\"",
")",
"public",
"void",
"onAquire",
"(",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Enter: onAquire()\"",
")",
";",
"}",
"try",
"{",
"getConnection",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"se",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"SQL Exception while attempting to connect to database.\"",
",",
"se",
")",
";",
"}",
"}"
] |
Invoked by the controls runtime when a new instance of this class is aquired by the runtime
|
[
"Invoked",
"by",
"the",
"controls",
"runtime",
"when",
"a",
"new",
"instance",
"of",
"this",
"class",
"is",
"aquired",
"by",
"the",
"runtime"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L103-L115
|
146,929
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
|
JdbcControlImpl.onRelease
|
@EventHandler(field = "_resourceContext", eventSet = ResourceContext.ResourceEvents.class, eventName = "onRelease")
public void onRelease() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onRelease()");
}
for (PreparedStatement ps : getResources()) {
try {
ps.close();
} catch (SQLException sqe) {
}
}
getResources().clear();
if (_connection != null) {
try {
_connection.close();
} catch (SQLException e) {
throw new ControlException("SQL Exception while attempting to close database connection.", e);
}
}
_connection = null;
_connectionDataSource = null;
_connectionDriver = null;
}
|
java
|
@EventHandler(field = "_resourceContext", eventSet = ResourceContext.ResourceEvents.class, eventName = "onRelease")
public void onRelease() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onRelease()");
}
for (PreparedStatement ps : getResources()) {
try {
ps.close();
} catch (SQLException sqe) {
}
}
getResources().clear();
if (_connection != null) {
try {
_connection.close();
} catch (SQLException e) {
throw new ControlException("SQL Exception while attempting to close database connection.", e);
}
}
_connection = null;
_connectionDataSource = null;
_connectionDriver = null;
}
|
[
"@",
"EventHandler",
"(",
"field",
"=",
"\"_resourceContext\"",
",",
"eventSet",
"=",
"ResourceContext",
".",
"ResourceEvents",
".",
"class",
",",
"eventName",
"=",
"\"onRelease\"",
")",
"public",
"void",
"onRelease",
"(",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Enter: onRelease()\"",
")",
";",
"}",
"for",
"(",
"PreparedStatement",
"ps",
":",
"getResources",
"(",
")",
")",
"{",
"try",
"{",
"ps",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"sqe",
")",
"{",
"}",
"}",
"getResources",
"(",
")",
".",
"clear",
"(",
")",
";",
"if",
"(",
"_connection",
"!=",
"null",
")",
"{",
"try",
"{",
"_connection",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"SQL Exception while attempting to close database connection.\"",
",",
"e",
")",
";",
"}",
"}",
"_connection",
"=",
"null",
";",
"_connectionDataSource",
"=",
"null",
";",
"_connectionDriver",
"=",
"null",
";",
"}"
] |
Invoked by the controls runtime when an instance of this class is released by the runtime
|
[
"Invoked",
"by",
"the",
"controls",
"runtime",
"when",
"an",
"instance",
"of",
"this",
"class",
"is",
"released",
"by",
"the",
"runtime"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L120-L146
|
146,930
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
|
JdbcControlImpl.invoke
|
public Object invoke(Method method, Object[] args) throws Throwable {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: invoke()");
}
assert _connection.isClosed() == false : "invoke(): JDBC Connection has been closed!!!!";
return execPreparedStatement(method, args);
}
|
java
|
public Object invoke(Method method, Object[] args) throws Throwable {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: invoke()");
}
assert _connection.isClosed() == false : "invoke(): JDBC Connection has been closed!!!!";
return execPreparedStatement(method, args);
}
|
[
"public",
"Object",
"invoke",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Enter: invoke()\"",
")",
";",
"}",
"assert",
"_connection",
".",
"isClosed",
"(",
")",
"==",
"false",
":",
"\"invoke(): JDBC Connection has been closed!!!!\"",
";",
"return",
"execPreparedStatement",
"(",
"method",
",",
"args",
")",
";",
"}"
] |
Called by the Controls runtime to handle calls to methods of an extensible control.
@param method The extended operation that was called.
@param args Parameters of the operation.
@return The value that should be returned by the operation.
@throws Throwable any exception declared on the extended operation may be
thrown. If a checked exception is thrown from the implementation that is not declared
on the original interface, it will be wrapped in a ControlException.
|
[
"Called",
"by",
"the",
"Controls",
"runtime",
"to",
"handle",
"calls",
"to",
"methods",
"of",
"an",
"extensible",
"control",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L217-L224
|
146,931
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
|
JdbcControlImpl.getConnectionFromDataSource
|
private Connection getConnectionFromDataSource(String jndiName,
Class<? extends JdbcControl.JndiContextFactory> jndiFactory)
throws SQLException
{
Connection con = null;
try {
JndiContextFactory jf = (JndiContextFactory) jndiFactory.newInstance();
Context jndiContext = jf.getContext();
_dataSource = (DataSource) jndiContext.lookup(jndiName);
con = _dataSource.getConnection();
} catch (IllegalAccessException iae) {
throw new ControlException("IllegalAccessException:", iae);
} catch (InstantiationException ie) {
throw new ControlException("InstantiationException:", ie);
} catch (NamingException ne) {
throw new ControlException("NamingException:", ne);
}
return con;
}
|
java
|
private Connection getConnectionFromDataSource(String jndiName,
Class<? extends JdbcControl.JndiContextFactory> jndiFactory)
throws SQLException
{
Connection con = null;
try {
JndiContextFactory jf = (JndiContextFactory) jndiFactory.newInstance();
Context jndiContext = jf.getContext();
_dataSource = (DataSource) jndiContext.lookup(jndiName);
con = _dataSource.getConnection();
} catch (IllegalAccessException iae) {
throw new ControlException("IllegalAccessException:", iae);
} catch (InstantiationException ie) {
throw new ControlException("InstantiationException:", ie);
} catch (NamingException ne) {
throw new ControlException("NamingException:", ne);
}
return con;
}
|
[
"private",
"Connection",
"getConnectionFromDataSource",
"(",
"String",
"jndiName",
",",
"Class",
"<",
"?",
"extends",
"JdbcControl",
".",
"JndiContextFactory",
">",
"jndiFactory",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
"=",
"null",
";",
"try",
"{",
"JndiContextFactory",
"jf",
"=",
"(",
"JndiContextFactory",
")",
"jndiFactory",
".",
"newInstance",
"(",
")",
";",
"Context",
"jndiContext",
"=",
"jf",
".",
"getContext",
"(",
")",
";",
"_dataSource",
"=",
"(",
"DataSource",
")",
"jndiContext",
".",
"lookup",
"(",
"jndiName",
")",
";",
"con",
"=",
"_dataSource",
".",
"getConnection",
"(",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"iae",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"IllegalAccessException:\"",
",",
"iae",
")",
";",
"}",
"catch",
"(",
"InstantiationException",
"ie",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"InstantiationException:\"",
",",
"ie",
")",
";",
"}",
"catch",
"(",
"NamingException",
"ne",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"NamingException:\"",
",",
"ne",
")",
";",
"}",
"return",
"con",
";",
"}"
] |
Get a connection from a DataSource.
@param jndiName Specifed in the subclasse's ConnectionDataSource annotation
@param jndiFactory Specified in the subclasse's ConnectionDataSource Annotation.
@return null if a connection cannot be established
@throws SQLException
|
[
"Get",
"a",
"connection",
"from",
"a",
"DataSource",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L402-L421
|
146,932
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
|
JdbcControlImpl.getConnectionFromDriverManager
|
private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException
{
Connection con = null;
try {
Class.forName(dbDriverClassName);
if (!EMPTY_STRING.equals(userName)) {
con = DriverManager.getConnection(dbUrlStr, userName, password);
} else if (!EMPTY_STRING.equals(propertiesString)) {
Properties props = parseProperties(propertiesString);
if (props == null) {
throw new ControlException("Invalid properties annotation value: " + propertiesString);
}
con = DriverManager.getConnection(dbUrlStr, props);
} else {
con = DriverManager.getConnection(dbUrlStr);
}
} catch (ClassNotFoundException e) {
throw new ControlException("Database driver class not found!", e);
}
return con;
}
|
java
|
private Connection getConnectionFromDriverManager(String dbDriverClassName, String dbUrlStr,
String userName, String password, String propertiesString)
throws SQLException
{
Connection con = null;
try {
Class.forName(dbDriverClassName);
if (!EMPTY_STRING.equals(userName)) {
con = DriverManager.getConnection(dbUrlStr, userName, password);
} else if (!EMPTY_STRING.equals(propertiesString)) {
Properties props = parseProperties(propertiesString);
if (props == null) {
throw new ControlException("Invalid properties annotation value: " + propertiesString);
}
con = DriverManager.getConnection(dbUrlStr, props);
} else {
con = DriverManager.getConnection(dbUrlStr);
}
} catch (ClassNotFoundException e) {
throw new ControlException("Database driver class not found!", e);
}
return con;
}
|
[
"private",
"Connection",
"getConnectionFromDriverManager",
"(",
"String",
"dbDriverClassName",
",",
"String",
"dbUrlStr",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"propertiesString",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
"=",
"null",
";",
"try",
"{",
"Class",
".",
"forName",
"(",
"dbDriverClassName",
")",
";",
"if",
"(",
"!",
"EMPTY_STRING",
".",
"equals",
"(",
"userName",
")",
")",
"{",
"con",
"=",
"DriverManager",
".",
"getConnection",
"(",
"dbUrlStr",
",",
"userName",
",",
"password",
")",
";",
"}",
"else",
"if",
"(",
"!",
"EMPTY_STRING",
".",
"equals",
"(",
"propertiesString",
")",
")",
"{",
"Properties",
"props",
"=",
"parseProperties",
"(",
"propertiesString",
")",
";",
"if",
"(",
"props",
"==",
"null",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Invalid properties annotation value: \"",
"+",
"propertiesString",
")",
";",
"}",
"con",
"=",
"DriverManager",
".",
"getConnection",
"(",
"dbUrlStr",
",",
"props",
")",
";",
"}",
"else",
"{",
"con",
"=",
"DriverManager",
".",
"getConnection",
"(",
"dbUrlStr",
")",
";",
"}",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Database driver class not found!\"",
",",
"e",
")",
";",
"}",
"return",
"con",
";",
"}"
] |
Get a JDBC connection from the DriverManager.
@param dbDriverClassName Specified in the subclasse's ConnectionDriver annotation.
@param dbUrlStr Specified in the subclasse's ConnectionDriver annotation.
@param userName Specified in the subclasse's ConnectionDriver annotation.
@param password Specified in the subclasse's ConnectionDriver annotation.
@return null if a connection cannot be established.
@throws SQLException
|
[
"Get",
"a",
"JDBC",
"connection",
"from",
"the",
"DriverManager",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L433-L456
|
146,933
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
|
JdbcControlImpl.setTypeMappers
|
private void setTypeMappers(TypeMapper[] typeMappers) throws SQLException {
if (typeMappers.length > 0) {
Map<String, Class<?>> mappers = _connection.getTypeMap();
for (TypeMapper t : typeMappers) {
mappers.put(t.UDTName(), t.mapperClass());
}
_connection.setTypeMap(mappers);
}
}
|
java
|
private void setTypeMappers(TypeMapper[] typeMappers) throws SQLException {
if (typeMappers.length > 0) {
Map<String, Class<?>> mappers = _connection.getTypeMap();
for (TypeMapper t : typeMappers) {
mappers.put(t.UDTName(), t.mapperClass());
}
_connection.setTypeMap(mappers);
}
}
|
[
"private",
"void",
"setTypeMappers",
"(",
"TypeMapper",
"[",
"]",
"typeMappers",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"typeMappers",
".",
"length",
">",
"0",
")",
"{",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"mappers",
"=",
"_connection",
".",
"getTypeMap",
"(",
")",
";",
"for",
"(",
"TypeMapper",
"t",
":",
"typeMappers",
")",
"{",
"mappers",
".",
"put",
"(",
"t",
".",
"UDTName",
"(",
")",
",",
"t",
".",
"mapperClass",
"(",
")",
")",
";",
"}",
"_connection",
".",
"setTypeMap",
"(",
"mappers",
")",
";",
"}",
"}"
] |
Set any custom type mappers specifed in the annotation for the connection. Used for mapping SQL UDTs to
java classes.
@param typeMappers An array of TypeMapper.
|
[
"Set",
"any",
"custom",
"type",
"mappers",
"specifed",
"in",
"the",
"annotation",
"for",
"the",
"connection",
".",
"Used",
"for",
"mapping",
"SQL",
"UDTs",
"to",
"java",
"classes",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L496-L505
|
146,934
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java
|
Form.addTagID
|
public void addTagID(String tagID, String name)
{
if (_focusMap == null) {
_focusMap = new HashMap();
}
_focusMap.put(tagID, name);
}
|
java
|
public void addTagID(String tagID, String name)
{
if (_focusMap == null) {
_focusMap = new HashMap();
}
_focusMap.put(tagID, name);
}
|
[
"public",
"void",
"addTagID",
"(",
"String",
"tagID",
",",
"String",
"name",
")",
"{",
"if",
"(",
"_focusMap",
"==",
"null",
")",
"{",
"_focusMap",
"=",
"new",
"HashMap",
"(",
")",
";",
"}",
"_focusMap",
".",
"put",
"(",
"tagID",
",",
"name",
")",
";",
"}"
] |
Adds a tagId and name to the Form's focusMap.
@param tagID the tagID of a child tag.
@param name the name of a child tag.
|
[
"Adds",
"a",
"tagId",
"and",
"name",
"to",
"the",
"Form",
"s",
"focusMap",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L560-L566
|
146,935
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java
|
Form.doStartTag
|
public int doStartTag() throws JspException
{
if (hasErrors())
return SKIP_BODY;
// Error out if there is a parent form
if (getNearestForm() != null) {
registerTagError(Bundle.getString("Tags_FormParentForm"), null);
}
// Look up the form bean name, scope, and type if necessary
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
ServletContext servletContext = pageContext.getServletContext();
// find the beanName, beanType and beanScope
lookupBeanScopeAndName(request, servletContext);
if (hasErrors())
return SKIP_BODY;
// Generate the real name. We generate it here so we can return it to any contained tags if
// they need it. If they access it, the most likely will cause the realName to be output
if (_state.id != null) {
_realName = getIdForTagId(_state.id);
}
else {
String formId = FORM_ID + getNextId(request);
_realName = getIdForTagId(formId);
}
// Store this tag itself as a page attribute
pageContext.setAttribute(Constants.FORM_KEY, this, PageContext.REQUEST_SCOPE);
// Locate or create the bean associated with our form
int scope = PageContext.SESSION_SCOPE;
if ("request".equals(_beanScope)) {
scope = PageContext.REQUEST_SCOPE;
}
// setup the Bean
Object bean = null;
if (_beanName != null)
bean = pageContext.getAttribute(_beanName, scope);
if (bean == null) {
if (_explicitBeanType) {
// Backwards compatibility - use explicitly specified values
try {
Handlers handlers = Handlers.get(pageContext.getServletContext());
bean = handlers.getReloadableClassHandler().newInstance(_beanType);
if (bean != null) {
((ActionForm) bean).setServlet(_servlet);
}
}
catch (Exception e) {
registerTagError(Bundle.getString("Tags_FormNameBadType"), e);
}
}
else {
// New and improved - use the values from the action mapping
// First, check to see if this is a page flow-scoped form bean. If so, use the current value
// from the member field in the page flow (or shared flow).
if (_flowController != null) {
bean = _flowController.getFormBean(_mapping);
}
if (bean == null) {
bean = InternalUtils.createActionForm(_mapping, _appConfig, _servlet, servletContext);
}
}
if (hasErrors())
return SKIP_BODY;
// Call the reset method if we have an ActionForm
if (bean instanceof ActionForm) {
((ActionForm) bean).reset(_mapping, request);
}
if (bean != null) {
pageContext.setAttribute(_beanName, bean, scope);
}
}
if (bean != null) {
pageContext.setAttribute(Constants.BEAN_KEY, bean, PageContext.REQUEST_SCOPE);
ImplicitObjectUtil.loadActionForm(pageContext, bean);
}
// Create the action URL here, so child tags can access it.
try {
HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
_extraHiddenParams = new LinkedHashMap/*<String, List<String>>*/();
_actionUrl = rewriteActionURL(servletContext, request, response, _extraHiddenParams);
}
catch (URISyntaxException e) {
// report the error...
logger.error(Bundle.getString("Tags_URISyntaxException"));
String s = Bundle.getString("Tags_Form_URLException",
new Object[]{_state.action, e.getMessage()});
registerTagError(s, e);
}
// Continue processing this page
return EVAL_BODY_BUFFERED;
}
|
java
|
public int doStartTag() throws JspException
{
if (hasErrors())
return SKIP_BODY;
// Error out if there is a parent form
if (getNearestForm() != null) {
registerTagError(Bundle.getString("Tags_FormParentForm"), null);
}
// Look up the form bean name, scope, and type if necessary
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
ServletContext servletContext = pageContext.getServletContext();
// find the beanName, beanType and beanScope
lookupBeanScopeAndName(request, servletContext);
if (hasErrors())
return SKIP_BODY;
// Generate the real name. We generate it here so we can return it to any contained tags if
// they need it. If they access it, the most likely will cause the realName to be output
if (_state.id != null) {
_realName = getIdForTagId(_state.id);
}
else {
String formId = FORM_ID + getNextId(request);
_realName = getIdForTagId(formId);
}
// Store this tag itself as a page attribute
pageContext.setAttribute(Constants.FORM_KEY, this, PageContext.REQUEST_SCOPE);
// Locate or create the bean associated with our form
int scope = PageContext.SESSION_SCOPE;
if ("request".equals(_beanScope)) {
scope = PageContext.REQUEST_SCOPE;
}
// setup the Bean
Object bean = null;
if (_beanName != null)
bean = pageContext.getAttribute(_beanName, scope);
if (bean == null) {
if (_explicitBeanType) {
// Backwards compatibility - use explicitly specified values
try {
Handlers handlers = Handlers.get(pageContext.getServletContext());
bean = handlers.getReloadableClassHandler().newInstance(_beanType);
if (bean != null) {
((ActionForm) bean).setServlet(_servlet);
}
}
catch (Exception e) {
registerTagError(Bundle.getString("Tags_FormNameBadType"), e);
}
}
else {
// New and improved - use the values from the action mapping
// First, check to see if this is a page flow-scoped form bean. If so, use the current value
// from the member field in the page flow (or shared flow).
if (_flowController != null) {
bean = _flowController.getFormBean(_mapping);
}
if (bean == null) {
bean = InternalUtils.createActionForm(_mapping, _appConfig, _servlet, servletContext);
}
}
if (hasErrors())
return SKIP_BODY;
// Call the reset method if we have an ActionForm
if (bean instanceof ActionForm) {
((ActionForm) bean).reset(_mapping, request);
}
if (bean != null) {
pageContext.setAttribute(_beanName, bean, scope);
}
}
if (bean != null) {
pageContext.setAttribute(Constants.BEAN_KEY, bean, PageContext.REQUEST_SCOPE);
ImplicitObjectUtil.loadActionForm(pageContext, bean);
}
// Create the action URL here, so child tags can access it.
try {
HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
_extraHiddenParams = new LinkedHashMap/*<String, List<String>>*/();
_actionUrl = rewriteActionURL(servletContext, request, response, _extraHiddenParams);
}
catch (URISyntaxException e) {
// report the error...
logger.error(Bundle.getString("Tags_URISyntaxException"));
String s = Bundle.getString("Tags_Form_URLException",
new Object[]{_state.action, e.getMessage()});
registerTagError(s, e);
}
// Continue processing this page
return EVAL_BODY_BUFFERED;
}
|
[
"public",
"int",
"doStartTag",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"SKIP_BODY",
";",
"// Error out if there is a parent form",
"if",
"(",
"getNearestForm",
"(",
")",
"!=",
"null",
")",
"{",
"registerTagError",
"(",
"Bundle",
".",
"getString",
"(",
"\"Tags_FormParentForm\"",
")",
",",
"null",
")",
";",
"}",
"// Look up the form bean name, scope, and type if necessary",
"HttpServletRequest",
"request",
"=",
"(",
"HttpServletRequest",
")",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"ServletContext",
"servletContext",
"=",
"pageContext",
".",
"getServletContext",
"(",
")",
";",
"// find the beanName, beanType and beanScope",
"lookupBeanScopeAndName",
"(",
"request",
",",
"servletContext",
")",
";",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"SKIP_BODY",
";",
"// Generate the real name. We generate it here so we can return it to any contained tags if",
"// they need it. If they access it, the most likely will cause the realName to be output",
"if",
"(",
"_state",
".",
"id",
"!=",
"null",
")",
"{",
"_realName",
"=",
"getIdForTagId",
"(",
"_state",
".",
"id",
")",
";",
"}",
"else",
"{",
"String",
"formId",
"=",
"FORM_ID",
"+",
"getNextId",
"(",
"request",
")",
";",
"_realName",
"=",
"getIdForTagId",
"(",
"formId",
")",
";",
"}",
"// Store this tag itself as a page attribute",
"pageContext",
".",
"setAttribute",
"(",
"Constants",
".",
"FORM_KEY",
",",
"this",
",",
"PageContext",
".",
"REQUEST_SCOPE",
")",
";",
"// Locate or create the bean associated with our form",
"int",
"scope",
"=",
"PageContext",
".",
"SESSION_SCOPE",
";",
"if",
"(",
"\"request\"",
".",
"equals",
"(",
"_beanScope",
")",
")",
"{",
"scope",
"=",
"PageContext",
".",
"REQUEST_SCOPE",
";",
"}",
"// setup the Bean",
"Object",
"bean",
"=",
"null",
";",
"if",
"(",
"_beanName",
"!=",
"null",
")",
"bean",
"=",
"pageContext",
".",
"getAttribute",
"(",
"_beanName",
",",
"scope",
")",
";",
"if",
"(",
"bean",
"==",
"null",
")",
"{",
"if",
"(",
"_explicitBeanType",
")",
"{",
"// Backwards compatibility - use explicitly specified values",
"try",
"{",
"Handlers",
"handlers",
"=",
"Handlers",
".",
"get",
"(",
"pageContext",
".",
"getServletContext",
"(",
")",
")",
";",
"bean",
"=",
"handlers",
".",
"getReloadableClassHandler",
"(",
")",
".",
"newInstance",
"(",
"_beanType",
")",
";",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"(",
"(",
"ActionForm",
")",
"bean",
")",
".",
"setServlet",
"(",
"_servlet",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"registerTagError",
"(",
"Bundle",
".",
"getString",
"(",
"\"Tags_FormNameBadType\"",
")",
",",
"e",
")",
";",
"}",
"}",
"else",
"{",
"// New and improved - use the values from the action mapping",
"// First, check to see if this is a page flow-scoped form bean. If so, use the current value",
"// from the member field in the page flow (or shared flow).",
"if",
"(",
"_flowController",
"!=",
"null",
")",
"{",
"bean",
"=",
"_flowController",
".",
"getFormBean",
"(",
"_mapping",
")",
";",
"}",
"if",
"(",
"bean",
"==",
"null",
")",
"{",
"bean",
"=",
"InternalUtils",
".",
"createActionForm",
"(",
"_mapping",
",",
"_appConfig",
",",
"_servlet",
",",
"servletContext",
")",
";",
"}",
"}",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"SKIP_BODY",
";",
"// Call the reset method if we have an ActionForm",
"if",
"(",
"bean",
"instanceof",
"ActionForm",
")",
"{",
"(",
"(",
"ActionForm",
")",
"bean",
")",
".",
"reset",
"(",
"_mapping",
",",
"request",
")",
";",
"}",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"pageContext",
".",
"setAttribute",
"(",
"_beanName",
",",
"bean",
",",
"scope",
")",
";",
"}",
"}",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"pageContext",
".",
"setAttribute",
"(",
"Constants",
".",
"BEAN_KEY",
",",
"bean",
",",
"PageContext",
".",
"REQUEST_SCOPE",
")",
";",
"ImplicitObjectUtil",
".",
"loadActionForm",
"(",
"pageContext",
",",
"bean",
")",
";",
"}",
"// Create the action URL here, so child tags can access it.",
"try",
"{",
"HttpServletResponse",
"response",
"=",
"(",
"HttpServletResponse",
")",
"pageContext",
".",
"getResponse",
"(",
")",
";",
"_extraHiddenParams",
"=",
"new",
"LinkedHashMap",
"/*<String, List<String>>*/",
"(",
")",
";",
"_actionUrl",
"=",
"rewriteActionURL",
"(",
"servletContext",
",",
"request",
",",
"response",
",",
"_extraHiddenParams",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"// report the error...",
"logger",
".",
"error",
"(",
"Bundle",
".",
"getString",
"(",
"\"Tags_URISyntaxException\"",
")",
")",
";",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_Form_URLException\"",
",",
"new",
"Object",
"[",
"]",
"{",
"_state",
".",
"action",
",",
"e",
".",
"getMessage",
"(",
")",
"}",
")",
";",
"registerTagError",
"(",
"s",
",",
"e",
")",
";",
"}",
"// Continue processing this page",
"return",
"EVAL_BODY_BUFFERED",
";",
"}"
] |
Render the beginning of this form.
@throws JspException if a JSP exception has occurred
|
[
"Render",
"the",
"beginning",
"of",
"this",
"form",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L573-L675
|
146,936
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java
|
Form.doAfterBody
|
public int doAfterBody() throws JspException
{
if (bodyContent != null) {
String value = bodyContent.getString();
bodyContent.clearBody();
if (value.length() > 0)
_text = value;
}
return SKIP_BODY;
}
|
java
|
public int doAfterBody() throws JspException
{
if (bodyContent != null) {
String value = bodyContent.getString();
bodyContent.clearBody();
if (value.length() > 0)
_text = value;
}
return SKIP_BODY;
}
|
[
"public",
"int",
"doAfterBody",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"bodyContent",
"!=",
"null",
")",
"{",
"String",
"value",
"=",
"bodyContent",
".",
"getString",
"(",
")",
";",
"bodyContent",
".",
"clearBody",
"(",
")",
";",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
"_text",
"=",
"value",
";",
"}",
"return",
"SKIP_BODY",
";",
"}"
] |
Save the body content of the Form.
@throws JspException if a JSP exception has occurred
|
[
"Save",
"the",
"body",
"content",
"of",
"the",
"Form",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L681-L690
|
146,937
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java
|
Form.renderNameAndId
|
private String renderNameAndId(HttpServletRequest request, String id)
{
// if id is not set then we need to exit
if (id == null)
return null;
// Legacy Java Script support -- This writes out a single table with both the id and names
// mixed. This is legacy support to match the pre beehive behavior.
String idScript = null;
IScriptReporter scriptReporter = getScriptReporter();
ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
if (TagConfig.isLegacyJavaScript()) {
idScript = srs.mapLegacyTagId(scriptReporter, id, _state.id);
}
// map the tagId to the real id
if (TagConfig.isDefaultJavaScript()) {
String script = srs.mapTagId(scriptReporter, id, _state.id, _state.name);
// if we wrote out script in legacy mode, we need to make sure we preserve it.
if (idScript != null) {
idScript = idScript + script;
}
else {
idScript = script;
}
}
return idScript;
}
|
java
|
private String renderNameAndId(HttpServletRequest request, String id)
{
// if id is not set then we need to exit
if (id == null)
return null;
// Legacy Java Script support -- This writes out a single table with both the id and names
// mixed. This is legacy support to match the pre beehive behavior.
String idScript = null;
IScriptReporter scriptReporter = getScriptReporter();
ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
if (TagConfig.isLegacyJavaScript()) {
idScript = srs.mapLegacyTagId(scriptReporter, id, _state.id);
}
// map the tagId to the real id
if (TagConfig.isDefaultJavaScript()) {
String script = srs.mapTagId(scriptReporter, id, _state.id, _state.name);
// if we wrote out script in legacy mode, we need to make sure we preserve it.
if (idScript != null) {
idScript = idScript + script;
}
else {
idScript = script;
}
}
return idScript;
}
|
[
"private",
"String",
"renderNameAndId",
"(",
"HttpServletRequest",
"request",
",",
"String",
"id",
")",
"{",
"// if id is not set then we need to exit",
"if",
"(",
"id",
"==",
"null",
")",
"return",
"null",
";",
"// Legacy Java Script support -- This writes out a single table with both the id and names",
"// mixed. This is legacy support to match the pre beehive behavior.",
"String",
"idScript",
"=",
"null",
";",
"IScriptReporter",
"scriptReporter",
"=",
"getScriptReporter",
"(",
")",
";",
"ScriptRequestState",
"srs",
"=",
"ScriptRequestState",
".",
"getScriptRequestState",
"(",
"request",
")",
";",
"if",
"(",
"TagConfig",
".",
"isLegacyJavaScript",
"(",
")",
")",
"{",
"idScript",
"=",
"srs",
".",
"mapLegacyTagId",
"(",
"scriptReporter",
",",
"id",
",",
"_state",
".",
"id",
")",
";",
"}",
"// map the tagId to the real id",
"if",
"(",
"TagConfig",
".",
"isDefaultJavaScript",
"(",
")",
")",
"{",
"String",
"script",
"=",
"srs",
".",
"mapTagId",
"(",
"scriptReporter",
",",
"id",
",",
"_state",
".",
"id",
",",
"_state",
".",
"name",
")",
";",
"// if we wrote out script in legacy mode, we need to make sure we preserve it.",
"if",
"(",
"idScript",
"!=",
"null",
")",
"{",
"idScript",
"=",
"idScript",
"+",
"script",
";",
"}",
"else",
"{",
"idScript",
"=",
"script",
";",
"}",
"}",
"return",
"idScript",
";",
"}"
] |
This mehtod will render the JavaScript associated with the id lookup if id has
been set.
@param request
@param id
@return
|
[
"This",
"mehtod",
"will",
"render",
"the",
"JavaScript",
"associated",
"with",
"the",
"id",
"lookup",
"if",
"id",
"has",
"been",
"set",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L826-L854
|
146,938
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java
|
Form.writeHiddenParam
|
private void writeHiddenParam(String paramName, String paramValue, AbstractRenderAppender results,
ServletRequest req, boolean newLine)
{
// put each hidden on a new line
if (newLine)
results.append("\n");
// create the state
_hiddenState.clear();
_hiddenState.name = paramName;
_hiddenState.value = paramValue;
TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
hiddenTag.doStartTag(results, _hiddenState);
hiddenTag.doEndTag(results);
}
|
java
|
private void writeHiddenParam(String paramName, String paramValue, AbstractRenderAppender results,
ServletRequest req, boolean newLine)
{
// put each hidden on a new line
if (newLine)
results.append("\n");
// create the state
_hiddenState.clear();
_hiddenState.name = paramName;
_hiddenState.value = paramValue;
TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
hiddenTag.doStartTag(results, _hiddenState);
hiddenTag.doEndTag(results);
}
|
[
"private",
"void",
"writeHiddenParam",
"(",
"String",
"paramName",
",",
"String",
"paramValue",
",",
"AbstractRenderAppender",
"results",
",",
"ServletRequest",
"req",
",",
"boolean",
"newLine",
")",
"{",
"// put each hidden on a new line",
"if",
"(",
"newLine",
")",
"results",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"// create the state",
"_hiddenState",
".",
"clear",
"(",
")",
";",
"_hiddenState",
".",
"name",
"=",
"paramName",
";",
"_hiddenState",
".",
"value",
"=",
"paramValue",
";",
"TagRenderingBase",
"hiddenTag",
"=",
"TagRenderingBase",
".",
"Factory",
".",
"getRendering",
"(",
"TagRenderingBase",
".",
"INPUT_HIDDEN_TAG",
",",
"req",
")",
";",
"hiddenTag",
".",
"doStartTag",
"(",
"results",
",",
"_hiddenState",
")",
";",
"hiddenTag",
".",
"doEndTag",
"(",
"results",
")",
";",
"}"
] |
Write a hidden field for a paramter
@param paramName The name of the parameter
@param paramValue The value of the paramter
@param results The InternalStringBuilder to append the result to
@param req THe servlet request
|
[
"Write",
"a",
"hidden",
"field",
"for",
"a",
"paramter"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L864-L879
|
146,939
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java
|
FileUtils.uriEndsWith
|
public static boolean uriEndsWith( String uri, String ending )
{
int queryStart = uri.indexOf( '?' );
if ( queryStart == -1 )
{
return uri.endsWith( ending );
}
else
{
return uri.length() - queryStart >= ending.length()
&& uri.substring( queryStart - ending.length(), queryStart ).equals( ending );
}
}
|
java
|
public static boolean uriEndsWith( String uri, String ending )
{
int queryStart = uri.indexOf( '?' );
if ( queryStart == -1 )
{
return uri.endsWith( ending );
}
else
{
return uri.length() - queryStart >= ending.length()
&& uri.substring( queryStart - ending.length(), queryStart ).equals( ending );
}
}
|
[
"public",
"static",
"boolean",
"uriEndsWith",
"(",
"String",
"uri",
",",
"String",
"ending",
")",
"{",
"int",
"queryStart",
"=",
"uri",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"queryStart",
"==",
"-",
"1",
")",
"{",
"return",
"uri",
".",
"endsWith",
"(",
"ending",
")",
";",
"}",
"else",
"{",
"return",
"uri",
".",
"length",
"(",
")",
"-",
"queryStart",
">=",
"ending",
".",
"length",
"(",
")",
"&&",
"uri",
".",
"substring",
"(",
"queryStart",
"-",
"ending",
".",
"length",
"(",
")",
",",
"queryStart",
")",
".",
"equals",
"(",
"ending",
")",
";",
"}",
"}"
] |
Tell whether a URI ends in a given String.
|
[
"Tell",
"whether",
"a",
"URI",
"ends",
"in",
"a",
"given",
"String",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java#L61-L74
|
146,940
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java
|
FileUtils.getFileExtension
|
public static String getFileExtension( String filename )
{
int lastDot = filename.lastIndexOf( '.' );
return lastDot != -1 ? filename.substring( lastDot + 1 ) : "";
}
|
java
|
public static String getFileExtension( String filename )
{
int lastDot = filename.lastIndexOf( '.' );
return lastDot != -1 ? filename.substring( lastDot + 1 ) : "";
}
|
[
"public",
"static",
"String",
"getFileExtension",
"(",
"String",
"filename",
")",
"{",
"int",
"lastDot",
"=",
"filename",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"lastDot",
"!=",
"-",
"1",
"?",
"filename",
".",
"substring",
"(",
"lastDot",
"+",
"1",
")",
":",
"\"\"",
";",
"}"
] |
Get the file extension from a file name.
@param filename the file name.
@return the file extension (everything after the last '.'), or the empty string if there is no
file extension.
|
[
"Get",
"the",
"file",
"extension",
"from",
"a",
"file",
"name",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java#L83-L87
|
146,941
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java
|
FileUtils.osSensitiveEquals
|
public static boolean osSensitiveEquals( String s1, String s2 )
{
if ( OS_CASE_SENSITIVE )
{
return s1.equals( s2 );
}
else
{
return s1.equalsIgnoreCase( s2 );
}
}
|
java
|
public static boolean osSensitiveEquals( String s1, String s2 )
{
if ( OS_CASE_SENSITIVE )
{
return s1.equals( s2 );
}
else
{
return s1.equalsIgnoreCase( s2 );
}
}
|
[
"public",
"static",
"boolean",
"osSensitiveEquals",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"OS_CASE_SENSITIVE",
")",
"{",
"return",
"s1",
".",
"equals",
"(",
"s2",
")",
";",
"}",
"else",
"{",
"return",
"s1",
".",
"equalsIgnoreCase",
"(",
"s2",
")",
";",
"}",
"}"
] |
Compare two strings, with case sensitivity determined by the operating system.
@param s1 the first String to compare.
@param s2 the second String to compare.
@return <code>true</code> when:
<ul>
<li>the strings match exactly (including case), or,</li>
<li>the operating system is not case-sensitive with regard to file names, and the strings match,
ignoring case.</li>
</ul>
@see #isOSCaseSensitive()
|
[
"Compare",
"two",
"strings",
"with",
"case",
"sensitivity",
"determined",
"by",
"the",
"operating",
"system",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java#L116-L126
|
146,942
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java
|
FileUtils.osSensitiveEndsWith
|
public static boolean osSensitiveEndsWith( String str, String suffix )
{
if ( OS_CASE_SENSITIVE )
{
return str.endsWith( suffix );
}
else
{
int strLen = str.length();
int suffixLen = suffix.length();
if ( strLen < suffixLen )
{
return false;
}
return ( str.substring( strLen - suffixLen ).equalsIgnoreCase( suffix ) );
}
}
|
java
|
public static boolean osSensitiveEndsWith( String str, String suffix )
{
if ( OS_CASE_SENSITIVE )
{
return str.endsWith( suffix );
}
else
{
int strLen = str.length();
int suffixLen = suffix.length();
if ( strLen < suffixLen )
{
return false;
}
return ( str.substring( strLen - suffixLen ).equalsIgnoreCase( suffix ) );
}
}
|
[
"public",
"static",
"boolean",
"osSensitiveEndsWith",
"(",
"String",
"str",
",",
"String",
"suffix",
")",
"{",
"if",
"(",
"OS_CASE_SENSITIVE",
")",
"{",
"return",
"str",
".",
"endsWith",
"(",
"suffix",
")",
";",
"}",
"else",
"{",
"int",
"strLen",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"suffixLen",
"=",
"suffix",
".",
"length",
"(",
")",
";",
"if",
"(",
"strLen",
"<",
"suffixLen",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"str",
".",
"substring",
"(",
"strLen",
"-",
"suffixLen",
")",
".",
"equalsIgnoreCase",
"(",
"suffix",
")",
")",
";",
"}",
"}"
] |
Tell whether a string ends with a particular suffix, with case sensitivity determined by the operating system.
@param str the String to test.
@param suffix the suffix to look for.
@return <code>true</code> when:
<ul>
<li><code>str</code> ends with <code>suffix</code>, or,</li>
<li>the operating system is not case-sensitive with regard to file names, and <code>str</code> ends with
<code>suffix</code>, ignoring case.</li>
</ul>
@see #isOSCaseSensitive()
|
[
"Tell",
"whether",
"a",
"string",
"ends",
"with",
"a",
"particular",
"suffix",
"with",
"case",
"sensitivity",
"determined",
"by",
"the",
"operating",
"system",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/FileUtils.java#L141-L159
|
146,943
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/rendering/AnchorTag.java
|
AnchorTag.add
|
public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
{
html.put(ANCHOR_TAG, new Rendering());
htmlQuirks.put(ANCHOR_TAG, new Rendering());
xhtml.put(ANCHOR_TAG, new Rendering());
}
|
java
|
public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
{
html.put(ANCHOR_TAG, new Rendering());
htmlQuirks.put(ANCHOR_TAG, new Rendering());
xhtml.put(ANCHOR_TAG, new Rendering());
}
|
[
"public",
"static",
"void",
"add",
"(",
"HashMap",
"html",
",",
"HashMap",
"htmlQuirks",
",",
"HashMap",
"xhtml",
")",
"{",
"html",
".",
"put",
"(",
"ANCHOR_TAG",
",",
"new",
"Rendering",
"(",
")",
")",
";",
"htmlQuirks",
".",
"put",
"(",
"ANCHOR_TAG",
",",
"new",
"Rendering",
"(",
")",
")",
";",
"xhtml",
".",
"put",
"(",
"ANCHOR_TAG",
",",
"new",
"Rendering",
"(",
")",
")",
";",
"}"
] |
Add the Renderer for the HTML and XHTML tokens.
@param html The map of HTML Tag Renderers
@param xhtml The map of XHTML Tag Renderers
|
[
"Add",
"the",
"Renderer",
"for",
"the",
"HTML",
"and",
"XHTML",
"tokens",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/rendering/AnchorTag.java#L36-L41
|
146,944
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptAnnotationHelper.java
|
AptAnnotationHelper.getElementDeclaration
|
public AnnotationTypeElementDeclaration getElementDeclaration(String elemName)
{
if (_elementMap.containsKey(elemName))
return _elementMap.get(elemName);
return null;
}
|
java
|
public AnnotationTypeElementDeclaration getElementDeclaration(String elemName)
{
if (_elementMap.containsKey(elemName))
return _elementMap.get(elemName);
return null;
}
|
[
"public",
"AnnotationTypeElementDeclaration",
"getElementDeclaration",
"(",
"String",
"elemName",
")",
"{",
"if",
"(",
"_elementMap",
".",
"containsKey",
"(",
"elemName",
")",
")",
"return",
"_elementMap",
".",
"get",
"(",
"elemName",
")",
";",
"return",
"null",
";",
"}"
] |
Returns the AnnotationTypeElementDeclaration for a particular element
|
[
"Returns",
"the",
"AnnotationTypeElementDeclaration",
"for",
"a",
"particular",
"element"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptAnnotationHelper.java#L56-L61
|
146,945
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptAnnotationHelper.java
|
AptAnnotationHelper.getStringValue
|
public String getStringValue(String elemName)
{
if (_valueMap.containsKey(elemName))
return _valueMap.get(elemName).toString();
return null;
}
|
java
|
public String getStringValue(String elemName)
{
if (_valueMap.containsKey(elemName))
return _valueMap.get(elemName).toString();
return null;
}
|
[
"public",
"String",
"getStringValue",
"(",
"String",
"elemName",
")",
"{",
"if",
"(",
"_valueMap",
".",
"containsKey",
"(",
"elemName",
")",
")",
"return",
"_valueMap",
".",
"get",
"(",
"elemName",
")",
".",
"toString",
"(",
")",
";",
"return",
"null",
";",
"}"
] |
Returns the value of a particular element as a String
|
[
"Returns",
"the",
"value",
"of",
"a",
"particular",
"element",
"as",
"a",
"String"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptAnnotationHelper.java#L66-L71
|
146,946
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptAnnotationHelper.java
|
AptAnnotationHelper.getObjectValue
|
public Object getObjectValue(String elemName)
{
if (_valueMap.containsKey(elemName))
return _valueMap.get(elemName).getValue();
return null;
}
|
java
|
public Object getObjectValue(String elemName)
{
if (_valueMap.containsKey(elemName))
return _valueMap.get(elemName).getValue();
return null;
}
|
[
"public",
"Object",
"getObjectValue",
"(",
"String",
"elemName",
")",
"{",
"if",
"(",
"_valueMap",
".",
"containsKey",
"(",
"elemName",
")",
")",
"return",
"_valueMap",
".",
"get",
"(",
"elemName",
")",
".",
"getValue",
"(",
")",
";",
"return",
"null",
";",
"}"
] |
Returns the value of a particular element as an Object
|
[
"Returns",
"the",
"value",
"of",
"a",
"particular",
"element",
"as",
"an",
"Object"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptAnnotationHelper.java#L76-L81
|
146,947
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/nikefs2/NikeFS2BlockProvider.java
|
NikeFS2BlockProvider.allocateBlock
|
public synchronized NikeFS2Block allocateBlock() {
// look for free block, i.e. first block whose index
// bit is set to true in the allocation map.
int freeBlockIndex = blockAllocationMap.nextSetBit(0);
if(freeBlockIndex < 0) {
// no free blocks left in this provider.
return null;
} else {
// set index bit to false in allocation map,
// and return in block wrapper.
blockAllocationMap.set(freeBlockIndex, false);
return new NikeFS2Block(this, freeBlockIndex);
}
}
|
java
|
public synchronized NikeFS2Block allocateBlock() {
// look for free block, i.e. first block whose index
// bit is set to true in the allocation map.
int freeBlockIndex = blockAllocationMap.nextSetBit(0);
if(freeBlockIndex < 0) {
// no free blocks left in this provider.
return null;
} else {
// set index bit to false in allocation map,
// and return in block wrapper.
blockAllocationMap.set(freeBlockIndex, false);
return new NikeFS2Block(this, freeBlockIndex);
}
}
|
[
"public",
"synchronized",
"NikeFS2Block",
"allocateBlock",
"(",
")",
"{",
"// look for free block, i.e. first block whose index",
"// bit is set to true in the allocation map.",
"int",
"freeBlockIndex",
"=",
"blockAllocationMap",
".",
"nextSetBit",
"(",
"0",
")",
";",
"if",
"(",
"freeBlockIndex",
"<",
"0",
")",
"{",
"// no free blocks left in this provider.",
"return",
"null",
";",
"}",
"else",
"{",
"// set index bit to false in allocation map,",
"// and return in block wrapper.",
"blockAllocationMap",
".",
"set",
"(",
"freeBlockIndex",
",",
"false",
")",
";",
"return",
"new",
"NikeFS2Block",
"(",
"this",
",",
"freeBlockIndex",
")",
";",
"}",
"}"
] |
Allocates a new block from this block provider.
@return A newly allocated block from this provider.
May return <code>null</code>, if no free blocks are
currently available.
|
[
"Allocates",
"a",
"new",
"block",
"from",
"this",
"block",
"provider",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2BlockProvider.java#L189-L202
|
146,948
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setOnMouseUp
|
public void setOnMouseUp(String onMouseUp) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp);
}
|
java
|
public void setOnMouseUp(String onMouseUp) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp);
}
|
[
"public",
"void",
"setOnMouseUp",
"(",
"String",
"onMouseUp",
")",
"{",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEUP",
",",
"onMouseUp",
")",
";",
"}"
] |
Sets the onMouseUp JavaScript event for the HTML tbody tag.
@param onMouseUp the onMouseUp event.
@jsptagref.attributedescription The onMouseUp JavaScript event for the HTML tbody tag.
@jsptagref.attributesyntaxvalue <i>string_onMouseUp</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event for the HTML tbody tag."
|
[
"Sets",
"the",
"onMouseUp",
"JavaScript",
"event",
"for",
"the",
"HTML",
"tbody",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L211-L213
|
146,949
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setOnMouseMove
|
public void setOnMouseMove(String onMouseMove) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove);
}
|
java
|
public void setOnMouseMove(String onMouseMove) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove);
}
|
[
"public",
"void",
"setOnMouseMove",
"(",
"String",
"onMouseMove",
")",
"{",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEMOVE",
",",
"onMouseMove",
")",
";",
"}"
] |
Sets the onMouseMove JavaScript event for the HTML tbody tag.
@param onMouseMove the onMouseMove event.
@jsptagref.attributedescription The onMouseMove JavaScript event for the HTML tbody tag.
@jsptagref.attributesyntaxvalue <i>string_onMouseMove</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event for the HTML tbody tag."
|
[
"Sets",
"the",
"onMouseMove",
"JavaScript",
"event",
"for",
"the",
"HTML",
"tbody",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L223-L225
|
146,950
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setOnMouseOut
|
public void setOnMouseOut(String onMouseOut) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut);
}
|
java
|
public void setOnMouseOut(String onMouseOut) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut);
}
|
[
"public",
"void",
"setOnMouseOut",
"(",
"String",
"onMouseOut",
")",
"{",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEOUT",
",",
"onMouseOut",
")",
";",
"}"
] |
Sets the onMouseOut JavaScript event for the HTML tbody tag.
@param onMouseOut the onMouseOut event.
@jsptagref.attributedescription The onMouseOut JavaScript event for the HTML tbody tag.
@jsptagref.attributesyntaxvalue <i>string_onMouseOut</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event for the HTML tbody tag."
|
[
"Sets",
"the",
"onMouseOut",
"JavaScript",
"event",
"for",
"the",
"HTML",
"tbody",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L235-L237
|
146,951
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setOnMouseOver
|
public void setOnMouseOver(String onMouseOver) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver);
}
|
java
|
public void setOnMouseOver(String onMouseOver) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver);
}
|
[
"public",
"void",
"setOnMouseOver",
"(",
"String",
"onMouseOver",
")",
"{",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEOVER",
",",
"onMouseOver",
")",
";",
"}"
] |
Sets the onMouseOver JavaScript event for the HTML tbody tag.
@param onMouseOver the onMouseOver event.
@jsptagref.attributedescription The onMouseOver JavaScript event for the HTML tbody tag.
@jsptagref.attributesyntaxvalue <i>string_onMouseOver</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event for the HTML tbody tag."
|
[
"Sets",
"the",
"onMouseOver",
"JavaScript",
"event",
"for",
"the",
"HTML",
"tbody",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L247-L249
|
146,952
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setAlign
|
public void setAlign(String align) {
/* todo: should this enforce left|center|right|justify|char as in the spec */
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align);
}
|
java
|
public void setAlign(String align) {
/* todo: should this enforce left|center|right|justify|char as in the spec */
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align);
}
|
[
"public",
"void",
"setAlign",
"(",
"String",
"align",
")",
"{",
"/* todo: should this enforce left|center|right|justify|char as in the spec */",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"ALIGN",
",",
"align",
")",
";",
"}"
] |
Sets the value of the horizontal alignment attribute of the HTML tbody tag.
@param align the horizontal alignment
@jsptagref.attributedescription The horizontal alignment of the HTML tbody tag.
@jsptagref.attributesyntaxvalue <i>string_align</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's horizontal alignment of the HTML tbody tag."
|
[
"Sets",
"the",
"value",
"of",
"the",
"horizontal",
"alignment",
"attribute",
"of",
"the",
"HTML",
"tbody",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L299-L302
|
146,953
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setCharoff
|
public void setCharoff(String alignCharOff) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAROFF, alignCharOff);
}
|
java
|
public void setCharoff(String alignCharOff) {
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAROFF, alignCharOff);
}
|
[
"public",
"void",
"setCharoff",
"(",
"String",
"alignCharOff",
")",
"{",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"CHAROFF",
",",
"alignCharOff",
")",
";",
"}"
] |
Sets the value of the horizontal alignment character offset attribute.
@param alignCharOff
@jsptagref.attributedescription The horizontal alignment character offset
@jsptagref.attributesyntaxvalue <i>string_alignCharOff</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's horizontal alignment character offset"
|
[
"Sets",
"the",
"value",
"of",
"the",
"horizontal",
"alignment",
"character",
"offset",
"attribute",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L324-L326
|
146,954
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
|
Rows.setValign
|
public void setValign(String align) {
/* todo: should this enforce top|middle|bottom|baseline as in the spec */
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VALIGN, align);
}
|
java
|
public void setValign(String align) {
/* todo: should this enforce top|middle|bottom|baseline as in the spec */
_tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VALIGN, align);
}
|
[
"public",
"void",
"setValign",
"(",
"String",
"align",
")",
"{",
"/* todo: should this enforce top|middle|bottom|baseline as in the spec */",
"_tbodyTag",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"VALIGN",
",",
"align",
")",
";",
"}"
] |
Sets the value of the vertical alignment attribute of the HTML tbody tag.
@param align the alignment
@jsptagref.attributedescription The vertical alignment.
@jsptagref.attributesyntaxvalue <i>string_align</i>
@netui:attribute required="false" rtexprvalue="true" description="The vertical alignment of the HTML tbody tag"
|
[
"Sets",
"the",
"value",
"of",
"the",
"vertical",
"alignment",
"attribute",
"of",
"the",
"HTML",
"tbody",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java#L336-L339
|
146,955
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Tools.java
|
Tools.isInteger
|
public static boolean isInteger(String number) {
boolean result = false;
try {
Integer.parseInt(number);
result = true;
} catch (NumberFormatException e) {
}
return result;
}
|
java
|
public static boolean isInteger(String number) {
boolean result = false;
try {
Integer.parseInt(number);
result = true;
} catch (NumberFormatException e) {
}
return result;
}
|
[
"public",
"static",
"boolean",
"isInteger",
"(",
"String",
"number",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"Integer",
".",
"parseInt",
"(",
"number",
")",
";",
"result",
"=",
"true",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"}",
"return",
"result",
";",
"}"
] |
Checks if a string is a valid integer
@param number The string to check
@return True if the string is a valid integer else false.
|
[
"Checks",
"if",
"a",
"string",
"is",
"a",
"valid",
"integer"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Tools.java#L41-L49
|
146,956
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Tools.java
|
Tools.isLong
|
public static boolean isLong(String number) {
boolean result = false;
try {
Long.parseLong(number);
result = true;
} catch (NumberFormatException e) {
}
return result;
}
|
java
|
public static boolean isLong(String number) {
boolean result = false;
try {
Long.parseLong(number);
result = true;
} catch (NumberFormatException e) {
}
return result;
}
|
[
"public",
"static",
"boolean",
"isLong",
"(",
"String",
"number",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"Long",
".",
"parseLong",
"(",
"number",
")",
";",
"result",
"=",
"true",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"}",
"return",
"result",
";",
"}"
] |
Checks if a string is a valid long
@param number The string to check
@return True if the string is a valid long else false.
|
[
"Checks",
"if",
"a",
"string",
"is",
"a",
"valid",
"long"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Tools.java#L57-L65
|
146,957
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Tools.java
|
Tools.isDouble
|
public static boolean isDouble(String number) {
boolean result = false;
if (number != null) {
try {
Double.parseDouble(number);
result = true;
} catch (NumberFormatException e) {
}
}
return result;
}
|
java
|
public static boolean isDouble(String number) {
boolean result = false;
if (number != null) {
try {
Double.parseDouble(number);
result = true;
} catch (NumberFormatException e) {
}
}
return result;
}
|
[
"public",
"static",
"boolean",
"isDouble",
"(",
"String",
"number",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"number",
"!=",
"null",
")",
"{",
"try",
"{",
"Double",
".",
"parseDouble",
"(",
"number",
")",
";",
"result",
"=",
"true",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"}",
"}",
"return",
"result",
";",
"}"
] |
Checks if a string is a valid Double
@param number The string to check.
@return True if the string is a valid double else false.
|
[
"Checks",
"if",
"a",
"string",
"is",
"a",
"valid",
"Double"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Tools.java#L73-L83
|
146,958
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Tools.java
|
Tools.isBoolean
|
public static boolean isBoolean(String number) {
boolean result = false;
if (number != null && (number.equalsIgnoreCase("true") || number.equalsIgnoreCase("false"))) {
result = true;
}
return result;
}
|
java
|
public static boolean isBoolean(String number) {
boolean result = false;
if (number != null && (number.equalsIgnoreCase("true") || number.equalsIgnoreCase("false"))) {
result = true;
}
return result;
}
|
[
"public",
"static",
"boolean",
"isBoolean",
"(",
"String",
"number",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"number",
"!=",
"null",
"&&",
"(",
"number",
".",
"equalsIgnoreCase",
"(",
"\"true\"",
")",
"||",
"number",
".",
"equalsIgnoreCase",
"(",
"\"false\"",
")",
")",
")",
"{",
"result",
"=",
"true",
";",
"}",
"return",
"result",
";",
"}"
] |
Checks if a string is a valid boolean
@param number The string to check
@return True if the string is equals to either true or false . Else false.
|
[
"Checks",
"if",
"a",
"string",
"is",
"a",
"valid",
"boolean"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Tools.java#L91-L97
|
146,959
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Tools.java
|
Tools.isValidDouble
|
public static boolean isValidDouble(String number) {
boolean valid = false;
if (isDouble(number) && isPositive(Double.parseDouble(number))) {
valid = true;
}
return valid;
}
|
java
|
public static boolean isValidDouble(String number) {
boolean valid = false;
if (isDouble(number) && isPositive(Double.parseDouble(number))) {
valid = true;
}
return valid;
}
|
[
"public",
"static",
"boolean",
"isValidDouble",
"(",
"String",
"number",
")",
"{",
"boolean",
"valid",
"=",
"false",
";",
"if",
"(",
"isDouble",
"(",
"number",
")",
"&&",
"isPositive",
"(",
"Double",
".",
"parseDouble",
"(",
"number",
")",
")",
")",
"{",
"valid",
"=",
"true",
";",
"}",
"return",
"valid",
";",
"}"
] |
Checks if a string is a valid double.
@param number The string to check
@return True if the number is a valid double (positive) else false.
|
[
"Checks",
"if",
"a",
"string",
"is",
"a",
"valid",
"double",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Tools.java#L105-L111
|
146,960
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.getScopedRequest
|
public static ScopedRequest getScopedRequest( HttpServletRequest realRequest, String overrideURI,
ServletContext servletContext, Object scopeKey,
boolean seeOuterRequestAttributes )
{
assert ! ( realRequest instanceof ScopedRequest );
String requestAttr = getScopedName( OVERRIDE_REQUEST_ATTR, scopeKey );
ScopedRequest scopedRequest = ( ScopedRequest ) realRequest.getAttribute( requestAttr );
//
// If it doesn't exist, create it and cache it.
//
if ( scopedRequest == null )
{
//
// The override URI must start with a slash -- it's webapp-relative.
//
if ( overrideURI != null && ! overrideURI.startsWith( "/" ) ) overrideURI = '/' + overrideURI;
scopedRequest =
new ScopedRequestImpl( realRequest, overrideURI, scopeKey, servletContext, seeOuterRequestAttributes );
realRequest.setAttribute( requestAttr, scopedRequest );
}
return scopedRequest;
}
|
java
|
public static ScopedRequest getScopedRequest( HttpServletRequest realRequest, String overrideURI,
ServletContext servletContext, Object scopeKey,
boolean seeOuterRequestAttributes )
{
assert ! ( realRequest instanceof ScopedRequest );
String requestAttr = getScopedName( OVERRIDE_REQUEST_ATTR, scopeKey );
ScopedRequest scopedRequest = ( ScopedRequest ) realRequest.getAttribute( requestAttr );
//
// If it doesn't exist, create it and cache it.
//
if ( scopedRequest == null )
{
//
// The override URI must start with a slash -- it's webapp-relative.
//
if ( overrideURI != null && ! overrideURI.startsWith( "/" ) ) overrideURI = '/' + overrideURI;
scopedRequest =
new ScopedRequestImpl( realRequest, overrideURI, scopeKey, servletContext, seeOuterRequestAttributes );
realRequest.setAttribute( requestAttr, scopedRequest );
}
return scopedRequest;
}
|
[
"public",
"static",
"ScopedRequest",
"getScopedRequest",
"(",
"HttpServletRequest",
"realRequest",
",",
"String",
"overrideURI",
",",
"ServletContext",
"servletContext",
",",
"Object",
"scopeKey",
",",
"boolean",
"seeOuterRequestAttributes",
")",
"{",
"assert",
"!",
"(",
"realRequest",
"instanceof",
"ScopedRequest",
")",
";",
"String",
"requestAttr",
"=",
"getScopedName",
"(",
"OVERRIDE_REQUEST_ATTR",
",",
"scopeKey",
")",
";",
"ScopedRequest",
"scopedRequest",
"=",
"(",
"ScopedRequest",
")",
"realRequest",
".",
"getAttribute",
"(",
"requestAttr",
")",
";",
"//",
"// If it doesn't exist, create it and cache it.",
"//",
"if",
"(",
"scopedRequest",
"==",
"null",
")",
"{",
"//",
"// The override URI must start with a slash -- it's webapp-relative.",
"//",
"if",
"(",
"overrideURI",
"!=",
"null",
"&&",
"!",
"overrideURI",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"overrideURI",
"=",
"'",
"'",
"+",
"overrideURI",
";",
"scopedRequest",
"=",
"new",
"ScopedRequestImpl",
"(",
"realRequest",
",",
"overrideURI",
",",
"scopeKey",
",",
"servletContext",
",",
"seeOuterRequestAttributes",
")",
";",
"realRequest",
".",
"setAttribute",
"(",
"requestAttr",
",",
"scopedRequest",
")",
";",
"}",
"return",
"scopedRequest",
";",
"}"
] |
Get the cached ScopedRequest wrapper. If none exists, creates one and caches it.
@param realRequest the "real" (outer) HttpServletRequest, which will be wrapped.
@param overrideURI the request-URI for the wrapped object. This URI must begin with the context path.
@param servletContext the current ServletContext.
@param scopeKey the scope-key associated with the new (or looked-up) scoped request.
@param seeOuterRequestAttributes if <code>true</code>, a request attribute will be "seen" in the outer request,
if it is not found within the scoped request; if <code>false</code>, attributes are only seen when
they are present in the scoped request.
@return the cached (or newly-created) ScopedRequest.
|
[
"Get",
"the",
"cached",
"ScopedRequest",
"wrapper",
".",
"If",
"none",
"exists",
"creates",
"one",
"and",
"caches",
"it",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L83-L108
|
146,961
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.getScopedResponse
|
public static ScopedResponse getScopedResponse( HttpServletResponse realResponse,
ScopedRequest scopedRequest )
{
assert ! ( realResponse instanceof ScopedResponse );
String responseAttr = getScopedName( OVERRIDE_RESPONSE_ATTR,
scopedRequest.getScopeKey() );
HttpServletRequest outerRequest = scopedRequest.getOuterRequest();
ScopedResponse scopedResponse = ( ScopedResponse ) outerRequest.getAttribute( responseAttr );
//
// If it doesn't exist, create it and cache it.
//
if ( scopedResponse == null )
{
scopedResponse = new ScopedResponseImpl( realResponse );
outerRequest.setAttribute( responseAttr, scopedResponse );
}
return scopedResponse;
}
|
java
|
public static ScopedResponse getScopedResponse( HttpServletResponse realResponse,
ScopedRequest scopedRequest )
{
assert ! ( realResponse instanceof ScopedResponse );
String responseAttr = getScopedName( OVERRIDE_RESPONSE_ATTR,
scopedRequest.getScopeKey() );
HttpServletRequest outerRequest = scopedRequest.getOuterRequest();
ScopedResponse scopedResponse = ( ScopedResponse ) outerRequest.getAttribute( responseAttr );
//
// If it doesn't exist, create it and cache it.
//
if ( scopedResponse == null )
{
scopedResponse = new ScopedResponseImpl( realResponse );
outerRequest.setAttribute( responseAttr, scopedResponse );
}
return scopedResponse;
}
|
[
"public",
"static",
"ScopedResponse",
"getScopedResponse",
"(",
"HttpServletResponse",
"realResponse",
",",
"ScopedRequest",
"scopedRequest",
")",
"{",
"assert",
"!",
"(",
"realResponse",
"instanceof",
"ScopedResponse",
")",
";",
"String",
"responseAttr",
"=",
"getScopedName",
"(",
"OVERRIDE_RESPONSE_ATTR",
",",
"scopedRequest",
".",
"getScopeKey",
"(",
")",
")",
";",
"HttpServletRequest",
"outerRequest",
"=",
"scopedRequest",
".",
"getOuterRequest",
"(",
")",
";",
"ScopedResponse",
"scopedResponse",
"=",
"(",
"ScopedResponse",
")",
"outerRequest",
".",
"getAttribute",
"(",
"responseAttr",
")",
";",
"//",
"// If it doesn't exist, create it and cache it.",
"//",
"if",
"(",
"scopedResponse",
"==",
"null",
")",
"{",
"scopedResponse",
"=",
"new",
"ScopedResponseImpl",
"(",
"realResponse",
")",
";",
"outerRequest",
".",
"setAttribute",
"(",
"responseAttr",
",",
"scopedResponse",
")",
";",
"}",
"return",
"scopedResponse",
";",
"}"
] |
Get the cached wrapper servlet response. If none exists, creates one and caches it.
@param realResponse the "real" (outer) ServletResponse, which will be wrapped.
@param scopedRequest the ScopedRequest returned from {@link #getScopedRequest}.
@return the cached (or newly-created) ScopedResponse.
|
[
"Get",
"the",
"cached",
"wrapper",
"servlet",
"response",
".",
"If",
"none",
"exists",
"creates",
"one",
"and",
"caches",
"it",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L117-L137
|
146,962
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.unwrapRequest
|
public static ScopedRequest unwrapRequest( ServletRequest request )
{
// Unwrap the multipart request, if there is one.
if ( request instanceof MultipartRequestWrapper )
{
request = ( ( MultipartRequestWrapper ) request ).getRequest();
}
while ( request instanceof ServletRequestWrapper )
{
if ( request instanceof ScopedRequest )
{
return ( ScopedRequest ) request;
}
else
{
request = ( ( ServletRequestWrapper ) request ).getRequest();
}
}
return null;
}
|
java
|
public static ScopedRequest unwrapRequest( ServletRequest request )
{
// Unwrap the multipart request, if there is one.
if ( request instanceof MultipartRequestWrapper )
{
request = ( ( MultipartRequestWrapper ) request ).getRequest();
}
while ( request instanceof ServletRequestWrapper )
{
if ( request instanceof ScopedRequest )
{
return ( ScopedRequest ) request;
}
else
{
request = ( ( ServletRequestWrapper ) request ).getRequest();
}
}
return null;
}
|
[
"public",
"static",
"ScopedRequest",
"unwrapRequest",
"(",
"ServletRequest",
"request",
")",
"{",
"// Unwrap the multipart request, if there is one.",
"if",
"(",
"request",
"instanceof",
"MultipartRequestWrapper",
")",
"{",
"request",
"=",
"(",
"(",
"MultipartRequestWrapper",
")",
"request",
")",
".",
"getRequest",
"(",
")",
";",
"}",
"while",
"(",
"request",
"instanceof",
"ServletRequestWrapper",
")",
"{",
"if",
"(",
"request",
"instanceof",
"ScopedRequest",
")",
"{",
"return",
"(",
"ScopedRequest",
")",
"request",
";",
"}",
"else",
"{",
"request",
"=",
"(",
"(",
"ServletRequestWrapper",
")",
"request",
")",
".",
"getRequest",
"(",
")",
";",
"}",
"}",
"return",
"null",
";",
"}"
] |
Unwraps the contained ScopedRequest from the given ServletRequest, which may be a
ServletRequestWrapper.
@param request the ScopedRequest, or a wrapper (ServletRequestWrapper) around it.
@return the unwrapped ScopedRequest.
@exclude
|
[
"Unwraps",
"the",
"contained",
"ScopedRequest",
"from",
"the",
"given",
"ServletRequest",
"which",
"may",
"be",
"a",
"ServletRequestWrapper",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L236-L257
|
146,963
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.unwrapResponse
|
public static ScopedResponse unwrapResponse( ServletResponse response )
{
while ( response instanceof ServletResponseWrapper )
{
if ( response instanceof ScopedResponse )
{
return ( ScopedResponse ) response;
}
else
{
response = ( ( ServletResponseWrapper ) response ).getResponse();
}
}
return null;
}
|
java
|
public static ScopedResponse unwrapResponse( ServletResponse response )
{
while ( response instanceof ServletResponseWrapper )
{
if ( response instanceof ScopedResponse )
{
return ( ScopedResponse ) response;
}
else
{
response = ( ( ServletResponseWrapper ) response ).getResponse();
}
}
return null;
}
|
[
"public",
"static",
"ScopedResponse",
"unwrapResponse",
"(",
"ServletResponse",
"response",
")",
"{",
"while",
"(",
"response",
"instanceof",
"ServletResponseWrapper",
")",
"{",
"if",
"(",
"response",
"instanceof",
"ScopedResponse",
")",
"{",
"return",
"(",
"ScopedResponse",
")",
"response",
";",
"}",
"else",
"{",
"response",
"=",
"(",
"(",
"ServletResponseWrapper",
")",
"response",
")",
".",
"getResponse",
"(",
")",
";",
"}",
"}",
"return",
"null",
";",
"}"
] |
Unwraps the contained ScopedResponseImpl from the given ServletResponse, which may be a
ServletResponseWrapper.
@param response the ScopedResponse, or a wrapper (ServletResponseWrapper) around it.
@return the unwrapped ScopedResponseImpl.
@exclude
|
[
"Unwraps",
"the",
"contained",
"ScopedResponseImpl",
"from",
"the",
"given",
"ServletResponse",
"which",
"may",
"be",
"a",
"ServletResponseWrapper",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L268-L283
|
146,964
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.getScopedSessionAttrName
|
public static String getScopedSessionAttrName( String attrName, HttpServletRequest request )
{
String requestScopeParam = request.getParameter( SCOPE_ID_PARAM );
if ( requestScopeParam != null )
{
return getScopedName( attrName, requestScopeParam );
}
ScopedRequest scopedRequest = unwrapRequest( request );
return scopedRequest != null ? scopedRequest.getScopedName( attrName ) : attrName;
}
|
java
|
public static String getScopedSessionAttrName( String attrName, HttpServletRequest request )
{
String requestScopeParam = request.getParameter( SCOPE_ID_PARAM );
if ( requestScopeParam != null )
{
return getScopedName( attrName, requestScopeParam );
}
ScopedRequest scopedRequest = unwrapRequest( request );
return scopedRequest != null ? scopedRequest.getScopedName( attrName ) : attrName;
}
|
[
"public",
"static",
"String",
"getScopedSessionAttrName",
"(",
"String",
"attrName",
",",
"HttpServletRequest",
"request",
")",
"{",
"String",
"requestScopeParam",
"=",
"request",
".",
"getParameter",
"(",
"SCOPE_ID_PARAM",
")",
";",
"if",
"(",
"requestScopeParam",
"!=",
"null",
")",
"{",
"return",
"getScopedName",
"(",
"attrName",
",",
"requestScopeParam",
")",
";",
"}",
"ScopedRequest",
"scopedRequest",
"=",
"unwrapRequest",
"(",
"request",
")",
";",
"return",
"scopedRequest",
"!=",
"null",
"?",
"scopedRequest",
".",
"getScopedName",
"(",
"attrName",
")",
":",
"attrName",
";",
"}"
] |
If the request is a ScopedRequest, this returns an attribute name scoped to
that request's scope-ID; otherwise, it returns the given attribute name.
@exclude
|
[
"If",
"the",
"request",
"is",
"a",
"ScopedRequest",
"this",
"returns",
"an",
"attribute",
"name",
"scoped",
"to",
"that",
"request",
"s",
"scope",
"-",
"ID",
";",
"otherwise",
"it",
"returns",
"the",
"given",
"attribute",
"name",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L291-L302
|
146,965
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.getRelativeURI
|
public static final String getRelativeURI( HttpServletRequest request, String uri )
{
return getRelativeURI( request.getContextPath(), uri );
}
|
java
|
public static final String getRelativeURI( HttpServletRequest request, String uri )
{
return getRelativeURI( request.getContextPath(), uri );
}
|
[
"public",
"static",
"final",
"String",
"getRelativeURI",
"(",
"HttpServletRequest",
"request",
",",
"String",
"uri",
")",
"{",
"return",
"getRelativeURI",
"(",
"request",
".",
"getContextPath",
"(",
")",
",",
"uri",
")",
";",
"}"
] |
Get a URI relative to the webapp root.
@param request the current HttpServletRequest.
@param uri the URI which should be made relative.
|
[
"Get",
"a",
"URI",
"relative",
"to",
"the",
"webapp",
"root",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L384-L387
|
146,966
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.getRelativeURI
|
public static final String getRelativeURI( String contextPath, String uri )
{
String requestUrl = uri;
int overlap = requestUrl.indexOf( contextPath + '/' );
assert overlap != -1 : "contextPath: " + contextPath + ", uri: " + uri;
return requestUrl.substring( overlap + contextPath.length() );
}
|
java
|
public static final String getRelativeURI( String contextPath, String uri )
{
String requestUrl = uri;
int overlap = requestUrl.indexOf( contextPath + '/' );
assert overlap != -1 : "contextPath: " + contextPath + ", uri: " + uri;
return requestUrl.substring( overlap + contextPath.length() );
}
|
[
"public",
"static",
"final",
"String",
"getRelativeURI",
"(",
"String",
"contextPath",
",",
"String",
"uri",
")",
"{",
"String",
"requestUrl",
"=",
"uri",
";",
"int",
"overlap",
"=",
"requestUrl",
".",
"indexOf",
"(",
"contextPath",
"+",
"'",
"'",
")",
";",
"assert",
"overlap",
"!=",
"-",
"1",
":",
"\"contextPath: \"",
"+",
"contextPath",
"+",
"\", uri: \"",
"+",
"uri",
";",
"return",
"requestUrl",
".",
"substring",
"(",
"overlap",
"+",
"contextPath",
".",
"length",
"(",
")",
")",
";",
"}"
] |
Get a URI relative to a given webapp root.
@param contextPath the webapp context path, e.g., "/myWebapp"
@param uri the URI which should be made relative.
|
[
"Get",
"a",
"URI",
"relative",
"to",
"a",
"given",
"webapp",
"root",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L395-L401
|
146,967
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
|
ScopedServletUtils.normalizeURI
|
public static String normalizeURI( String uri )
{
//
// If it's a relative URI, normalize it. Note that we don't want to create a URI
// (very expensive) unless we think we'll need to. "./" catches "../" and "./".
//
if ( uri.indexOf( "./" ) != -1 )
{
try
{
uri = new URI( uri ).normalize().toString();
}
catch ( URISyntaxException e )
{
logger.error( "Could not parse relative URI " + uri );
}
}
return uri;
}
|
java
|
public static String normalizeURI( String uri )
{
//
// If it's a relative URI, normalize it. Note that we don't want to create a URI
// (very expensive) unless we think we'll need to. "./" catches "../" and "./".
//
if ( uri.indexOf( "./" ) != -1 )
{
try
{
uri = new URI( uri ).normalize().toString();
}
catch ( URISyntaxException e )
{
logger.error( "Could not parse relative URI " + uri );
}
}
return uri;
}
|
[
"public",
"static",
"String",
"normalizeURI",
"(",
"String",
"uri",
")",
"{",
"//",
"// If it's a relative URI, normalize it. Note that we don't want to create a URI",
"// (very expensive) unless we think we'll need to. \"./\" catches \"../\" and \"./\".",
"//",
"if",
"(",
"uri",
".",
"indexOf",
"(",
"\"./\"",
")",
"!=",
"-",
"1",
")",
"{",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"uri",
")",
".",
"normalize",
"(",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Could not parse relative URI \"",
"+",
"uri",
")",
";",
"}",
"}",
"return",
"uri",
";",
"}"
] |
Resolve "." and ".." in a URI.
@exclude
|
[
"Resolve",
".",
"and",
"..",
"in",
"a",
"URI",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L407-L426
|
146,968
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/FormBeanModel.java
|
FormBeanModel.updateProperties
|
public void updateProperties( Collection newProps )
{
_properties = new ArrayList();
if ( newProps != null )
{
_properties.addAll( newProps );
}
}
|
java
|
public void updateProperties( Collection newProps )
{
_properties = new ArrayList();
if ( newProps != null )
{
_properties.addAll( newProps );
}
}
|
[
"public",
"void",
"updateProperties",
"(",
"Collection",
"newProps",
")",
"{",
"_properties",
"=",
"new",
"ArrayList",
"(",
")",
";",
"if",
"(",
"newProps",
"!=",
"null",
")",
"{",
"_properties",
".",
"addAll",
"(",
"newProps",
")",
";",
"}",
"}"
] |
Sets the collection of properties for a form bean to a new collection.
|
[
"Sets",
"the",
"collection",
"of",
"properties",
"for",
"a",
"form",
"bean",
"to",
"a",
"new",
"collection",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/FormBeanModel.java#L209-L217
|
146,969
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/XmlElementSupport.java
|
XmlElementSupport.findChildElement
|
protected final Element findChildElement(XmlModelWriter xw, Element parent, String childName,
String keyAttributeName, String keyAttributeValue,
boolean createIfNotPresent, String[] createOrder)
{
NodeList childNodes = parent.getChildNodes();
for (int i = 0; i < childNodes.getLength(); ++i)
{
Node node = childNodes.item(i);
if (node instanceof Element)
{
Element childElement = (Element) node;
if (childName.equals(childElement.getTagName()))
{
// If there's no target key attribute to match, just return the element.
if (keyAttributeName == null) {
return childElement;
}
// Return the element if the key attribute values match (or if both are null).
String childElementAttributeValue = getElementAttribute(childElement, keyAttributeName);
if ((keyAttributeValue == null && childElementAttributeValue == null)
|| (keyAttributeValue != null && keyAttributeValue.equals(childElementAttributeValue)))
{
return childElement;
}
}
}
}
if (createIfNotPresent)
{
Element newChild = xw.getDocument().createElement(childName);
Node insertBefore = null;
if (createOrder != null) {
for (int i = 0; i < createOrder.length; i++) {
String nodeName = createOrder[i];
if (nodeName.equals(childName)) {
while (++i < createOrder.length) {
insertBefore = findChildElement(xw, parent, createOrder[i], false, null);
if (insertBefore != null) {
break;
}
}
break;
}
}
}
if (insertBefore != null) {
parent.insertBefore(newChild, insertBefore);
} else {
parent.appendChild(newChild);
}
if (keyAttributeName != null && keyAttributeValue != null) {
newChild.setAttribute(keyAttributeName, keyAttributeValue);
}
return newChild;
}
return null;
}
|
java
|
protected final Element findChildElement(XmlModelWriter xw, Element parent, String childName,
String keyAttributeName, String keyAttributeValue,
boolean createIfNotPresent, String[] createOrder)
{
NodeList childNodes = parent.getChildNodes();
for (int i = 0; i < childNodes.getLength(); ++i)
{
Node node = childNodes.item(i);
if (node instanceof Element)
{
Element childElement = (Element) node;
if (childName.equals(childElement.getTagName()))
{
// If there's no target key attribute to match, just return the element.
if (keyAttributeName == null) {
return childElement;
}
// Return the element if the key attribute values match (or if both are null).
String childElementAttributeValue = getElementAttribute(childElement, keyAttributeName);
if ((keyAttributeValue == null && childElementAttributeValue == null)
|| (keyAttributeValue != null && keyAttributeValue.equals(childElementAttributeValue)))
{
return childElement;
}
}
}
}
if (createIfNotPresent)
{
Element newChild = xw.getDocument().createElement(childName);
Node insertBefore = null;
if (createOrder != null) {
for (int i = 0; i < createOrder.length; i++) {
String nodeName = createOrder[i];
if (nodeName.equals(childName)) {
while (++i < createOrder.length) {
insertBefore = findChildElement(xw, parent, createOrder[i], false, null);
if (insertBefore != null) {
break;
}
}
break;
}
}
}
if (insertBefore != null) {
parent.insertBefore(newChild, insertBefore);
} else {
parent.appendChild(newChild);
}
if (keyAttributeName != null && keyAttributeValue != null) {
newChild.setAttribute(keyAttributeName, keyAttributeValue);
}
return newChild;
}
return null;
}
|
[
"protected",
"final",
"Element",
"findChildElement",
"(",
"XmlModelWriter",
"xw",
",",
"Element",
"parent",
",",
"String",
"childName",
",",
"String",
"keyAttributeName",
",",
"String",
"keyAttributeValue",
",",
"boolean",
"createIfNotPresent",
",",
"String",
"[",
"]",
"createOrder",
")",
"{",
"NodeList",
"childNodes",
"=",
"parent",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"childNodes",
".",
"getLength",
"(",
")",
";",
"++",
"i",
")",
"{",
"Node",
"node",
"=",
"childNodes",
".",
"item",
"(",
"i",
")",
";",
"if",
"(",
"node",
"instanceof",
"Element",
")",
"{",
"Element",
"childElement",
"=",
"(",
"Element",
")",
"node",
";",
"if",
"(",
"childName",
".",
"equals",
"(",
"childElement",
".",
"getTagName",
"(",
")",
")",
")",
"{",
"// If there's no target key attribute to match, just return the element.",
"if",
"(",
"keyAttributeName",
"==",
"null",
")",
"{",
"return",
"childElement",
";",
"}",
"// Return the element if the key attribute values match (or if both are null).",
"String",
"childElementAttributeValue",
"=",
"getElementAttribute",
"(",
"childElement",
",",
"keyAttributeName",
")",
";",
"if",
"(",
"(",
"keyAttributeValue",
"==",
"null",
"&&",
"childElementAttributeValue",
"==",
"null",
")",
"||",
"(",
"keyAttributeValue",
"!=",
"null",
"&&",
"keyAttributeValue",
".",
"equals",
"(",
"childElementAttributeValue",
")",
")",
")",
"{",
"return",
"childElement",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"createIfNotPresent",
")",
"{",
"Element",
"newChild",
"=",
"xw",
".",
"getDocument",
"(",
")",
".",
"createElement",
"(",
"childName",
")",
";",
"Node",
"insertBefore",
"=",
"null",
";",
"if",
"(",
"createOrder",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"createOrder",
".",
"length",
";",
"i",
"++",
")",
"{",
"String",
"nodeName",
"=",
"createOrder",
"[",
"i",
"]",
";",
"if",
"(",
"nodeName",
".",
"equals",
"(",
"childName",
")",
")",
"{",
"while",
"(",
"++",
"i",
"<",
"createOrder",
".",
"length",
")",
"{",
"insertBefore",
"=",
"findChildElement",
"(",
"xw",
",",
"parent",
",",
"createOrder",
"[",
"i",
"]",
",",
"false",
",",
"null",
")",
";",
"if",
"(",
"insertBefore",
"!=",
"null",
")",
"{",
"break",
";",
"}",
"}",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"insertBefore",
"!=",
"null",
")",
"{",
"parent",
".",
"insertBefore",
"(",
"newChild",
",",
"insertBefore",
")",
";",
"}",
"else",
"{",
"parent",
".",
"appendChild",
"(",
"newChild",
")",
";",
"}",
"if",
"(",
"keyAttributeName",
"!=",
"null",
"&&",
"keyAttributeValue",
"!=",
"null",
")",
"{",
"newChild",
".",
"setAttribute",
"(",
"keyAttributeName",
",",
"keyAttributeValue",
")",
";",
"}",
"return",
"newChild",
";",
"}",
"return",
"null",
";",
"}"
] |
Find a child element by name, and optionally add it if it isn't present.
@param xw the XmlModelWriter
@param parent the parent element
@param childName the name of the desired child element
@param keyAttributeName the name of a key attribute in the child element by which to restrict the search.
May be <code>null</code>, in which case there is no restriction.
@param keyAttributeValue the value of a key attribute in the child element by which to restrict the search.
Only used if <code>keyAttributeName</code> is not <code>null</code>. This value may be
<code>null</code>, which means that the target node must have a null value.
@param createIfNotPresent if <code>true</code>, the node will be created if it's not present.
@param createOrder an array of Strings that describes the order of insertion. May be <code>null</code>, in
which case a newly-created node is appended to the parent.
@return the node.
|
[
"Find",
"a",
"child",
"element",
"by",
"name",
"and",
"optionally",
"add",
"it",
"if",
"it",
"isn",
"t",
"present",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/XmlElementSupport.java#L154-L220
|
146,970
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/SharedFlowController.java
|
SharedFlowController.getModulePath
|
public String getModulePath()
{
ClassLevelCache cache = ClassLevelCache.getCache( getClass() );
String modulePath = ( String ) cache.getCacheObject( CACHED_INFO_KEY );
if ( modulePath == null )
{
modulePath = "/-";
String className = getClass().getName();
int lastDot = className.lastIndexOf( '.' );
if (lastDot != -1) {
className = className.substring( 0, lastDot );
modulePath += className.replace( '.', '/' );
}
cache.setCacheObject( CACHED_INFO_KEY, modulePath );
}
return modulePath;
}
|
java
|
public String getModulePath()
{
ClassLevelCache cache = ClassLevelCache.getCache( getClass() );
String modulePath = ( String ) cache.getCacheObject( CACHED_INFO_KEY );
if ( modulePath == null )
{
modulePath = "/-";
String className = getClass().getName();
int lastDot = className.lastIndexOf( '.' );
if (lastDot != -1) {
className = className.substring( 0, lastDot );
modulePath += className.replace( '.', '/' );
}
cache.setCacheObject( CACHED_INFO_KEY, modulePath );
}
return modulePath;
}
|
[
"public",
"String",
"getModulePath",
"(",
")",
"{",
"ClassLevelCache",
"cache",
"=",
"ClassLevelCache",
".",
"getCache",
"(",
"getClass",
"(",
")",
")",
";",
"String",
"modulePath",
"=",
"(",
"String",
")",
"cache",
".",
"getCacheObject",
"(",
"CACHED_INFO_KEY",
")",
";",
"if",
"(",
"modulePath",
"==",
"null",
")",
"{",
"modulePath",
"=",
"\"/-\"",
";",
"String",
"className",
"=",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"int",
"lastDot",
"=",
"className",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"lastDot",
"!=",
"-",
"1",
")",
"{",
"className",
"=",
"className",
".",
"substring",
"(",
"0",
",",
"lastDot",
")",
";",
"modulePath",
"+=",
"className",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
"}",
"cache",
".",
"setCacheObject",
"(",
"CACHED_INFO_KEY",
",",
"modulePath",
")",
";",
"}",
"return",
"modulePath",
";",
"}"
] |
Get the Struts module path for actions in this shared flow.
@return the Struts module path for actions in this shared flow.
|
[
"Get",
"the",
"Struts",
"module",
"path",
"for",
"actions",
"in",
"this",
"shared",
"flow",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/SharedFlowController.java#L98-L116
|
146,971
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/SharedFlowController.java
|
SharedFlowController.savePreviousActionInfo
|
void savePreviousActionInfo( ActionForm form, HttpServletRequest request, ActionMapping mapping,
ServletContext servletContext )
{
//
// Save this previous-action info in the *current page flow*.
//
PageFlowController currentJpf = PageFlowUtils.getCurrentPageFlow( request, getServletContext() );
if ( currentJpf != null ) currentJpf.savePreviousActionInfo( form, request, mapping, servletContext );
}
|
java
|
void savePreviousActionInfo( ActionForm form, HttpServletRequest request, ActionMapping mapping,
ServletContext servletContext )
{
//
// Save this previous-action info in the *current page flow*.
//
PageFlowController currentJpf = PageFlowUtils.getCurrentPageFlow( request, getServletContext() );
if ( currentJpf != null ) currentJpf.savePreviousActionInfo( form, request, mapping, servletContext );
}
|
[
"void",
"savePreviousActionInfo",
"(",
"ActionForm",
"form",
",",
"HttpServletRequest",
"request",
",",
"ActionMapping",
"mapping",
",",
"ServletContext",
"servletContext",
")",
"{",
"//",
"// Save this previous-action info in the *current page flow*.",
"//",
"PageFlowController",
"currentJpf",
"=",
"PageFlowUtils",
".",
"getCurrentPageFlow",
"(",
"request",
",",
"getServletContext",
"(",
")",
")",
";",
"if",
"(",
"currentJpf",
"!=",
"null",
")",
"currentJpf",
".",
"savePreviousActionInfo",
"(",
"form",
",",
"request",
",",
"mapping",
",",
"servletContext",
")",
";",
"}"
] |
Store information about the most recent action invocation. This is a framework-invoked method that should not
normally be called directly
|
[
"Store",
"information",
"about",
"the",
"most",
"recent",
"action",
"invocation",
".",
"This",
"is",
"a",
"framework",
"-",
"invoked",
"method",
"that",
"should",
"not",
"normally",
"be",
"called",
"directly"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/SharedFlowController.java#L208-L216
|
146,972
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
|
PageFlowManagedObject.reinitializeIfNecessary
|
void reinitializeIfNecessary(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
{
if (_servletContext == null) {
reinitialize(request, response, servletContext);
}
}
|
java
|
void reinitializeIfNecessary(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
{
if (_servletContext == null) {
reinitialize(request, response, servletContext);
}
}
|
[
"void",
"reinitializeIfNecessary",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"{",
"if",
"(",
"_servletContext",
"==",
"null",
")",
"{",
"reinitialize",
"(",
"request",
",",
"response",
",",
"servletContext",
")",
";",
"}",
"}"
] |
Internal method to reinitialize only if necessary. The test is whether the ServletContext
reference has been lost.
|
[
"Internal",
"method",
"to",
"reinitialize",
"only",
"if",
"necessary",
".",
"The",
"test",
"is",
"whether",
"the",
"ServletContext",
"reference",
"has",
"been",
"lost",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java#L80-L85
|
146,973
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
|
PageFlowManagedObject.fieldIsUninitialized
|
protected boolean fieldIsUninitialized( Field field )
{
try
{
return field != null && field.get( this ) == null;
}
catch ( IllegalAccessException e )
{
_log.error( "Error initializing field " + field.getName() + " in " + getDisplayName(), e );
return false;
}
}
|
java
|
protected boolean fieldIsUninitialized( Field field )
{
try
{
return field != null && field.get( this ) == null;
}
catch ( IllegalAccessException e )
{
_log.error( "Error initializing field " + field.getName() + " in " + getDisplayName(), e );
return false;
}
}
|
[
"protected",
"boolean",
"fieldIsUninitialized",
"(",
"Field",
"field",
")",
"{",
"try",
"{",
"return",
"field",
"!=",
"null",
"&&",
"field",
".",
"get",
"(",
"this",
")",
"==",
"null",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"_log",
".",
"error",
"(",
"\"Error initializing field \"",
"+",
"field",
".",
"getName",
"(",
")",
"+",
"\" in \"",
"+",
"getDisplayName",
"(",
")",
",",
"e",
")",
";",
"return",
"false",
";",
"}",
"}"
] |
Tell whether the given Field is uninitialized.
@return <code>true</code> if the field is non-<code>null</code> and its value is <code>null</code>.
|
[
"Tell",
"whether",
"the",
"given",
"Field",
"is",
"uninitialized",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java#L198-L209
|
146,974
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
|
PageFlowManagedObject.initializeField
|
protected void initializeField( Field field, Object instance )
{
if ( instance != null )
{
if ( _log.isTraceEnabled() )
{
_log.trace( "Initializing field " + field.getName() + " in " + getDisplayName() + " with " + instance );
}
try
{
field.set( this, instance );
}
catch ( IllegalArgumentException e )
{
_log.error( "Could not set field " + field.getName() + " on " + getDisplayName() +
"; instance is of type " + instance.getClass().getName() + ", field type is "
+ field.getType().getName() );
}
catch ( IllegalAccessException e )
{
_log.error( "Error initializing field " + field.getName() + " in " + getDisplayName(), e );
}
}
}
|
java
|
protected void initializeField( Field field, Object instance )
{
if ( instance != null )
{
if ( _log.isTraceEnabled() )
{
_log.trace( "Initializing field " + field.getName() + " in " + getDisplayName() + " with " + instance );
}
try
{
field.set( this, instance );
}
catch ( IllegalArgumentException e )
{
_log.error( "Could not set field " + field.getName() + " on " + getDisplayName() +
"; instance is of type " + instance.getClass().getName() + ", field type is "
+ field.getType().getName() );
}
catch ( IllegalAccessException e )
{
_log.error( "Error initializing field " + field.getName() + " in " + getDisplayName(), e );
}
}
}
|
[
"protected",
"void",
"initializeField",
"(",
"Field",
"field",
",",
"Object",
"instance",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"if",
"(",
"_log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"_log",
".",
"trace",
"(",
"\"Initializing field \"",
"+",
"field",
".",
"getName",
"(",
")",
"+",
"\" in \"",
"+",
"getDisplayName",
"(",
")",
"+",
"\" with \"",
"+",
"instance",
")",
";",
"}",
"try",
"{",
"field",
".",
"set",
"(",
"this",
",",
"instance",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"_log",
".",
"error",
"(",
"\"Could not set field \"",
"+",
"field",
".",
"getName",
"(",
")",
"+",
"\" on \"",
"+",
"getDisplayName",
"(",
")",
"+",
"\"; instance is of type \"",
"+",
"instance",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\", field type is \"",
"+",
"field",
".",
"getType",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"_log",
".",
"error",
"(",
"\"Error initializing field \"",
"+",
"field",
".",
"getName",
"(",
")",
"+",
"\" in \"",
"+",
"getDisplayName",
"(",
")",
",",
"e",
")",
";",
"}",
"}",
"}"
] |
Initialize the given field with an instance. Mainly useful for the error handling.
|
[
"Initialize",
"the",
"given",
"field",
"with",
"an",
"instance",
".",
"Mainly",
"useful",
"for",
"the",
"error",
"handling",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java#L214-L238
|
146,975
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java
|
DefaultResultSetMapper.mapToResultType
|
public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
return resultSet;
}
|
java
|
public Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
return resultSet;
}
|
[
"public",
"Object",
"mapToResultType",
"(",
"ControlBeanContext",
"context",
",",
"Method",
"m",
",",
"ResultSet",
"resultSet",
",",
"Calendar",
"cal",
")",
"{",
"return",
"resultSet",
";",
"}"
] |
Maps a ResultSet to a ResultSet. The default implementation is a NOOP.
@param context A ControlBeanContext instance.
@param m Method assoicated with this call.
@param resultSet Result set to map.
@param cal A Calendar instance for resolving date/time values.
@return An object.
|
[
"Maps",
"a",
"ResultSet",
"to",
"a",
"ResultSet",
".",
"The",
"default",
"implementation",
"is",
"a",
"NOOP",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultResultSetMapper.java#L42-L44
|
146,976
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XLifecycleExtension.java
|
XLifecycleExtension.extractModel
|
public String extractModel(XLog log) {
XAttribute attribute = log.getAttributes().get(KEY_MODEL);
if (attribute == null) {
return null;
} else {
return ((XAttributeLiteral) attribute).getValue();
}
}
|
java
|
public String extractModel(XLog log) {
XAttribute attribute = log.getAttributes().get(KEY_MODEL);
if (attribute == null) {
return null;
} else {
return ((XAttributeLiteral) attribute).getValue();
}
}
|
[
"public",
"String",
"extractModel",
"(",
"XLog",
"log",
")",
"{",
"XAttribute",
"attribute",
"=",
"log",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_MODEL",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"(",
"XAttributeLiteral",
")",
"attribute",
")",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Extracts the lifecycle model identifier from a given log.
@param log
Event log.
@return Lifecycle model identifier string.
|
[
"Extracts",
"the",
"lifecycle",
"model",
"identifier",
"from",
"a",
"given",
"log",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XLifecycleExtension.java#L223-L230
|
146,977
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XLifecycleExtension.java
|
XLifecycleExtension.assignModel
|
public void assignModel(XLog log, String model) {
if (model != null && model.trim().length() > 0) {
XAttributeLiteral modelAttr = (XAttributeLiteral) ATTR_MODEL
.clone();
modelAttr.setValue(model.trim());
log.getAttributes().put(KEY_MODEL, modelAttr);
}
}
|
java
|
public void assignModel(XLog log, String model) {
if (model != null && model.trim().length() > 0) {
XAttributeLiteral modelAttr = (XAttributeLiteral) ATTR_MODEL
.clone();
modelAttr.setValue(model.trim());
log.getAttributes().put(KEY_MODEL, modelAttr);
}
}
|
[
"public",
"void",
"assignModel",
"(",
"XLog",
"log",
",",
"String",
"model",
")",
"{",
"if",
"(",
"model",
"!=",
"null",
"&&",
"model",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"XAttributeLiteral",
"modelAttr",
"=",
"(",
"XAttributeLiteral",
")",
"ATTR_MODEL",
".",
"clone",
"(",
")",
";",
"modelAttr",
".",
"setValue",
"(",
"model",
".",
"trim",
"(",
")",
")",
";",
"log",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_MODEL",
",",
"modelAttr",
")",
";",
"}",
"}"
] |
Assigns a value for the lifecycle model identifier to a given log.
@param log
Log to be tagged.
@param model
Lifecycle model identifier string to be used.
|
[
"Assigns",
"a",
"value",
"for",
"the",
"lifecycle",
"model",
"identifier",
"to",
"a",
"given",
"log",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XLifecycleExtension.java#L240-L247
|
146,978
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XLifecycleExtension.java
|
XLifecycleExtension.usesStandardModel
|
public boolean usesStandardModel(XLog log) {
String model = extractModel(log);
if (model == null) {
return false;
} else if (model.trim().equals(VALUE_MODEL_STANDARD)) {
return true;
} else {
return false;
}
}
|
java
|
public boolean usesStandardModel(XLog log) {
String model = extractModel(log);
if (model == null) {
return false;
} else if (model.trim().equals(VALUE_MODEL_STANDARD)) {
return true;
} else {
return false;
}
}
|
[
"public",
"boolean",
"usesStandardModel",
"(",
"XLog",
"log",
")",
"{",
"String",
"model",
"=",
"extractModel",
"(",
"log",
")",
";",
"if",
"(",
"model",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"model",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"VALUE_MODEL_STANDARD",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}"
] |
Checks, whether a given log uses the standard model for lifecycle
transitions.
@param log
Log to be checked.
@return Returns true, if the log indeed uses the standard lifecycle
model.
|
[
"Checks",
"whether",
"a",
"given",
"log",
"uses",
"the",
"standard",
"model",
"for",
"lifecycle",
"transitions",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XLifecycleExtension.java#L258-L267
|
146,979
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XLifecycleExtension.java
|
XLifecycleExtension.extractTransition
|
public String extractTransition(XEvent event) {
XAttribute attribute = event.getAttributes().get(KEY_TRANSITION);
if (attribute == null) {
return null;
} else {
return ((XAttributeLiteral) attribute).getValue();
}
}
|
java
|
public String extractTransition(XEvent event) {
XAttribute attribute = event.getAttributes().get(KEY_TRANSITION);
if (attribute == null) {
return null;
} else {
return ((XAttributeLiteral) attribute).getValue();
}
}
|
[
"public",
"String",
"extractTransition",
"(",
"XEvent",
"event",
")",
"{",
"XAttribute",
"attribute",
"=",
"event",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_TRANSITION",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"(",
"XAttributeLiteral",
")",
"attribute",
")",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Extracts the lifecycle transition string from a given event.
@param event
An event.
@return The lifecycle transition string of this event. Can be
<code>null</code>, if not defined.
|
[
"Extracts",
"the",
"lifecycle",
"transition",
"string",
"from",
"a",
"given",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XLifecycleExtension.java#L277-L284
|
146,980
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XLifecycleExtension.java
|
XLifecycleExtension.extractStandardTransition
|
public StandardModel extractStandardTransition(XEvent event) {
String transition = extractTransition(event);
if (transition != null) {
return StandardModel.decode(transition);
} else {
return null;
}
}
|
java
|
public StandardModel extractStandardTransition(XEvent event) {
String transition = extractTransition(event);
if (transition != null) {
return StandardModel.decode(transition);
} else {
return null;
}
}
|
[
"public",
"StandardModel",
"extractStandardTransition",
"(",
"XEvent",
"event",
")",
"{",
"String",
"transition",
"=",
"extractTransition",
"(",
"event",
")",
";",
"if",
"(",
"transition",
"!=",
"null",
")",
"{",
"return",
"StandardModel",
".",
"decode",
"(",
"transition",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
] |
Extracts the standard lifecycle transition object from a given event.
@param event
An event.
@return The standard lifecycle transition instance of this event. Can be
<code>null</code>, if not defined.
|
[
"Extracts",
"the",
"standard",
"lifecycle",
"transition",
"object",
"from",
"a",
"given",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XLifecycleExtension.java#L294-L301
|
146,981
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XLifecycleExtension.java
|
XLifecycleExtension.assignTransition
|
public void assignTransition(XEvent event, String transition) {
if (transition != null && transition.trim().length() > 0) {
XAttributeLiteral transAttr = (XAttributeLiteral) ATTR_TRANSITION
.clone();
transAttr.setValue(transition.trim());
event.getAttributes().put(KEY_TRANSITION, transAttr);
}
}
|
java
|
public void assignTransition(XEvent event, String transition) {
if (transition != null && transition.trim().length() > 0) {
XAttributeLiteral transAttr = (XAttributeLiteral) ATTR_TRANSITION
.clone();
transAttr.setValue(transition.trim());
event.getAttributes().put(KEY_TRANSITION, transAttr);
}
}
|
[
"public",
"void",
"assignTransition",
"(",
"XEvent",
"event",
",",
"String",
"transition",
")",
"{",
"if",
"(",
"transition",
"!=",
"null",
"&&",
"transition",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"XAttributeLiteral",
"transAttr",
"=",
"(",
"XAttributeLiteral",
")",
"ATTR_TRANSITION",
".",
"clone",
"(",
")",
";",
"transAttr",
".",
"setValue",
"(",
"transition",
".",
"trim",
"(",
")",
")",
";",
"event",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_TRANSITION",
",",
"transAttr",
")",
";",
"}",
"}"
] |
Assigns a lifecycle transition string to the given event.
@param event
Event to be tagged.
@param transition
Lifecycle transition string to be assigned.
|
[
"Assigns",
"a",
"lifecycle",
"transition",
"string",
"to",
"the",
"given",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XLifecycleExtension.java#L311-L318
|
146,982
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractClassicTag.java
|
AbstractClassicTag.getNextId
|
protected int getNextId(ServletRequest req)
{
Integer i = (Integer) RequestUtils.getOuterAttribute((HttpServletRequest) req,NETUI_UNIQUE_CNT);
if (i == null) {
i = new Integer(0);
}
int ret = i.intValue();
RequestUtils.setOuterAttribute((HttpServletRequest) req,NETUI_UNIQUE_CNT, new Integer(ret + 1));
return ret;
}
|
java
|
protected int getNextId(ServletRequest req)
{
Integer i = (Integer) RequestUtils.getOuterAttribute((HttpServletRequest) req,NETUI_UNIQUE_CNT);
if (i == null) {
i = new Integer(0);
}
int ret = i.intValue();
RequestUtils.setOuterAttribute((HttpServletRequest) req,NETUI_UNIQUE_CNT, new Integer(ret + 1));
return ret;
}
|
[
"protected",
"int",
"getNextId",
"(",
"ServletRequest",
"req",
")",
"{",
"Integer",
"i",
"=",
"(",
"Integer",
")",
"RequestUtils",
".",
"getOuterAttribute",
"(",
"(",
"HttpServletRequest",
")",
"req",
",",
"NETUI_UNIQUE_CNT",
")",
";",
"if",
"(",
"i",
"==",
"null",
")",
"{",
"i",
"=",
"new",
"Integer",
"(",
"0",
")",
";",
"}",
"int",
"ret",
"=",
"i",
".",
"intValue",
"(",
")",
";",
"RequestUtils",
".",
"setOuterAttribute",
"(",
"(",
"HttpServletRequest",
")",
"req",
",",
"NETUI_UNIQUE_CNT",
",",
"new",
"Integer",
"(",
"ret",
"+",
"1",
")",
")",
";",
"return",
"ret",
";",
"}"
] |
This method will generate the next unique int within the HTML tag.
@param req the Request
@return the next unique integer for this request.
|
[
"This",
"method",
"will",
"generate",
"the",
"next",
"unique",
"int",
"within",
"the",
"HTML",
"tag",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractClassicTag.java#L455-L465
|
146,983
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractClassicTag.java
|
AbstractClassicTag.getNearestForm
|
protected Form getNearestForm()
{
Tag parentTag = getParent();
while (parentTag != null) {
if (parentTag instanceof Form)
return (Form) parentTag;
parentTag = parentTag.getParent();
}
return null;
}
|
java
|
protected Form getNearestForm()
{
Tag parentTag = getParent();
while (parentTag != null) {
if (parentTag instanceof Form)
return (Form) parentTag;
parentTag = parentTag.getParent();
}
return null;
}
|
[
"protected",
"Form",
"getNearestForm",
"(",
")",
"{",
"Tag",
"parentTag",
"=",
"getParent",
"(",
")",
";",
"while",
"(",
"parentTag",
"!=",
"null",
")",
"{",
"if",
"(",
"parentTag",
"instanceof",
"Form",
")",
"return",
"(",
"Form",
")",
"parentTag",
";",
"parentTag",
"=",
"parentTag",
".",
"getParent",
"(",
")",
";",
"}",
"return",
"null",
";",
"}"
] |
Returns the closest parent form tag, or null if there is none.
|
[
"Returns",
"the",
"closest",
"parent",
"form",
"tag",
"or",
"null",
"if",
"there",
"is",
"none",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractClassicTag.java#L470-L479
|
146,984
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/BeanPropertyMap.java
|
BeanPropertyMap.setProperty
|
public synchronized void setProperty(PropertyKey key, Object value)
{
if (!isValidKey(key))
throw new IllegalArgumentException("Key " + key + " is not valid for " + getMapClass());
//
// Validate the value argument, based upon the property type reference by the key
//
Class propType = key.getPropertyType();
if (value == null)
{
if (propType.isPrimitive() || propType.isAnnotation())
throw new IllegalArgumentException("Invalid null value for key " + key);
}
else
{
if (propType.isPrimitive())
propType = (Class)_primToObject.get(propType);
if (!propType.isAssignableFrom(value.getClass()))
{
throw new IllegalArgumentException("Value class (" + value.getClass() +
") not of expected type: " + propType);
}
}
_properties.put(key, value);
_propertySets.add(key.getPropertySet());
}
|
java
|
public synchronized void setProperty(PropertyKey key, Object value)
{
if (!isValidKey(key))
throw new IllegalArgumentException("Key " + key + " is not valid for " + getMapClass());
//
// Validate the value argument, based upon the property type reference by the key
//
Class propType = key.getPropertyType();
if (value == null)
{
if (propType.isPrimitive() || propType.isAnnotation())
throw new IllegalArgumentException("Invalid null value for key " + key);
}
else
{
if (propType.isPrimitive())
propType = (Class)_primToObject.get(propType);
if (!propType.isAssignableFrom(value.getClass()))
{
throw new IllegalArgumentException("Value class (" + value.getClass() +
") not of expected type: " + propType);
}
}
_properties.put(key, value);
_propertySets.add(key.getPropertySet());
}
|
[
"public",
"synchronized",
"void",
"setProperty",
"(",
"PropertyKey",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"isValidKey",
"(",
"key",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Key \"",
"+",
"key",
"+",
"\" is not valid for \"",
"+",
"getMapClass",
"(",
")",
")",
";",
"//",
"// Validate the value argument, based upon the property type reference by the key",
"//",
"Class",
"propType",
"=",
"key",
".",
"getPropertyType",
"(",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"propType",
".",
"isPrimitive",
"(",
")",
"||",
"propType",
".",
"isAnnotation",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid null value for key \"",
"+",
"key",
")",
";",
"}",
"else",
"{",
"if",
"(",
"propType",
".",
"isPrimitive",
"(",
")",
")",
"propType",
"=",
"(",
"Class",
")",
"_primToObject",
".",
"get",
"(",
"propType",
")",
";",
"if",
"(",
"!",
"propType",
".",
"isAssignableFrom",
"(",
"value",
".",
"getClass",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Value class (\"",
"+",
"value",
".",
"getClass",
"(",
")",
"+",
"\") not of expected type: \"",
"+",
"propType",
")",
";",
"}",
"}",
"_properties",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"_propertySets",
".",
"add",
"(",
"key",
".",
"getPropertySet",
"(",
")",
")",
";",
"}"
] |
Sets the property specifed by 'key' within this map.
|
[
"Sets",
"the",
"property",
"specifed",
"by",
"key",
"within",
"this",
"map",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/BeanPropertyMap.java#L96-L123
|
146,985
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java
|
NameService.instance
|
public static NameService instance(HttpSession session)
{
if (session == null)
throw new IllegalArgumentException("Session must not be null");
// Synchronize on a session scoped mutex to ensure that only a single
// NameService object is created within a specific user session
Object sessionMutex = ServletUtils.getSessionMutex(session, NAME_SERVICE_MUTEX_ATTRIBUTE);
synchronized (sessionMutex) {
NameService nameService = (NameService) session.getAttribute(NAME_SERVICE);
if (nameService == null) {
nameService = new NameService();
session.setAttribute(NAME_SERVICE,nameService);
}
return nameService;
}
}
|
java
|
public static NameService instance(HttpSession session)
{
if (session == null)
throw new IllegalArgumentException("Session must not be null");
// Synchronize on a session scoped mutex to ensure that only a single
// NameService object is created within a specific user session
Object sessionMutex = ServletUtils.getSessionMutex(session, NAME_SERVICE_MUTEX_ATTRIBUTE);
synchronized (sessionMutex) {
NameService nameService = (NameService) session.getAttribute(NAME_SERVICE);
if (nameService == null) {
nameService = new NameService();
session.setAttribute(NAME_SERVICE,nameService);
}
return nameService;
}
}
|
[
"public",
"static",
"NameService",
"instance",
"(",
"HttpSession",
"session",
")",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Session must not be null\"",
")",
";",
"// Synchronize on a session scoped mutex to ensure that only a single",
"// NameService object is created within a specific user session",
"Object",
"sessionMutex",
"=",
"ServletUtils",
".",
"getSessionMutex",
"(",
"session",
",",
"NAME_SERVICE_MUTEX_ATTRIBUTE",
")",
";",
"synchronized",
"(",
"sessionMutex",
")",
"{",
"NameService",
"nameService",
"=",
"(",
"NameService",
")",
"session",
".",
"getAttribute",
"(",
"NAME_SERVICE",
")",
";",
"if",
"(",
"nameService",
"==",
"null",
")",
"{",
"nameService",
"=",
"new",
"NameService",
"(",
")",
";",
"session",
".",
"setAttribute",
"(",
"NAME_SERVICE",
",",
"nameService",
")",
";",
"}",
"return",
"nameService",
";",
"}",
"}"
] |
This will return the session specific instance of a NameService. There
will only be a single NameService per session.
@param session the HttpSession that contains the NameService
@return the NameService associated with the session.
|
[
"This",
"will",
"return",
"the",
"session",
"specific",
"instance",
"of",
"a",
"NameService",
".",
"There",
"will",
"only",
"be",
"a",
"single",
"NameService",
"per",
"session",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L70-L86
|
146,986
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java
|
NameService.readObject
|
private synchronized void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
// the transient _nameMap is null after an instance of
// NameService has been serialized.
if (_nameMap == null) {
_nameMap = new HashMap();
}
}
|
java
|
private synchronized void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
// the transient _nameMap is null after an instance of
// NameService has been serialized.
if (_nameMap == null) {
_nameMap = new HashMap();
}
}
|
[
"private",
"synchronized",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"// the transient _nameMap is null after an instance of",
"// NameService has been serialized.",
"if",
"(",
"_nameMap",
"==",
"null",
")",
"{",
"_nameMap",
"=",
"new",
"HashMap",
"(",
")",
";",
"}",
"}"
] |
Deserialize an instance of this class.
@param in ObjectInputStream to deserialize from.
@throws IOException
@throws ClassNotFoundException
|
[
"Deserialize",
"an",
"instance",
"of",
"this",
"class",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L106-L114
|
146,987
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java
|
NameService.nameObject
|
public synchronized void nameObject(String namePrefix, INameable object)
{
String name = namePrefix + Integer.toString(_nextValue++);
object.setObjectName(name);
}
|
java
|
public synchronized void nameObject(String namePrefix, INameable object)
{
String name = namePrefix + Integer.toString(_nextValue++);
object.setObjectName(name);
}
|
[
"public",
"synchronized",
"void",
"nameObject",
"(",
"String",
"namePrefix",
",",
"INameable",
"object",
")",
"{",
"String",
"name",
"=",
"namePrefix",
"+",
"Integer",
".",
"toString",
"(",
"_nextValue",
"++",
")",
";",
"object",
".",
"setObjectName",
"(",
"name",
")",
";",
"}"
] |
This method will create a unique name for an INameable object. The name
will be unque within the session. This will throw an IllegalStateException
if INameable.setObjectName has previously been called on object.
@param namePrefix The prefix of the generated name.
@param object the INameable object.
@throws IllegalStateException if this method is called more than once for an object
|
[
"This",
"method",
"will",
"create",
"a",
"unique",
"name",
"for",
"an",
"INameable",
"object",
".",
"The",
"name",
"will",
"be",
"unque",
"within",
"the",
"session",
".",
"This",
"will",
"throw",
"an",
"IllegalStateException",
"if",
"INameable",
".",
"setObjectName",
"has",
"previously",
"been",
"called",
"on",
"object",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L160-L164
|
146,988
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java
|
NameService.reclaimSpace
|
private void reclaimSpace()
{
if (_nameMap == null)
return;
if (_nameMap.size() > 0 && _nameMap.size() % _reclaimPoint == 0) {
synchronized (_nameMap) {
Set s = _nameMap.entrySet();
Iterator it = s.iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry) it.next();
TrackingObject to = (TrackingObject) e.getValue();
// If the object has been reclaimed, then we remove the named object from the map.
WeakReference wr = to.getWeakINameable();
INameable o = (INameable) wr.get();
if (o == null) {
it.remove();
}
}
_reclaimPoint = _nameMap.size() + _reclaimIncrement;
}
}
}
|
java
|
private void reclaimSpace()
{
if (_nameMap == null)
return;
if (_nameMap.size() > 0 && _nameMap.size() % _reclaimPoint == 0) {
synchronized (_nameMap) {
Set s = _nameMap.entrySet();
Iterator it = s.iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry) it.next();
TrackingObject to = (TrackingObject) e.getValue();
// If the object has been reclaimed, then we remove the named object from the map.
WeakReference wr = to.getWeakINameable();
INameable o = (INameable) wr.get();
if (o == null) {
it.remove();
}
}
_reclaimPoint = _nameMap.size() + _reclaimIncrement;
}
}
}
|
[
"private",
"void",
"reclaimSpace",
"(",
")",
"{",
"if",
"(",
"_nameMap",
"==",
"null",
")",
"return",
";",
"if",
"(",
"_nameMap",
".",
"size",
"(",
")",
">",
"0",
"&&",
"_nameMap",
".",
"size",
"(",
")",
"%",
"_reclaimPoint",
"==",
"0",
")",
"{",
"synchronized",
"(",
"_nameMap",
")",
"{",
"Set",
"s",
"=",
"_nameMap",
".",
"entrySet",
"(",
")",
";",
"Iterator",
"it",
"=",
"s",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Map",
".",
"Entry",
"e",
"=",
"(",
"Map",
".",
"Entry",
")",
"it",
".",
"next",
"(",
")",
";",
"TrackingObject",
"to",
"=",
"(",
"TrackingObject",
")",
"e",
".",
"getValue",
"(",
")",
";",
"// If the object has been reclaimed, then we remove the named object from the map.",
"WeakReference",
"wr",
"=",
"to",
".",
"getWeakINameable",
"(",
")",
";",
"INameable",
"o",
"=",
"(",
"INameable",
")",
"wr",
".",
"get",
"(",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"it",
".",
"remove",
"(",
")",
";",
"}",
"}",
"_reclaimPoint",
"=",
"_nameMap",
".",
"size",
"(",
")",
"+",
"_reclaimIncrement",
";",
"}",
"}",
"}"
] |
This mehtod will check the name map for entries where the
WeakReference object has been reclaimed. When they are found it will
reclaim the entry in the map.
|
[
"This",
"mehtod",
"will",
"check",
"the",
"name",
"map",
"for",
"entries",
"where",
"the",
"WeakReference",
"object",
"has",
"been",
"reclaimed",
".",
"When",
"they",
"are",
"found",
"it",
"will",
"reclaim",
"the",
"entry",
"in",
"the",
"map",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L274-L299
|
146,989
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java
|
NameService.fireNamingObjectEvent
|
private void fireNamingObjectEvent(TrackingObject to)
{
Object[] copy;
if (_listeners == null)
return;
// create a copy of the listeners so that there isn't any modifications while we
// fire the events.
synchronized (_listeners) { copy = _listeners.toArray(); }
INameable o = (INameable) to.getWeakINameable().get();
for (int i = 0; i < copy.length; i++) {
((NamingObjectListener)copy[i]).namingObject(o, to);
}
}
|
java
|
private void fireNamingObjectEvent(TrackingObject to)
{
Object[] copy;
if (_listeners == null)
return;
// create a copy of the listeners so that there isn't any modifications while we
// fire the events.
synchronized (_listeners) { copy = _listeners.toArray(); }
INameable o = (INameable) to.getWeakINameable().get();
for (int i = 0; i < copy.length; i++) {
((NamingObjectListener)copy[i]).namingObject(o, to);
}
}
|
[
"private",
"void",
"fireNamingObjectEvent",
"(",
"TrackingObject",
"to",
")",
"{",
"Object",
"[",
"]",
"copy",
";",
"if",
"(",
"_listeners",
"==",
"null",
")",
"return",
";",
"// create a copy of the listeners so that there isn't any modifications while we",
"// fire the events.",
"synchronized",
"(",
"_listeners",
")",
"{",
"copy",
"=",
"_listeners",
".",
"toArray",
"(",
")",
";",
"}",
"INameable",
"o",
"=",
"(",
"INameable",
")",
"to",
".",
"getWeakINameable",
"(",
")",
".",
"get",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"copy",
".",
"length",
";",
"i",
"++",
")",
"{",
"(",
"(",
"NamingObjectListener",
")",
"copy",
"[",
"i",
"]",
")",
".",
"namingObject",
"(",
"o",
",",
"to",
")",
";",
"}",
"}"
] |
This method will fire the NamingObject event. This event is triggered when
we have added an element to be tracked.
@param to The <code>TrackingObject</code> that acts as the Map and also contains the INameable.
|
[
"This",
"method",
"will",
"fire",
"the",
"NamingObject",
"event",
".",
"This",
"event",
"is",
"triggered",
"when",
"we",
"have",
"added",
"an",
"element",
"to",
"be",
"tracked",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L306-L320
|
146,990
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java
|
NikeFS2SwapFileManager.getSwapDir
|
private static synchronized File getSwapDir() throws IOException {
if(SWAP_DIR == null) {
// create swap directory for this instance
File swapDir = File.createTempFile(SWAP_DIR_PREFIX, SWAP_DIR_SUFFIX, TMP_DIR);
// delete if created
swapDir.delete();
// create lock file
File lockFile = new File(TMP_DIR, swapDir.getName() + LOCK_FILE_SUFFIX);
lockFile.createNewFile();
// delete lock file on exit, to make swap directory
// eligible for cleanup.
lockFile.deleteOnExit();
// make swap directory
swapDir.mkdirs();
// works reliably only on Unix platforms!
swapDir.deleteOnExit();
SWAP_DIR = swapDir;
}
return SWAP_DIR;
}
|
java
|
private static synchronized File getSwapDir() throws IOException {
if(SWAP_DIR == null) {
// create swap directory for this instance
File swapDir = File.createTempFile(SWAP_DIR_PREFIX, SWAP_DIR_SUFFIX, TMP_DIR);
// delete if created
swapDir.delete();
// create lock file
File lockFile = new File(TMP_DIR, swapDir.getName() + LOCK_FILE_SUFFIX);
lockFile.createNewFile();
// delete lock file on exit, to make swap directory
// eligible for cleanup.
lockFile.deleteOnExit();
// make swap directory
swapDir.mkdirs();
// works reliably only on Unix platforms!
swapDir.deleteOnExit();
SWAP_DIR = swapDir;
}
return SWAP_DIR;
}
|
[
"private",
"static",
"synchronized",
"File",
"getSwapDir",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"SWAP_DIR",
"==",
"null",
")",
"{",
"// create swap directory for this instance",
"File",
"swapDir",
"=",
"File",
".",
"createTempFile",
"(",
"SWAP_DIR_PREFIX",
",",
"SWAP_DIR_SUFFIX",
",",
"TMP_DIR",
")",
";",
"// delete if created",
"swapDir",
".",
"delete",
"(",
")",
";",
"// create lock file",
"File",
"lockFile",
"=",
"new",
"File",
"(",
"TMP_DIR",
",",
"swapDir",
".",
"getName",
"(",
")",
"+",
"LOCK_FILE_SUFFIX",
")",
";",
"lockFile",
".",
"createNewFile",
"(",
")",
";",
"// delete lock file on exit, to make swap directory ",
"// eligible for cleanup.",
"lockFile",
".",
"deleteOnExit",
"(",
")",
";",
"// make swap directory",
"swapDir",
".",
"mkdirs",
"(",
")",
";",
"// works reliably only on Unix platforms!",
"swapDir",
".",
"deleteOnExit",
"(",
")",
";",
"SWAP_DIR",
"=",
"swapDir",
";",
"}",
"return",
"SWAP_DIR",
";",
"}"
] |
Retrieves a file handle on the swap directory of this session.
@return The swap directory of this session.
@throws IOException
|
[
"Retrieves",
"a",
"file",
"handle",
"on",
"the",
"swap",
"directory",
"of",
"this",
"session",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java#L128-L147
|
146,991
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java
|
NikeFS2SwapFileManager.cleanup
|
private static synchronized void cleanup() {
int cleanedDirs = 0;
int cleanedFiles = 0;
// retrieve leftover swap directories
File[] swapDirs = TMP_DIR.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getName().endsWith(SWAP_DIR_SUFFIX);
}
});
for(File swapDir : swapDirs) {
// check if swap directory is locked
File lockFile = new File(TMP_DIR, swapDir.getName() + LOCK_FILE_SUFFIX);
if(lockFile.exists() == false) {
// no lock file, recursively delete leftover swap dir
cleanedDirs++;
cleanedFiles += deleteRecursively(swapDir);
}
}
System.out.println("NikeFS2: cleaned up " + cleanedFiles +
" stale swap files (from " + cleanedDirs + " sessions).");
}
|
java
|
private static synchronized void cleanup() {
int cleanedDirs = 0;
int cleanedFiles = 0;
// retrieve leftover swap directories
File[] swapDirs = TMP_DIR.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getName().endsWith(SWAP_DIR_SUFFIX);
}
});
for(File swapDir : swapDirs) {
// check if swap directory is locked
File lockFile = new File(TMP_DIR, swapDir.getName() + LOCK_FILE_SUFFIX);
if(lockFile.exists() == false) {
// no lock file, recursively delete leftover swap dir
cleanedDirs++;
cleanedFiles += deleteRecursively(swapDir);
}
}
System.out.println("NikeFS2: cleaned up " + cleanedFiles +
" stale swap files (from " + cleanedDirs + " sessions).");
}
|
[
"private",
"static",
"synchronized",
"void",
"cleanup",
"(",
")",
"{",
"int",
"cleanedDirs",
"=",
"0",
";",
"int",
"cleanedFiles",
"=",
"0",
";",
"// retrieve leftover swap directories",
"File",
"[",
"]",
"swapDirs",
"=",
"TMP_DIR",
".",
"listFiles",
"(",
"new",
"FileFilter",
"(",
")",
"{",
"public",
"boolean",
"accept",
"(",
"File",
"pathname",
")",
"{",
"return",
"pathname",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"SWAP_DIR_SUFFIX",
")",
";",
"}",
"}",
")",
";",
"for",
"(",
"File",
"swapDir",
":",
"swapDirs",
")",
"{",
"// check if swap directory is locked",
"File",
"lockFile",
"=",
"new",
"File",
"(",
"TMP_DIR",
",",
"swapDir",
".",
"getName",
"(",
")",
"+",
"LOCK_FILE_SUFFIX",
")",
";",
"if",
"(",
"lockFile",
".",
"exists",
"(",
")",
"==",
"false",
")",
"{",
"// no lock file, recursively delete leftover swap dir",
"cleanedDirs",
"++",
";",
"cleanedFiles",
"+=",
"deleteRecursively",
"(",
"swapDir",
")",
";",
"}",
"}",
"System",
".",
"out",
".",
"println",
"(",
"\"NikeFS2: cleaned up \"",
"+",
"cleanedFiles",
"+",
"\" stale swap files (from \"",
"+",
"cleanedDirs",
"+",
"\" sessions).\"",
")",
";",
"}"
] |
Cleans up stale swap files and directories, left over from
previous sessions. Only swap directories for which no lock
file exists will be removed.
|
[
"Cleans",
"up",
"stale",
"swap",
"files",
"and",
"directories",
"left",
"over",
"from",
"previous",
"sessions",
".",
"Only",
"swap",
"directories",
"for",
"which",
"no",
"lock",
"file",
"exists",
"will",
"be",
"removed",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java#L154-L174
|
146,992
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java
|
NikeFS2SwapFileManager.deleteRecursively
|
private static synchronized int deleteRecursively(File directory) {
int deleted = 0;
if(directory.isDirectory()) {
File[] contents = directory.listFiles();
for(File file : contents) {
deleted += deleteRecursively(file);
}
} else {
deleted++;
}
directory.delete();
return deleted;
}
|
java
|
private static synchronized int deleteRecursively(File directory) {
int deleted = 0;
if(directory.isDirectory()) {
File[] contents = directory.listFiles();
for(File file : contents) {
deleted += deleteRecursively(file);
}
} else {
deleted++;
}
directory.delete();
return deleted;
}
|
[
"private",
"static",
"synchronized",
"int",
"deleteRecursively",
"(",
"File",
"directory",
")",
"{",
"int",
"deleted",
"=",
"0",
";",
"if",
"(",
"directory",
".",
"isDirectory",
"(",
")",
")",
"{",
"File",
"[",
"]",
"contents",
"=",
"directory",
".",
"listFiles",
"(",
")",
";",
"for",
"(",
"File",
"file",
":",
"contents",
")",
"{",
"deleted",
"+=",
"deleteRecursively",
"(",
"file",
")",
";",
"}",
"}",
"else",
"{",
"deleted",
"++",
";",
"}",
"directory",
".",
"delete",
"(",
")",
";",
"return",
"deleted",
";",
"}"
] |
Deletes the given directory recursively, i.e., bottom-up.
@param directory Directory to be deleted.
@return The number of files deleted.
|
[
"Deletes",
"the",
"given",
"directory",
"recursively",
"i",
".",
"e",
".",
"bottom",
"-",
"up",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java#L181-L193
|
146,993
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/FormatTag.java
|
FormatTag.getLocale
|
public Locale getLocale()
throws JspException
{
Locale loc = null;
if (_language != null || _country != null) {
// language is required
if (_language == null) {
String s = Bundle.getString("Tags_LocaleRequiresLanguage", new Object[]{_country});
registerTagError(s, null);
return super.getUserLocale();
}
if (_country == null)
loc = new Locale(_language);
else
loc = new Locale(_language, _country);
}
else
loc = super.getUserLocale();
return loc;
}
|
java
|
public Locale getLocale()
throws JspException
{
Locale loc = null;
if (_language != null || _country != null) {
// language is required
if (_language == null) {
String s = Bundle.getString("Tags_LocaleRequiresLanguage", new Object[]{_country});
registerTagError(s, null);
return super.getUserLocale();
}
if (_country == null)
loc = new Locale(_language);
else
loc = new Locale(_language, _country);
}
else
loc = super.getUserLocale();
return loc;
}
|
[
"public",
"Locale",
"getLocale",
"(",
")",
"throws",
"JspException",
"{",
"Locale",
"loc",
"=",
"null",
";",
"if",
"(",
"_language",
"!=",
"null",
"||",
"_country",
"!=",
"null",
")",
"{",
"// language is required",
"if",
"(",
"_language",
"==",
"null",
")",
"{",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_LocaleRequiresLanguage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"_country",
"}",
")",
";",
"registerTagError",
"(",
"s",
",",
"null",
")",
";",
"return",
"super",
".",
"getUserLocale",
"(",
")",
";",
"}",
"if",
"(",
"_country",
"==",
"null",
")",
"loc",
"=",
"new",
"Locale",
"(",
"_language",
")",
";",
"else",
"loc",
"=",
"new",
"Locale",
"(",
"_language",
",",
"_country",
")",
";",
"}",
"else",
"loc",
"=",
"super",
".",
"getUserLocale",
"(",
")",
";",
"return",
"loc",
";",
"}"
] |
Returns the locale based on the country and language.
@return the locale
|
[
"Returns",
"the",
"locale",
"based",
"on",
"the",
"country",
"and",
"language",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/FormatTag.java#L69-L90
|
146,994
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java
|
XSequentialEventBuffer.replace
|
public synchronized boolean replace(XEvent event, int index)
throws IOException {
// check for index sanity
if (index < 0 || index >= size) {
throw new IndexOutOfBoundsException();
}
// determine and set appropriate file pointer position
navigateToIndex(index);
storage.seek(position);
long atePosition = position;
// read navigation data
int fwd = storage.readInt();
// skip backwards pointer and payload size, not relevant
storage.skipBytes(8);
int segmentSize = fwd - 12;
// encode event
byte[] evtEnc = encode(event);
boolean success = false;
if (evtEnc.length <= segmentSize) {
// overwrite event
storage.seek(atePosition + 8);
storage.writeInt(evtEnc.length);
// insert new padding
byte segmentPadding[] = new byte[segmentSize - evtEnc.length];
Arrays.fill(segmentPadding, (byte) 0);
storage.write(evtEnc);
storage.write(segmentPadding);
success = true;
} else {
success = false;
}
// return to prior position
this.position = atePosition;
storage.seek(this.position);
return success;
}
|
java
|
public synchronized boolean replace(XEvent event, int index)
throws IOException {
// check for index sanity
if (index < 0 || index >= size) {
throw new IndexOutOfBoundsException();
}
// determine and set appropriate file pointer position
navigateToIndex(index);
storage.seek(position);
long atePosition = position;
// read navigation data
int fwd = storage.readInt();
// skip backwards pointer and payload size, not relevant
storage.skipBytes(8);
int segmentSize = fwd - 12;
// encode event
byte[] evtEnc = encode(event);
boolean success = false;
if (evtEnc.length <= segmentSize) {
// overwrite event
storage.seek(atePosition + 8);
storage.writeInt(evtEnc.length);
// insert new padding
byte segmentPadding[] = new byte[segmentSize - evtEnc.length];
Arrays.fill(segmentPadding, (byte) 0);
storage.write(evtEnc);
storage.write(segmentPadding);
success = true;
} else {
success = false;
}
// return to prior position
this.position = atePosition;
storage.seek(this.position);
return success;
}
|
[
"public",
"synchronized",
"boolean",
"replace",
"(",
"XEvent",
"event",
",",
"int",
"index",
")",
"throws",
"IOException",
"{",
"// check for index sanity",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"// determine and set appropriate file pointer position",
"navigateToIndex",
"(",
"index",
")",
";",
"storage",
".",
"seek",
"(",
"position",
")",
";",
"long",
"atePosition",
"=",
"position",
";",
"// read navigation data",
"int",
"fwd",
"=",
"storage",
".",
"readInt",
"(",
")",
";",
"// skip backwards pointer and payload size, not relevant",
"storage",
".",
"skipBytes",
"(",
"8",
")",
";",
"int",
"segmentSize",
"=",
"fwd",
"-",
"12",
";",
"// encode event",
"byte",
"[",
"]",
"evtEnc",
"=",
"encode",
"(",
"event",
")",
";",
"boolean",
"success",
"=",
"false",
";",
"if",
"(",
"evtEnc",
".",
"length",
"<=",
"segmentSize",
")",
"{",
"// overwrite event",
"storage",
".",
"seek",
"(",
"atePosition",
"+",
"8",
")",
";",
"storage",
".",
"writeInt",
"(",
"evtEnc",
".",
"length",
")",
";",
"// insert new padding",
"byte",
"segmentPadding",
"[",
"]",
"=",
"new",
"byte",
"[",
"segmentSize",
"-",
"evtEnc",
".",
"length",
"]",
";",
"Arrays",
".",
"fill",
"(",
"segmentPadding",
",",
"(",
"byte",
")",
"0",
")",
";",
"storage",
".",
"write",
"(",
"evtEnc",
")",
";",
"storage",
".",
"write",
"(",
"segmentPadding",
")",
";",
"success",
"=",
"true",
";",
"}",
"else",
"{",
"success",
"=",
"false",
";",
"}",
"// return to prior position",
"this",
".",
"position",
"=",
"atePosition",
";",
"storage",
".",
"seek",
"(",
"this",
".",
"position",
")",
";",
"return",
"success",
";",
"}"
] |
Replaces an event at the given position.
@param event
The new event to be inserted.
@param index
Index to replace at.
@return The former event, having been replaced.
|
[
"Replaces",
"an",
"event",
"at",
"the",
"given",
"position",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java#L248-L283
|
146,995
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java
|
XSequentialEventBuffer.get
|
public synchronized XEvent get(int eventIndex) throws IOException,
IndexOutOfBoundsException {
// check for index sanity
if (eventIndex < 0 || eventIndex >= size) {
throw new IndexOutOfBoundsException();
}
// determine and set appropriate file pointer position
navigateToIndex(eventIndex);
// read and return requested audit trail entry
return read();
}
|
java
|
public synchronized XEvent get(int eventIndex) throws IOException,
IndexOutOfBoundsException {
// check for index sanity
if (eventIndex < 0 || eventIndex >= size) {
throw new IndexOutOfBoundsException();
}
// determine and set appropriate file pointer position
navigateToIndex(eventIndex);
// read and return requested audit trail entry
return read();
}
|
[
"public",
"synchronized",
"XEvent",
"get",
"(",
"int",
"eventIndex",
")",
"throws",
"IOException",
",",
"IndexOutOfBoundsException",
"{",
"// check for index sanity",
"if",
"(",
"eventIndex",
"<",
"0",
"||",
"eventIndex",
">=",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"// determine and set appropriate file pointer position",
"navigateToIndex",
"(",
"eventIndex",
")",
";",
"// read and return requested audit trail entry",
"return",
"read",
"(",
")",
";",
"}"
] |
Retrieves the event recorded at the specified position
@param eventIndex
Position of the requested event, defined to be within
<code>[0, size()-1]</code>.
@return The requested event.
|
[
"Retrieves",
"the",
"event",
"recorded",
"at",
"the",
"specified",
"position"
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java#L293-L303
|
146,996
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java
|
XSequentialEventBuffer.navigateToIndex
|
protected synchronized void navigateToIndex(int reqIndex)
throws IOException {
// determine if navigation is necessary
if (reqIndex != index) {
// ensure that the requested index is valid
if (reqIndex < 0 || reqIndex >= size) {
throw new IndexOutOfBoundsException();
}
// navigate to requested index in file
if (reqIndex > index) {
// forward navigation
skipForward(reqIndex - index);
} else {
// backward navigation
int backSkips = index - reqIndex;
if (backSkips < (index / 2)) {
// check if current index is beyond valid list
if (index == size) {
// reset current position to last element in
// set and adjust index and skip counter.
index = (size - 1);
position = lastInsertPosition;
backSkips = index - reqIndex;
}
// move in backward direction
skipBackward(backSkips);
} else {
// it is faster to reset position to the beginning
// of the file and move forward from there to the
// requested index
resetPosition();
skipForward(reqIndex);
}
}
}
if (reqIndex != index) {
throw new IOException("Navigation fault! (required: " + reqIndex
+ ", yielded: " + index + ")");
}
}
|
java
|
protected synchronized void navigateToIndex(int reqIndex)
throws IOException {
// determine if navigation is necessary
if (reqIndex != index) {
// ensure that the requested index is valid
if (reqIndex < 0 || reqIndex >= size) {
throw new IndexOutOfBoundsException();
}
// navigate to requested index in file
if (reqIndex > index) {
// forward navigation
skipForward(reqIndex - index);
} else {
// backward navigation
int backSkips = index - reqIndex;
if (backSkips < (index / 2)) {
// check if current index is beyond valid list
if (index == size) {
// reset current position to last element in
// set and adjust index and skip counter.
index = (size - 1);
position = lastInsertPosition;
backSkips = index - reqIndex;
}
// move in backward direction
skipBackward(backSkips);
} else {
// it is faster to reset position to the beginning
// of the file and move forward from there to the
// requested index
resetPosition();
skipForward(reqIndex);
}
}
}
if (reqIndex != index) {
throw new IOException("Navigation fault! (required: " + reqIndex
+ ", yielded: " + index + ")");
}
}
|
[
"protected",
"synchronized",
"void",
"navigateToIndex",
"(",
"int",
"reqIndex",
")",
"throws",
"IOException",
"{",
"// determine if navigation is necessary",
"if",
"(",
"reqIndex",
"!=",
"index",
")",
"{",
"// ensure that the requested index is valid",
"if",
"(",
"reqIndex",
"<",
"0",
"||",
"reqIndex",
">=",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"// navigate to requested index in file",
"if",
"(",
"reqIndex",
">",
"index",
")",
"{",
"// forward navigation",
"skipForward",
"(",
"reqIndex",
"-",
"index",
")",
";",
"}",
"else",
"{",
"// backward navigation",
"int",
"backSkips",
"=",
"index",
"-",
"reqIndex",
";",
"if",
"(",
"backSkips",
"<",
"(",
"index",
"/",
"2",
")",
")",
"{",
"// check if current index is beyond valid list",
"if",
"(",
"index",
"==",
"size",
")",
"{",
"// reset current position to last element in",
"// set and adjust index and skip counter.",
"index",
"=",
"(",
"size",
"-",
"1",
")",
";",
"position",
"=",
"lastInsertPosition",
";",
"backSkips",
"=",
"index",
"-",
"reqIndex",
";",
"}",
"// move in backward direction",
"skipBackward",
"(",
"backSkips",
")",
";",
"}",
"else",
"{",
"// it is faster to reset position to the beginning",
"// of the file and move forward from there to the",
"// requested index",
"resetPosition",
"(",
")",
";",
"skipForward",
"(",
"reqIndex",
")",
";",
"}",
"}",
"}",
"if",
"(",
"reqIndex",
"!=",
"index",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Navigation fault! (required: \"",
"+",
"reqIndex",
"+",
"\", yielded: \"",
"+",
"index",
"+",
"\")\"",
")",
";",
"}",
"}"
] |
Repositions the low-level layer to read from the specified index.
@param reqIndex
Index to position the file pointer to.
|
[
"Repositions",
"the",
"low",
"-",
"level",
"layer",
"to",
"read",
"from",
"the",
"specified",
"index",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java#L324-L363
|
146,997
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java
|
XSequentialEventBuffer.skipForward
|
protected synchronized void skipForward(int eventsToSkip)
throws IOException {
int offset = 0;
for (int i = 0; i < eventsToSkip; i++) {
// adjust position for reading offset
storage.seek(position);
// read forward skip offset
offset = storage.readInt();
// set file pointer to next event position
position += offset;
// adjust index
index++;
}
}
|
java
|
protected synchronized void skipForward(int eventsToSkip)
throws IOException {
int offset = 0;
for (int i = 0; i < eventsToSkip; i++) {
// adjust position for reading offset
storage.seek(position);
// read forward skip offset
offset = storage.readInt();
// set file pointer to next event position
position += offset;
// adjust index
index++;
}
}
|
[
"protected",
"synchronized",
"void",
"skipForward",
"(",
"int",
"eventsToSkip",
")",
"throws",
"IOException",
"{",
"int",
"offset",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"eventsToSkip",
";",
"i",
"++",
")",
"{",
"// adjust position for reading offset",
"storage",
".",
"seek",
"(",
"position",
")",
";",
"// read forward skip offset",
"offset",
"=",
"storage",
".",
"readInt",
"(",
")",
";",
"// set file pointer to next event position",
"position",
"+=",
"offset",
";",
"// adjust index",
"index",
"++",
";",
"}",
"}"
] |
Repositions the position of the data access layer to skip the specified
number of records towards the end of the file.
@param eventsToSkip
Number of records to be skipped.
|
[
"Repositions",
"the",
"position",
"of",
"the",
"data",
"access",
"layer",
"to",
"skip",
"the",
"specified",
"number",
"of",
"records",
"towards",
"the",
"end",
"of",
"the",
"file",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java#L381-L394
|
146,998
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java
|
XSequentialEventBuffer.read
|
protected synchronized XEvent read() throws IOException {
// reset file pointer position
storage.seek(position);
// compute next position from forward offset
long nextPosition = position + storage.readInt();
// skip backward offset (4 bytes)
storage.skipBytes(4);
// read payload size
int eventSize = storage.readInt();
// buffered implementation: reads the byte array representing the
// event and interprets it from that buffer subsequently.
byte[] eventData = new byte[eventSize];
storage.readFully(eventData);
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(
eventData));
// read event data attributes in specified order from file
XID id = XID.read(dis);
// read event attribute set
XAttributeMap attributes = this.attributeMapSerializer.deserialize(dis);
// assemble event
XEvent event = factory.createEvent(id, attributes);
// adjust position of data access layer
position = nextPosition;
index++;
return event;
}
|
java
|
protected synchronized XEvent read() throws IOException {
// reset file pointer position
storage.seek(position);
// compute next position from forward offset
long nextPosition = position + storage.readInt();
// skip backward offset (4 bytes)
storage.skipBytes(4);
// read payload size
int eventSize = storage.readInt();
// buffered implementation: reads the byte array representing the
// event and interprets it from that buffer subsequently.
byte[] eventData = new byte[eventSize];
storage.readFully(eventData);
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(
eventData));
// read event data attributes in specified order from file
XID id = XID.read(dis);
// read event attribute set
XAttributeMap attributes = this.attributeMapSerializer.deserialize(dis);
// assemble event
XEvent event = factory.createEvent(id, attributes);
// adjust position of data access layer
position = nextPosition;
index++;
return event;
}
|
[
"protected",
"synchronized",
"XEvent",
"read",
"(",
")",
"throws",
"IOException",
"{",
"// reset file pointer position",
"storage",
".",
"seek",
"(",
"position",
")",
";",
"// compute next position from forward offset",
"long",
"nextPosition",
"=",
"position",
"+",
"storage",
".",
"readInt",
"(",
")",
";",
"// skip backward offset (4 bytes)",
"storage",
".",
"skipBytes",
"(",
"4",
")",
";",
"// read payload size",
"int",
"eventSize",
"=",
"storage",
".",
"readInt",
"(",
")",
";",
"// buffered implementation: reads the byte array representing the",
"// event and interprets it from that buffer subsequently.",
"byte",
"[",
"]",
"eventData",
"=",
"new",
"byte",
"[",
"eventSize",
"]",
";",
"storage",
".",
"readFully",
"(",
"eventData",
")",
";",
"DataInputStream",
"dis",
"=",
"new",
"DataInputStream",
"(",
"new",
"ByteArrayInputStream",
"(",
"eventData",
")",
")",
";",
"// read event data attributes in specified order from file",
"XID",
"id",
"=",
"XID",
".",
"read",
"(",
"dis",
")",
";",
"// read event attribute set",
"XAttributeMap",
"attributes",
"=",
"this",
".",
"attributeMapSerializer",
".",
"deserialize",
"(",
"dis",
")",
";",
"// assemble event",
"XEvent",
"event",
"=",
"factory",
".",
"createEvent",
"(",
"id",
",",
"attributes",
")",
";",
"// adjust position of data access layer",
"position",
"=",
"nextPosition",
";",
"index",
"++",
";",
"return",
"event",
";",
"}"
] |
Reads an event from the current position of the data access layer.
Calling this method implies the advancement of the data access layer, so
that the next call will yield the subsequent event.
|
[
"Reads",
"an",
"event",
"from",
"the",
"current",
"position",
"of",
"the",
"data",
"access",
"layer",
".",
"Calling",
"this",
"method",
"implies",
"the",
"advancement",
"of",
"the",
"data",
"access",
"layer",
"so",
"that",
"the",
"next",
"call",
"will",
"yield",
"the",
"subsequent",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/model/buffered/XSequentialEventBuffer.java#L423-L448
|
146,999
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/FileUpload.java
|
FileUpload.doEndTag
|
public int doEndTag() throws JspException
{
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
// if we are not handling multipart requests then we can't output the file upload tag and we will
// report an error
if (!InternalUtils.isMultipartHandlingEnabled(req)) {
String s = Bundle.getString("Tags_FileMultiOff", null);
registerTagError(s, null);
return EVAL_PAGE;
}
// Create the state for the input tag.
ByRef ref = new ByRef();
nameHtmlControl(_state, ref);
if (hasErrors())
return reportAndExit(EVAL_PAGE);
WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_FILE_TAG, req);
br.doStartTag(writer, _state);
if (!ref.isNull())
write((String) ref.getRef());
localRelease();
return EVAL_PAGE;
}
|
java
|
public int doEndTag() throws JspException
{
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
// if we are not handling multipart requests then we can't output the file upload tag and we will
// report an error
if (!InternalUtils.isMultipartHandlingEnabled(req)) {
String s = Bundle.getString("Tags_FileMultiOff", null);
registerTagError(s, null);
return EVAL_PAGE;
}
// Create the state for the input tag.
ByRef ref = new ByRef();
nameHtmlControl(_state, ref);
if (hasErrors())
return reportAndExit(EVAL_PAGE);
WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_FILE_TAG, req);
br.doStartTag(writer, _state);
if (!ref.isNull())
write((String) ref.getRef());
localRelease();
return EVAL_PAGE;
}
|
[
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"HttpServletRequest",
"req",
"=",
"(",
"HttpServletRequest",
")",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"// if we are not handling multipart requests then we can't output the file upload tag and we will",
"// report an error",
"if",
"(",
"!",
"InternalUtils",
".",
"isMultipartHandlingEnabled",
"(",
"req",
")",
")",
"{",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_FileMultiOff\"",
",",
"null",
")",
";",
"registerTagError",
"(",
"s",
",",
"null",
")",
";",
"return",
"EVAL_PAGE",
";",
"}",
"// Create the state for the input tag.",
"ByRef",
"ref",
"=",
"new",
"ByRef",
"(",
")",
";",
"nameHtmlControl",
"(",
"_state",
",",
"ref",
")",
";",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"reportAndExit",
"(",
"EVAL_PAGE",
")",
";",
"WriteRenderAppender",
"writer",
"=",
"new",
"WriteRenderAppender",
"(",
"pageContext",
")",
";",
"TagRenderingBase",
"br",
"=",
"TagRenderingBase",
".",
"Factory",
".",
"getRendering",
"(",
"TagRenderingBase",
".",
"INPUT_FILE_TAG",
",",
"req",
")",
";",
"br",
".",
"doStartTag",
"(",
"writer",
",",
"_state",
")",
";",
"if",
"(",
"!",
"ref",
".",
"isNull",
"(",
")",
")",
"write",
"(",
"(",
"String",
")",
"ref",
".",
"getRef",
"(",
")",
")",
";",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}"
] |
Render the FileUpload.
@throws JspException if a JSP exception has occurred
|
[
"Render",
"the",
"FileUpload",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/FileUpload.java#L231-L259
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.