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,600
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java
|
ScopedResponseImpl.getFirstHeader
|
public Object getFirstHeader( String name )
{
List foundHeaders = ( List ) _headers.get( name );
return ! foundHeaders.isEmpty() ? foundHeaders.get( 0 ) : null;
}
|
java
|
public Object getFirstHeader( String name )
{
List foundHeaders = ( List ) _headers.get( name );
return ! foundHeaders.isEmpty() ? foundHeaders.get( 0 ) : null;
}
|
[
"public",
"Object",
"getFirstHeader",
"(",
"String",
"name",
")",
"{",
"List",
"foundHeaders",
"=",
"(",
"List",
")",
"_headers",
".",
"get",
"(",
"name",
")",
";",
"return",
"!",
"foundHeaders",
".",
"isEmpty",
"(",
")",
"?",
"foundHeaders",
".",
"get",
"(",
"0",
")",
":",
"null",
";",
"}"
] |
Gets the first header with the given name.
@return an Object (String, Integer, Date, Cookie) that is the first header with the given name,
or <code>null</code> if none is found.
|
[
"Gets",
"the",
"first",
"header",
"with",
"the",
"given",
"name",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java#L241-L245
|
146,601
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ParseUtils.java
|
ParseUtils.parseQueryString
|
public static void parseQueryString( String str, Map res, String encoding )
{
// "Within the query string, the plus sign is reserved as
// shorthand notation for a space. Therefore, real plus signs must
// be encoded. This method was used to make query URIs easier to
// pass in systems which did not allow spaces." -- RFC 1630
int i = str.indexOf( '#' );
if ( i > 0 )
{
str = str.substring( 0, i );
}
StringTokenizer st = new StringTokenizer( str.replace( '+', ' ' ), "&" );
while ( st.hasMoreTokens() )
{
String qp = st.nextToken();
String[] pair = qp.split( "=" ); // was String[] pair = StringUtils.split(qp, '=');
//String s = unescape(pair[1], encoding);
res.put( unescape( pair[0], encoding ), unescape( pair[1], encoding ) );
}
}
|
java
|
public static void parseQueryString( String str, Map res, String encoding )
{
// "Within the query string, the plus sign is reserved as
// shorthand notation for a space. Therefore, real plus signs must
// be encoded. This method was used to make query URIs easier to
// pass in systems which did not allow spaces." -- RFC 1630
int i = str.indexOf( '#' );
if ( i > 0 )
{
str = str.substring( 0, i );
}
StringTokenizer st = new StringTokenizer( str.replace( '+', ' ' ), "&" );
while ( st.hasMoreTokens() )
{
String qp = st.nextToken();
String[] pair = qp.split( "=" ); // was String[] pair = StringUtils.split(qp, '=');
//String s = unescape(pair[1], encoding);
res.put( unescape( pair[0], encoding ), unescape( pair[1], encoding ) );
}
}
|
[
"public",
"static",
"void",
"parseQueryString",
"(",
"String",
"str",
",",
"Map",
"res",
",",
"String",
"encoding",
")",
"{",
"// \"Within the query string, the plus sign is reserved as",
"// shorthand notation for a space. Therefore, real plus signs must",
"// be encoded. This method was used to make query URIs easier to",
"// pass in systems which did not allow spaces.\" -- RFC 1630",
"int",
"i",
"=",
"str",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"i",
">",
"0",
")",
"{",
"str",
"=",
"str",
".",
"substring",
"(",
"0",
",",
"i",
")",
";",
"}",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"str",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
",",
"\"&\"",
")",
";",
"while",
"(",
"st",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"String",
"qp",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"[",
"]",
"pair",
"=",
"qp",
".",
"split",
"(",
"\"=\"",
")",
";",
"// was String[] pair = StringUtils.split(qp, '=');",
"//String s = unescape(pair[1], encoding);",
"res",
".",
"put",
"(",
"unescape",
"(",
"pair",
"[",
"0",
"]",
",",
"encoding",
")",
",",
"unescape",
"(",
"pair",
"[",
"1",
"]",
",",
"encoding",
")",
")",
";",
"}",
"}"
] |
Parses an RFC1630 query string into an existing Map.
@param str Query string
@param res Map into which insert the values.
@param encoding Encoding to be used for stored Strings
|
[
"Parses",
"an",
"RFC1630",
"query",
"string",
"into",
"an",
"existing",
"Map",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ParseUtils.java#L38-L59
|
146,602
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/writer/LogWriter.java
|
LogWriter.writeTrace
|
public <E extends LogEntry> void writeTrace(LogTrace<E> logTrace) throws PerspectiveException, IOException{
if(logPerspective == LogPerspective.ACTIVITY_PERSPECTIVE)
throw new PerspectiveException(PerspectiveError.WRITE_TRACE_IN_ACTIVITY_PERSPECTIVE);
prepare();
if(!headerWritten){
write(logFormat.getFileHeader());
headerWritten = true;
}
output.write(logFormat.getTraceAsString(logTrace));
}
|
java
|
public <E extends LogEntry> void writeTrace(LogTrace<E> logTrace) throws PerspectiveException, IOException{
if(logPerspective == LogPerspective.ACTIVITY_PERSPECTIVE)
throw new PerspectiveException(PerspectiveError.WRITE_TRACE_IN_ACTIVITY_PERSPECTIVE);
prepare();
if(!headerWritten){
write(logFormat.getFileHeader());
headerWritten = true;
}
output.write(logFormat.getTraceAsString(logTrace));
}
|
[
"public",
"<",
"E",
"extends",
"LogEntry",
">",
"void",
"writeTrace",
"(",
"LogTrace",
"<",
"E",
">",
"logTrace",
")",
"throws",
"PerspectiveException",
",",
"IOException",
"{",
"if",
"(",
"logPerspective",
"==",
"LogPerspective",
".",
"ACTIVITY_PERSPECTIVE",
")",
"throw",
"new",
"PerspectiveException",
"(",
"PerspectiveError",
".",
"WRITE_TRACE_IN_ACTIVITY_PERSPECTIVE",
")",
";",
"prepare",
"(",
")",
";",
"if",
"(",
"!",
"headerWritten",
")",
"{",
"write",
"(",
"logFormat",
".",
"getFileHeader",
"(",
")",
")",
";",
"headerWritten",
"=",
"true",
";",
"}",
"output",
".",
"write",
"(",
"logFormat",
".",
"getTraceAsString",
"(",
"logTrace",
")",
")",
";",
"}"
] |
This method is only allowed in the trace perspective.
@param <E>
@param logTrace The log trace to write.
@throws PerspectiveException
@throws IOException
|
[
"This",
"method",
"is",
"only",
"allowed",
"in",
"the",
"trace",
"perspective",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/writer/LogWriter.java#L243-L253
|
146,603
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/writer/LogWriter.java
|
LogWriter.writeEntry
|
public void writeEntry(LogEntry logEntry, int caseNumber) throws PerspectiveException, IOException{
if(logPerspective == LogPerspective.TRACE_PERSPECTIVE)
throw new PerspectiveException(PerspectiveError.WRITE_ACTIVITY_IN_TRACE_PERSPECTIVE);
prepare();
if(!headerWritten){
write(logFormat.getFileHeader());
headerWritten = true;
}
output.write(logFormat.getEntryAsString(logEntry, caseNumber));
}
|
java
|
public void writeEntry(LogEntry logEntry, int caseNumber) throws PerspectiveException, IOException{
if(logPerspective == LogPerspective.TRACE_PERSPECTIVE)
throw new PerspectiveException(PerspectiveError.WRITE_ACTIVITY_IN_TRACE_PERSPECTIVE);
prepare();
if(!headerWritten){
write(logFormat.getFileHeader());
headerWritten = true;
}
output.write(logFormat.getEntryAsString(logEntry, caseNumber));
}
|
[
"public",
"void",
"writeEntry",
"(",
"LogEntry",
"logEntry",
",",
"int",
"caseNumber",
")",
"throws",
"PerspectiveException",
",",
"IOException",
"{",
"if",
"(",
"logPerspective",
"==",
"LogPerspective",
".",
"TRACE_PERSPECTIVE",
")",
"throw",
"new",
"PerspectiveException",
"(",
"PerspectiveError",
".",
"WRITE_ACTIVITY_IN_TRACE_PERSPECTIVE",
")",
";",
"prepare",
"(",
")",
";",
"if",
"(",
"!",
"headerWritten",
")",
"{",
"write",
"(",
"logFormat",
".",
"getFileHeader",
"(",
")",
")",
";",
"headerWritten",
"=",
"true",
";",
"}",
"output",
".",
"write",
"(",
"logFormat",
".",
"getEntryAsString",
"(",
"logEntry",
",",
"caseNumber",
")",
")",
";",
"}"
] |
This method is only allowed in the activity perspective.
@param logEntry The log entry to write.
@param caseNumber
@throws PerspectiveException
@throws IOException
|
[
"This",
"method",
"is",
"only",
"allowed",
"in",
"the",
"activity",
"perspective",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/writer/LogWriter.java#L262-L272
|
146,604
|
dmurph/jgoogleanalyticstracker
|
src/main/java/com/dmurph/tracking/VisitorData.java
|
VisitorData.newVisitor
|
public static VisitorData newVisitor() {
int visitorId = (new SecureRandom().nextInt() & 0x7FFFFFFF);
long now = now();
return new VisitorData(visitorId, now, now, now, 1);
}
|
java
|
public static VisitorData newVisitor() {
int visitorId = (new SecureRandom().nextInt() & 0x7FFFFFFF);
long now = now();
return new VisitorData(visitorId, now, now, now, 1);
}
|
[
"public",
"static",
"VisitorData",
"newVisitor",
"(",
")",
"{",
"int",
"visitorId",
"=",
"(",
"new",
"SecureRandom",
"(",
")",
".",
"nextInt",
"(",
")",
"&",
"0x7FFFFFFF",
")",
";",
"long",
"now",
"=",
"now",
"(",
")",
";",
"return",
"new",
"VisitorData",
"(",
"visitorId",
",",
"now",
",",
"now",
",",
"now",
",",
"1",
")",
";",
"}"
] |
initializes a new visitor data, with new visitorid
|
[
"initializes",
"a",
"new",
"visitor",
"data",
"with",
"new",
"visitorid"
] |
69f68caf8e09a53e6f6076477bf05b84bc80e386
|
https://github.com/dmurph/jgoogleanalyticstracker/blob/69f68caf8e09a53e6f6076477bf05b84bc80e386/src/main/java/com/dmurph/tracking/VisitorData.java#L61-L65
|
146,605
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/Log.java
|
Log.addTrace
|
public void addTrace(LogTrace<E> trace) throws ParameterException {
Validate.notNull(trace);
trace.setCaseNumber(traces.size() + 1);
traces.add(trace);
summary.addTrace(trace);
if (!distinctTraces.add(trace)) {
for (LogTrace<E> storedTrace : traces) {
if (storedTrace.equals(trace)) {
storedTrace.addSimilarInstance(trace.getCaseNumber());
trace.addSimilarInstance(storedTrace.getCaseNumber());
}
}
}
}
|
java
|
public void addTrace(LogTrace<E> trace) throws ParameterException {
Validate.notNull(trace);
trace.setCaseNumber(traces.size() + 1);
traces.add(trace);
summary.addTrace(trace);
if (!distinctTraces.add(trace)) {
for (LogTrace<E> storedTrace : traces) {
if (storedTrace.equals(trace)) {
storedTrace.addSimilarInstance(trace.getCaseNumber());
trace.addSimilarInstance(storedTrace.getCaseNumber());
}
}
}
}
|
[
"public",
"void",
"addTrace",
"(",
"LogTrace",
"<",
"E",
">",
"trace",
")",
"throws",
"ParameterException",
"{",
"Validate",
".",
"notNull",
"(",
"trace",
")",
";",
"trace",
".",
"setCaseNumber",
"(",
"traces",
".",
"size",
"(",
")",
"+",
"1",
")",
";",
"traces",
".",
"add",
"(",
"trace",
")",
";",
"summary",
".",
"addTrace",
"(",
"trace",
")",
";",
"if",
"(",
"!",
"distinctTraces",
".",
"add",
"(",
"trace",
")",
")",
"{",
"for",
"(",
"LogTrace",
"<",
"E",
">",
"storedTrace",
":",
"traces",
")",
"{",
"if",
"(",
"storedTrace",
".",
"equals",
"(",
"trace",
")",
")",
"{",
"storedTrace",
".",
"addSimilarInstance",
"(",
"trace",
".",
"getCaseNumber",
"(",
")",
")",
";",
"trace",
".",
"addSimilarInstance",
"(",
"storedTrace",
".",
"getCaseNumber",
"(",
")",
")",
";",
"}",
"}",
"}",
"}"
] |
Adds a trace to the log.
@param trace Trace to add.
@throws ParameterException
|
[
"Adds",
"a",
"trace",
"to",
"the",
"log",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/Log.java#L89-L102
|
146,606
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractAmount
|
public Double extractAmount(XAttribute attribute) {
XAttribute attr = attribute.getAttributes().get(KEY_AMOUNT);
if (attr == null) {
return null;
} else {
return ((XAttributeContinuous) attr).getValue();
}
}
|
java
|
public Double extractAmount(XAttribute attribute) {
XAttribute attr = attribute.getAttributes().get(KEY_AMOUNT);
if (attr == null) {
return null;
} else {
return ((XAttributeContinuous) attr).getValue();
}
}
|
[
"public",
"Double",
"extractAmount",
"(",
"XAttribute",
"attribute",
")",
"{",
"XAttribute",
"attr",
"=",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_AMOUNT",
")",
";",
"if",
"(",
"attr",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"(",
"XAttributeContinuous",
")",
"attr",
")",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Retrieves the cost amount for an attribute, if set by this extension's
amount attribute.
@param attribute
Attribute element to retrieve cost amount for.
@return The requested cost amount.
|
[
"Retrieves",
"the",
"cost",
"amount",
"for",
"an",
"attribute",
"if",
"set",
"by",
"this",
"extension",
"s",
"amount",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L341-L348
|
146,607
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractAmounts
|
public Map<String, Double> extractAmounts(XTrace trace) {
return XCostAmount.instance().extractValues(trace);
}
|
java
|
public Map<String, Double> extractAmounts(XTrace trace) {
return XCostAmount.instance().extractValues(trace);
}
|
[
"public",
"Map",
"<",
"String",
",",
"Double",
">",
"extractAmounts",
"(",
"XTrace",
"trace",
")",
"{",
"return",
"XCostAmount",
".",
"instance",
"(",
")",
".",
"extractValues",
"(",
"trace",
")",
";",
"}"
] |
Retrieves a map containing all cost amounts for all child attributes of a
trace.
For example, the XES fragment:
<pre>
{@code
<trace>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</trace>
}
</pre>
should result into the following:
<pre>
[[a 10.00] [b 15.00] [c 25.00]]
</pre>
@param trace
Trace to retrieve all cost amounts for.
@return Map from all child keys to cost amounts.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"amounts",
"for",
"all",
"child",
"attributes",
"of",
"a",
"trace",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L388-L390
|
146,608
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractAmounts
|
public Map<String, Double> extractAmounts(XEvent event) {
return XCostAmount.instance().extractValues(event);
}
|
java
|
public Map<String, Double> extractAmounts(XEvent event) {
return XCostAmount.instance().extractValues(event);
}
|
[
"public",
"Map",
"<",
"String",
",",
"Double",
">",
"extractAmounts",
"(",
"XEvent",
"event",
")",
"{",
"return",
"XCostAmount",
".",
"instance",
"(",
")",
".",
"extractValues",
"(",
"event",
")",
";",
"}"
] |
Retrieves a map containing all cost amounts for all child attributes of
an event.
For example, the XES fragment:
<pre>
{@code
<event>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</event>
}
</pre>
should result into the following:
<pre>
[[a 10.00] [b 15.00] [c 25.00]]
</pre>
@param event
Event to retrieve all cost amounts for.
@return Map from all child keys to cost amounts.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"amounts",
"for",
"all",
"child",
"attributes",
"of",
"an",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L430-L432
|
146,609
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractNestedAmounts
|
public Map<List<String>, Double> extractNestedAmounts(XTrace trace) {
return XCostAmount.instance().extractNestedValues(trace);
}
|
java
|
public Map<List<String>, Double> extractNestedAmounts(XTrace trace) {
return XCostAmount.instance().extractNestedValues(trace);
}
|
[
"public",
"Map",
"<",
"List",
"<",
"String",
">",
",",
"Double",
">",
"extractNestedAmounts",
"(",
"XTrace",
"trace",
")",
"{",
"return",
"XCostAmount",
".",
"instance",
"(",
")",
".",
"extractNestedValues",
"(",
"trace",
")",
";",
"}"
] |
Retrieves a map containing all cost amounts for all descending attributes
of a trace.
For example, the XES fragment:
<pre>
{@code
<trace>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</trace>
}
</pre>
should result into the following:
<pre>
[[[a] 10.00] [[a b] 20.00] [[a c] 30.00] [[b] 15.00] [[c] 25.00]]
</pre>
@param trace
Trace to retrieve all cost amounts for.
@return Map from all descending keys to cost amounts.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"amounts",
"for",
"all",
"descending",
"attributes",
"of",
"a",
"trace",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L472-L474
|
146,610
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractNestedAmounts
|
public Map<List<String>, Double> extractNestedAmounts(XEvent event) {
return XCostAmount.instance().extractNestedValues(event);
}
|
java
|
public Map<List<String>, Double> extractNestedAmounts(XEvent event) {
return XCostAmount.instance().extractNestedValues(event);
}
|
[
"public",
"Map",
"<",
"List",
"<",
"String",
">",
",",
"Double",
">",
"extractNestedAmounts",
"(",
"XEvent",
"event",
")",
"{",
"return",
"XCostAmount",
".",
"instance",
"(",
")",
".",
"extractNestedValues",
"(",
"event",
")",
";",
"}"
] |
Retrieves a map containing all cost amounts for all descending attributes
of an event.
For example, the XES fragment:
<pre>
{@code
<event>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</event>
}
</pre>
should result into the following:
<pre>
[[[a] 10.00] [[a b] 20.00] [[a c] 30.00] [[b] 15.00] [[c] 25.00]]
</pre>
@param event
Event to retrieve all cost amounts for.
@return Map from all descending keys to cost amounts.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"amounts",
"for",
"all",
"descending",
"attributes",
"of",
"an",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L514-L516
|
146,611
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.assignAmount
|
public void assignAmount(XAttribute attribute, Double amount) {
if (amount != null && amount > 0.0) {
XAttributeContinuous attr = (XAttributeContinuous) ATTR_AMOUNT
.clone();
attr.setValue(amount);
attribute.getAttributes().put(KEY_AMOUNT, attr);
}
}
|
java
|
public void assignAmount(XAttribute attribute, Double amount) {
if (amount != null && amount > 0.0) {
XAttributeContinuous attr = (XAttributeContinuous) ATTR_AMOUNT
.clone();
attr.setValue(amount);
attribute.getAttributes().put(KEY_AMOUNT, attr);
}
}
|
[
"public",
"void",
"assignAmount",
"(",
"XAttribute",
"attribute",
",",
"Double",
"amount",
")",
"{",
"if",
"(",
"amount",
"!=",
"null",
"&&",
"amount",
">",
"0.0",
")",
"{",
"XAttributeContinuous",
"attr",
"=",
"(",
"XAttributeContinuous",
")",
"ATTR_AMOUNT",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValue",
"(",
"amount",
")",
";",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_AMOUNT",
",",
"attr",
")",
";",
"}",
"}"
] |
Assigns any attribute its cost amount, as defined by this extension's
amount attribute.
@param attribute
Attribute to assign cost amount to.
@param amount
The cost amount to be assigned.
|
[
"Assigns",
"any",
"attribute",
"its",
"cost",
"amount",
"as",
"defined",
"by",
"this",
"extension",
"s",
"amount",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L527-L534
|
146,612
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractDriver
|
public String extractDriver(XAttribute attribute) {
XAttribute attr = attribute.getAttributes().get(KEY_DRIVER);
if (attr == null) {
return null;
} else {
return ((XAttributeLiteral) attr).getValue();
}
}
|
java
|
public String extractDriver(XAttribute attribute) {
XAttribute attr = attribute.getAttributes().get(KEY_DRIVER);
if (attr == null) {
return null;
} else {
return ((XAttributeLiteral) attr).getValue();
}
}
|
[
"public",
"String",
"extractDriver",
"(",
"XAttribute",
"attribute",
")",
"{",
"XAttribute",
"attr",
"=",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_DRIVER",
")",
";",
"if",
"(",
"attr",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"(",
"XAttributeLiteral",
")",
"attr",
")",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Retrieves the cost driver for an attribute, if set by this extension's
driver attribute.
@param attribute
Attribute element to retrieve cost driver for.
@return The requested cost driver.
|
[
"Retrieves",
"the",
"cost",
"driver",
"for",
"an",
"attribute",
"if",
"set",
"by",
"this",
"extension",
"s",
"driver",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L712-L719
|
146,613
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractDrivers
|
public Map<String, String> extractDrivers(XTrace trace) {
return XCostDriver.instance().extractValues(trace);
}
|
java
|
public Map<String, String> extractDrivers(XTrace trace) {
return XCostDriver.instance().extractValues(trace);
}
|
[
"public",
"Map",
"<",
"String",
",",
"String",
">",
"extractDrivers",
"(",
"XTrace",
"trace",
")",
"{",
"return",
"XCostDriver",
".",
"instance",
"(",
")",
".",
"extractValues",
"(",
"trace",
")",
";",
"}"
] |
Retrieves a map containing all cost drivers for all child attributes of a
trace.
@see #extractAmounts(XTrace)
@param trace
Trace to retrieve all cost drivers for.
@return Map from all child keys to cost drivers.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"drivers",
"for",
"all",
"child",
"attributes",
"of",
"a",
"trace",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L731-L733
|
146,614
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractDrivers
|
public Map<String, String> extractDrivers(XEvent event) {
return XCostDriver.instance().extractValues(event);
}
|
java
|
public Map<String, String> extractDrivers(XEvent event) {
return XCostDriver.instance().extractValues(event);
}
|
[
"public",
"Map",
"<",
"String",
",",
"String",
">",
"extractDrivers",
"(",
"XEvent",
"event",
")",
"{",
"return",
"XCostDriver",
".",
"instance",
"(",
")",
".",
"extractValues",
"(",
"event",
")",
";",
"}"
] |
Retrieves a map containing all cost drivers for all child attributes of
an event.
@see #extractAmounts(XEvent)
@param event
Event to retrieve all cost drivers for.
@return Map from all child keys to cost drivers.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"drivers",
"for",
"all",
"child",
"attributes",
"of",
"an",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L745-L747
|
146,615
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractNestedDrivers
|
public Map<List<String>, String> extractNestedDrivers(XTrace trace) {
return XCostDriver.instance().extractNestedValues(trace);
}
|
java
|
public Map<List<String>, String> extractNestedDrivers(XTrace trace) {
return XCostDriver.instance().extractNestedValues(trace);
}
|
[
"public",
"Map",
"<",
"List",
"<",
"String",
">",
",",
"String",
">",
"extractNestedDrivers",
"(",
"XTrace",
"trace",
")",
"{",
"return",
"XCostDriver",
".",
"instance",
"(",
")",
".",
"extractNestedValues",
"(",
"trace",
")",
";",
"}"
] |
Retrieves a map containing all cost drivers for all descending attributes
of a trace.
@see #extractNestedAmounts(XTrace)
@param trace
Trace to retrieve all cost drivers for.
@return Map from all descending keys to cost drivers.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"drivers",
"for",
"all",
"descending",
"attributes",
"of",
"a",
"trace",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L759-L761
|
146,616
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractNestedDrivers
|
public Map<List<String>, String> extractNestedDrivers(XEvent event) {
return XCostDriver.instance().extractNestedValues(event);
}
|
java
|
public Map<List<String>, String> extractNestedDrivers(XEvent event) {
return XCostDriver.instance().extractNestedValues(event);
}
|
[
"public",
"Map",
"<",
"List",
"<",
"String",
">",
",",
"String",
">",
"extractNestedDrivers",
"(",
"XEvent",
"event",
")",
"{",
"return",
"XCostDriver",
".",
"instance",
"(",
")",
".",
"extractNestedValues",
"(",
"event",
")",
";",
"}"
] |
Retrieves a map containing all cost drivers for all descending attributes
of an event.
@see #extractNestedDrivers(XEvent)
@param event
Event to retrieve all cost drivers for.
@return Map from all descending keys to cost drivers.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"drivers",
"for",
"all",
"descending",
"attributes",
"of",
"an",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L773-L775
|
146,617
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.assignDriver
|
public void assignDriver(XAttribute attribute, String driver) {
if (driver != null && driver.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_DRIVER.clone();
attr.setValue(driver);
attribute.getAttributes().put(KEY_DRIVER, attr);
}
}
|
java
|
public void assignDriver(XAttribute attribute, String driver) {
if (driver != null && driver.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_DRIVER.clone();
attr.setValue(driver);
attribute.getAttributes().put(KEY_DRIVER, attr);
}
}
|
[
"public",
"void",
"assignDriver",
"(",
"XAttribute",
"attribute",
",",
"String",
"driver",
")",
"{",
"if",
"(",
"driver",
"!=",
"null",
"&&",
"driver",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"XAttributeLiteral",
"attr",
"=",
"(",
"XAttributeLiteral",
")",
"ATTR_DRIVER",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValue",
"(",
"driver",
")",
";",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_DRIVER",
",",
"attr",
")",
";",
"}",
"}"
] |
Assigns any attribute its cost driver, as defined by this extension's
driver attribute.
@param attribute
Attribute to assign cost driver to.
@param driver
The cost driver to be assigned.
|
[
"Assigns",
"any",
"attribute",
"its",
"cost",
"driver",
"as",
"defined",
"by",
"this",
"extension",
"s",
"driver",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L786-L792
|
146,618
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractType
|
public String extractType(XAttribute attribute) {
XAttribute attr = attribute.getAttributes().get(KEY_TYPE);
if (attr == null) {
return null;
} else {
return ((XAttributeLiteral) attr).getValue();
}
}
|
java
|
public String extractType(XAttribute attribute) {
XAttribute attr = attribute.getAttributes().get(KEY_TYPE);
if (attr == null) {
return null;
} else {
return ((XAttributeLiteral) attr).getValue();
}
}
|
[
"public",
"String",
"extractType",
"(",
"XAttribute",
"attribute",
")",
"{",
"XAttribute",
"attr",
"=",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_TYPE",
")",
";",
"if",
"(",
"attr",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"(",
"XAttributeLiteral",
")",
"attr",
")",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Retrieves the cost type for an attribute, if set by this extension's type
attribute.
@param attribute
Attribute element to retrieve cost type for.
@return The requested cost type.
|
[
"Retrieves",
"the",
"cost",
"type",
"for",
"an",
"attribute",
"if",
"set",
"by",
"this",
"extension",
"s",
"type",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L874-L881
|
146,619
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractTypes
|
public Map<String, String> extractTypes(XTrace trace) {
return XCostType.instance().extractValues(trace);
}
|
java
|
public Map<String, String> extractTypes(XTrace trace) {
return XCostType.instance().extractValues(trace);
}
|
[
"public",
"Map",
"<",
"String",
",",
"String",
">",
"extractTypes",
"(",
"XTrace",
"trace",
")",
"{",
"return",
"XCostType",
".",
"instance",
"(",
")",
".",
"extractValues",
"(",
"trace",
")",
";",
"}"
] |
Retrieves a map containing all cost types for all child attributes
of a trace.
@see #extractAmounts(XTrace)
@param trace
Trace to retrieve all cost types for.
@return Map from all child keys to cost types.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"types",
"for",
"all",
"child",
"attributes",
"of",
"a",
"trace",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L893-L895
|
146,620
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractTypes
|
public Map<String, String> extractTypes(XEvent event) {
return XCostType.instance().extractValues(event);
}
|
java
|
public Map<String, String> extractTypes(XEvent event) {
return XCostType.instance().extractValues(event);
}
|
[
"public",
"Map",
"<",
"String",
",",
"String",
">",
"extractTypes",
"(",
"XEvent",
"event",
")",
"{",
"return",
"XCostType",
".",
"instance",
"(",
")",
".",
"extractValues",
"(",
"event",
")",
";",
"}"
] |
Retrieves a map containing all cost types for all child attributes
of an event.
@see #extractAmounts(XEvent)
@param event
Event to retrieve all cost types for.
@return Map from all child keys to cost types.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"types",
"for",
"all",
"child",
"attributes",
"of",
"an",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L907-L909
|
146,621
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractNestedTypes
|
public Map<List<String>, String> extractNestedTypes(XTrace trace) {
return XCostType.instance().extractNestedValues(trace);
}
|
java
|
public Map<List<String>, String> extractNestedTypes(XTrace trace) {
return XCostType.instance().extractNestedValues(trace);
}
|
[
"public",
"Map",
"<",
"List",
"<",
"String",
">",
",",
"String",
">",
"extractNestedTypes",
"(",
"XTrace",
"trace",
")",
"{",
"return",
"XCostType",
".",
"instance",
"(",
")",
".",
"extractNestedValues",
"(",
"trace",
")",
";",
"}"
] |
Retrieves a map containing all cost types for all descending attributes
of a trace.
@see #extractNestedAmounts(XTrace)
@param trace
Trace to retrieve all cost types for.
@return Map from all descending keys to cost types.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"types",
"for",
"all",
"descending",
"attributes",
"of",
"a",
"trace",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L921-L923
|
146,622
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.extractNestedTypes
|
public Map<List<String>, String> extractNestedTypes(XEvent event) {
return XCostType.instance().extractNestedValues(event);
}
|
java
|
public Map<List<String>, String> extractNestedTypes(XEvent event) {
return XCostType.instance().extractNestedValues(event);
}
|
[
"public",
"Map",
"<",
"List",
"<",
"String",
">",
",",
"String",
">",
"extractNestedTypes",
"(",
"XEvent",
"event",
")",
"{",
"return",
"XCostType",
".",
"instance",
"(",
")",
".",
"extractNestedValues",
"(",
"event",
")",
";",
"}"
] |
Retrieves a map containing all cost types for all descending attributes
of an event.
@see #extractNestedAmounts(XEvent)
@param event
Event to retrieve all cost types for.
@return Map from all descending keys to cost types.
|
[
"Retrieves",
"a",
"map",
"containing",
"all",
"cost",
"types",
"for",
"all",
"descending",
"attributes",
"of",
"an",
"event",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L935-L937
|
146,623
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XCostExtension.java
|
XCostExtension.assignType
|
public void assignType(XAttribute attribute, String type) {
if (type != null && type.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_TYPE.clone();
attr.setValue(type);
attribute.getAttributes().put(KEY_TYPE, attr);
}
}
|
java
|
public void assignType(XAttribute attribute, String type) {
if (type != null && type.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_TYPE.clone();
attr.setValue(type);
attribute.getAttributes().put(KEY_TYPE, attr);
}
}
|
[
"public",
"void",
"assignType",
"(",
"XAttribute",
"attribute",
",",
"String",
"type",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
"&&",
"type",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"XAttributeLiteral",
"attr",
"=",
"(",
"XAttributeLiteral",
")",
"ATTR_TYPE",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValue",
"(",
"type",
")",
";",
"attribute",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_TYPE",
",",
"attr",
")",
";",
"}",
"}"
] |
Assigns any attribute its cost type, as defined by this extension's type
attribute.
@param attribute
Attribute to assign cost type to.
@param type
The cost type to be assigned.
|
[
"Assigns",
"any",
"attribute",
"its",
"cost",
"type",
"as",
"defined",
"by",
"this",
"extension",
"s",
"type",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L948-L954
|
146,624
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XTimeExtension.java
|
XTimeExtension.extractTimestamp
|
public Date extractTimestamp(XEvent event) {
XAttributeTimestamp timestampAttribute = (XAttributeTimestamp) event
.getAttributes().get(KEY_TIMESTAMP);
if (timestampAttribute == null) {
return null;
} else {
return timestampAttribute.getValue();
}
}
|
java
|
public Date extractTimestamp(XEvent event) {
XAttributeTimestamp timestampAttribute = (XAttributeTimestamp) event
.getAttributes().get(KEY_TIMESTAMP);
if (timestampAttribute == null) {
return null;
} else {
return timestampAttribute.getValue();
}
}
|
[
"public",
"Date",
"extractTimestamp",
"(",
"XEvent",
"event",
")",
"{",
"XAttributeTimestamp",
"timestampAttribute",
"=",
"(",
"XAttributeTimestamp",
")",
"event",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_TIMESTAMP",
")",
";",
"if",
"(",
"timestampAttribute",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"timestampAttribute",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Extracts from a given event the timestamp.
@param event
Event to be queried.
@return The timestamp of this event, as a Date object (may be
<code>null</code> if not defined).
|
[
"Extracts",
"from",
"a",
"given",
"event",
"the",
"timestamp",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XTimeExtension.java#L133-L141
|
146,625
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XTimeExtension.java
|
XTimeExtension.assignTimestamp
|
public void assignTimestamp(XEvent event, long time) {
XAttributeTimestamp attr = (XAttributeTimestamp) ATTR_TIMESTAMP.clone();
attr.setValueMillis(time);
event.getAttributes().put(KEY_TIMESTAMP, attr);
}
|
java
|
public void assignTimestamp(XEvent event, long time) {
XAttributeTimestamp attr = (XAttributeTimestamp) ATTR_TIMESTAMP.clone();
attr.setValueMillis(time);
event.getAttributes().put(KEY_TIMESTAMP, attr);
}
|
[
"public",
"void",
"assignTimestamp",
"(",
"XEvent",
"event",
",",
"long",
"time",
")",
"{",
"XAttributeTimestamp",
"attr",
"=",
"(",
"XAttributeTimestamp",
")",
"ATTR_TIMESTAMP",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValueMillis",
"(",
"time",
")",
";",
"event",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_TIMESTAMP",
",",
"attr",
")",
";",
"}"
] |
Assigns to a given event its timestamp.
@param event
Event to be modified.
@param time
Timestamp, as a long of milliseconds in UNIX time.
|
[
"Assigns",
"to",
"a",
"given",
"event",
"its",
"timestamp",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XTimeExtension.java#L163-L167
|
146,626
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/nikefs2/NikeFS2FileAccessMonitor.java
|
NikeFS2FileAccessMonitor.requestMap
|
public synchronized MappedByteBuffer requestMap(NikeFS2BlockProvider requester)
throws IOException {
// check if requested map is already in shadow
for(int i=0; i<currentShadowSize; i++) {
if(currentMapOwners[i] == requester) {
// requester found in shadow; return shadowed map
lastRequestIndex = i;
return centralMaps[i];
}
}
// check if we can create another shadow map
if(currentShadowSize < shadowSize) {
// create new map in shadow in pristine place
currentMapOwners[currentShadowSize] = requester;
currentMapRandomAccessFiles[currentShadowSize] = new RandomAccessFile(requester.getFile(), "rw");
currentMapFileChannels[currentShadowSize] = currentMapRandomAccessFiles[currentShadowSize].getChannel();
MappedByteBuffer map = currentMapFileChannels[currentShadowSize].map(FileChannel.MapMode.READ_WRITE, 0, requester.size());
centralMaps[currentShadowSize] = map;
lastRequestIndex = currentShadowSize;
currentShadowSize++;
XLogging.log("NikeFS2: Populating shadow map " + currentShadowSize + " (of " + shadowSize + " max.)", Importance.DEBUG);
return map;
} else {
// we need to displace one shadow to make place
int kickIndex = lastRequestIndex + 1;
if(kickIndex == shadowSize) {
kickIndex = 0;
}
centralMaps[kickIndex].force();
centralMaps[kickIndex] = null;
currentMapFileChannels[kickIndex].close();
currentMapFileChannels[kickIndex] = null;
currentMapRandomAccessFiles[kickIndex].close();
currentMapRandomAccessFiles[kickIndex] = null;
System.gc();
currentMapOwners[kickIndex] = requester;
currentMapRandomAccessFiles[kickIndex] = new RandomAccessFile(requester.getFile(), "rw");
currentMapFileChannels[kickIndex] = currentMapRandomAccessFiles[kickIndex].getChannel();
MappedByteBuffer map = currentMapFileChannels[kickIndex].map(FileChannel.MapMode.READ_WRITE, 0, requester.size());
centralMaps[kickIndex] = map;
lastRequestIndex = kickIndex;
XLogging.log("NikeFS2: Displacing shadow map " + (kickIndex + 1),
Importance.DEBUG);
return map;
}
}
|
java
|
public synchronized MappedByteBuffer requestMap(NikeFS2BlockProvider requester)
throws IOException {
// check if requested map is already in shadow
for(int i=0; i<currentShadowSize; i++) {
if(currentMapOwners[i] == requester) {
// requester found in shadow; return shadowed map
lastRequestIndex = i;
return centralMaps[i];
}
}
// check if we can create another shadow map
if(currentShadowSize < shadowSize) {
// create new map in shadow in pristine place
currentMapOwners[currentShadowSize] = requester;
currentMapRandomAccessFiles[currentShadowSize] = new RandomAccessFile(requester.getFile(), "rw");
currentMapFileChannels[currentShadowSize] = currentMapRandomAccessFiles[currentShadowSize].getChannel();
MappedByteBuffer map = currentMapFileChannels[currentShadowSize].map(FileChannel.MapMode.READ_WRITE, 0, requester.size());
centralMaps[currentShadowSize] = map;
lastRequestIndex = currentShadowSize;
currentShadowSize++;
XLogging.log("NikeFS2: Populating shadow map " + currentShadowSize + " (of " + shadowSize + " max.)", Importance.DEBUG);
return map;
} else {
// we need to displace one shadow to make place
int kickIndex = lastRequestIndex + 1;
if(kickIndex == shadowSize) {
kickIndex = 0;
}
centralMaps[kickIndex].force();
centralMaps[kickIndex] = null;
currentMapFileChannels[kickIndex].close();
currentMapFileChannels[kickIndex] = null;
currentMapRandomAccessFiles[kickIndex].close();
currentMapRandomAccessFiles[kickIndex] = null;
System.gc();
currentMapOwners[kickIndex] = requester;
currentMapRandomAccessFiles[kickIndex] = new RandomAccessFile(requester.getFile(), "rw");
currentMapFileChannels[kickIndex] = currentMapRandomAccessFiles[kickIndex].getChannel();
MappedByteBuffer map = currentMapFileChannels[kickIndex].map(FileChannel.MapMode.READ_WRITE, 0, requester.size());
centralMaps[kickIndex] = map;
lastRequestIndex = kickIndex;
XLogging.log("NikeFS2: Displacing shadow map " + (kickIndex + 1),
Importance.DEBUG);
return map;
}
}
|
[
"public",
"synchronized",
"MappedByteBuffer",
"requestMap",
"(",
"NikeFS2BlockProvider",
"requester",
")",
"throws",
"IOException",
"{",
"// check if requested map is already in shadow",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"currentShadowSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"currentMapOwners",
"[",
"i",
"]",
"==",
"requester",
")",
"{",
"// requester found in shadow; return shadowed map",
"lastRequestIndex",
"=",
"i",
";",
"return",
"centralMaps",
"[",
"i",
"]",
";",
"}",
"}",
"// check if we can create another shadow map",
"if",
"(",
"currentShadowSize",
"<",
"shadowSize",
")",
"{",
"// create new map in shadow in pristine place",
"currentMapOwners",
"[",
"currentShadowSize",
"]",
"=",
"requester",
";",
"currentMapRandomAccessFiles",
"[",
"currentShadowSize",
"]",
"=",
"new",
"RandomAccessFile",
"(",
"requester",
".",
"getFile",
"(",
")",
",",
"\"rw\"",
")",
";",
"currentMapFileChannels",
"[",
"currentShadowSize",
"]",
"=",
"currentMapRandomAccessFiles",
"[",
"currentShadowSize",
"]",
".",
"getChannel",
"(",
")",
";",
"MappedByteBuffer",
"map",
"=",
"currentMapFileChannels",
"[",
"currentShadowSize",
"]",
".",
"map",
"(",
"FileChannel",
".",
"MapMode",
".",
"READ_WRITE",
",",
"0",
",",
"requester",
".",
"size",
"(",
")",
")",
";",
"centralMaps",
"[",
"currentShadowSize",
"]",
"=",
"map",
";",
"lastRequestIndex",
"=",
"currentShadowSize",
";",
"currentShadowSize",
"++",
";",
"XLogging",
".",
"log",
"(",
"\"NikeFS2: Populating shadow map \"",
"+",
"currentShadowSize",
"+",
"\" (of \"",
"+",
"shadowSize",
"+",
"\" max.)\"",
",",
"Importance",
".",
"DEBUG",
")",
";",
"return",
"map",
";",
"}",
"else",
"{",
"// we need to displace one shadow to make place",
"int",
"kickIndex",
"=",
"lastRequestIndex",
"+",
"1",
";",
"if",
"(",
"kickIndex",
"==",
"shadowSize",
")",
"{",
"kickIndex",
"=",
"0",
";",
"}",
"centralMaps",
"[",
"kickIndex",
"]",
".",
"force",
"(",
")",
";",
"centralMaps",
"[",
"kickIndex",
"]",
"=",
"null",
";",
"currentMapFileChannels",
"[",
"kickIndex",
"]",
".",
"close",
"(",
")",
";",
"currentMapFileChannels",
"[",
"kickIndex",
"]",
"=",
"null",
";",
"currentMapRandomAccessFiles",
"[",
"kickIndex",
"]",
".",
"close",
"(",
")",
";",
"currentMapRandomAccessFiles",
"[",
"kickIndex",
"]",
"=",
"null",
";",
"System",
".",
"gc",
"(",
")",
";",
"currentMapOwners",
"[",
"kickIndex",
"]",
"=",
"requester",
";",
"currentMapRandomAccessFiles",
"[",
"kickIndex",
"]",
"=",
"new",
"RandomAccessFile",
"(",
"requester",
".",
"getFile",
"(",
")",
",",
"\"rw\"",
")",
";",
"currentMapFileChannels",
"[",
"kickIndex",
"]",
"=",
"currentMapRandomAccessFiles",
"[",
"kickIndex",
"]",
".",
"getChannel",
"(",
")",
";",
"MappedByteBuffer",
"map",
"=",
"currentMapFileChannels",
"[",
"kickIndex",
"]",
".",
"map",
"(",
"FileChannel",
".",
"MapMode",
".",
"READ_WRITE",
",",
"0",
",",
"requester",
".",
"size",
"(",
")",
")",
";",
"centralMaps",
"[",
"kickIndex",
"]",
"=",
"map",
";",
"lastRequestIndex",
"=",
"kickIndex",
";",
"XLogging",
".",
"log",
"(",
"\"NikeFS2: Displacing shadow map \"",
"+",
"(",
"kickIndex",
"+",
"1",
")",
",",
"Importance",
".",
"DEBUG",
")",
";",
"return",
"map",
";",
"}",
"}"
] |
Grants access to the mapped byte buffer on the backing file for
a block provider. This static method implements the backing file
manager, which ensures that only a limited number of backing files
and associated mapped byte buffers are concurrently in use.
@param requester Block provider requesting access.
@return The mapped byte buffer over the requester's backing file.
|
[
"Grants",
"access",
"to",
"the",
"mapped",
"byte",
"buffer",
"on",
"the",
"backing",
"file",
"for",
"a",
"block",
"provider",
".",
"This",
"static",
"method",
"implements",
"the",
"backing",
"file",
"manager",
"which",
"ensures",
"that",
"only",
"a",
"limited",
"number",
"of",
"backing",
"files",
"and",
"associated",
"mapped",
"byte",
"buffers",
"are",
"concurrently",
"in",
"use",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2FileAccessMonitor.java#L117-L162
|
146,627
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Label.java
|
Label.doEndTag
|
public int doEndTag() throws JspException
{
boolean usingDefault = false;
boolean bypassEscape = false;
String scriptId = null;
ServletRequest req = pageContext.getRequest();
Object labelObject = null;
String labelValue = null;
// if this is not client side binding, evalute the value
if (_value != null)
labelObject = _value;
else {
if (_defaultValue != null) {
labelObject = _defaultValue;
bypassEscape = HtmlUtils.containsEntity(_defaultValue.toString());
}
else {
logger.warn(Bundle.getString("Tags_LabelExpressionNull", _value));
labelObject = DEFAULT_NULL_TEXT;
}
usingDefault = true;
}
// we assume that tagId will over have override id if both
// are defined.
if (_state.id != null) {
scriptId = renderNameAndId((HttpServletRequest) req, _state, null);
}
// push the evaluated expression when we are not client side bound...
labelValue = (usingDefault && !_formatDefaultValue) ?
labelObject.toString() : formatText(labelObject);
if (hasErrors())
return reportAndExit(EVAL_PAGE);
// fully qualify the for attribute if it exists
if (_state.forAttr != null) {
_state.forAttr = getIdForTagId(_state.forAttr);
}
WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.LABEL_TAG, req);
br.doStartTag(writer, _state);
// push the evaluated expression when we are not client side bound...
//if (!usingDefault)
// labelValue = formatText(labelValue);
if (!bypassEscape)
filter(labelValue, writer, _escapeWhiteSpace);
else
write(labelValue);
br.doEndTag(writer);
if (scriptId != null)
write(scriptId);
localRelease();
return EVAL_PAGE;
}
|
java
|
public int doEndTag() throws JspException
{
boolean usingDefault = false;
boolean bypassEscape = false;
String scriptId = null;
ServletRequest req = pageContext.getRequest();
Object labelObject = null;
String labelValue = null;
// if this is not client side binding, evalute the value
if (_value != null)
labelObject = _value;
else {
if (_defaultValue != null) {
labelObject = _defaultValue;
bypassEscape = HtmlUtils.containsEntity(_defaultValue.toString());
}
else {
logger.warn(Bundle.getString("Tags_LabelExpressionNull", _value));
labelObject = DEFAULT_NULL_TEXT;
}
usingDefault = true;
}
// we assume that tagId will over have override id if both
// are defined.
if (_state.id != null) {
scriptId = renderNameAndId((HttpServletRequest) req, _state, null);
}
// push the evaluated expression when we are not client side bound...
labelValue = (usingDefault && !_formatDefaultValue) ?
labelObject.toString() : formatText(labelObject);
if (hasErrors())
return reportAndExit(EVAL_PAGE);
// fully qualify the for attribute if it exists
if (_state.forAttr != null) {
_state.forAttr = getIdForTagId(_state.forAttr);
}
WriteRenderAppender writer = new WriteRenderAppender(pageContext);
TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.LABEL_TAG, req);
br.doStartTag(writer, _state);
// push the evaluated expression when we are not client side bound...
//if (!usingDefault)
// labelValue = formatText(labelValue);
if (!bypassEscape)
filter(labelValue, writer, _escapeWhiteSpace);
else
write(labelValue);
br.doEndTag(writer);
if (scriptId != null)
write(scriptId);
localRelease();
return EVAL_PAGE;
}
|
[
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"boolean",
"usingDefault",
"=",
"false",
";",
"boolean",
"bypassEscape",
"=",
"false",
";",
"String",
"scriptId",
"=",
"null",
";",
"ServletRequest",
"req",
"=",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"Object",
"labelObject",
"=",
"null",
";",
"String",
"labelValue",
"=",
"null",
";",
"// if this is not client side binding, evalute the value",
"if",
"(",
"_value",
"!=",
"null",
")",
"labelObject",
"=",
"_value",
";",
"else",
"{",
"if",
"(",
"_defaultValue",
"!=",
"null",
")",
"{",
"labelObject",
"=",
"_defaultValue",
";",
"bypassEscape",
"=",
"HtmlUtils",
".",
"containsEntity",
"(",
"_defaultValue",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"logger",
".",
"warn",
"(",
"Bundle",
".",
"getString",
"(",
"\"Tags_LabelExpressionNull\"",
",",
"_value",
")",
")",
";",
"labelObject",
"=",
"DEFAULT_NULL_TEXT",
";",
"}",
"usingDefault",
"=",
"true",
";",
"}",
"// we assume that tagId will over have override id if both",
"// are defined.",
"if",
"(",
"_state",
".",
"id",
"!=",
"null",
")",
"{",
"scriptId",
"=",
"renderNameAndId",
"(",
"(",
"HttpServletRequest",
")",
"req",
",",
"_state",
",",
"null",
")",
";",
"}",
"// push the evaluated expression when we are not client side bound...",
"labelValue",
"=",
"(",
"usingDefault",
"&&",
"!",
"_formatDefaultValue",
")",
"?",
"labelObject",
".",
"toString",
"(",
")",
":",
"formatText",
"(",
"labelObject",
")",
";",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"reportAndExit",
"(",
"EVAL_PAGE",
")",
";",
"// fully qualify the for attribute if it exists",
"if",
"(",
"_state",
".",
"forAttr",
"!=",
"null",
")",
"{",
"_state",
".",
"forAttr",
"=",
"getIdForTagId",
"(",
"_state",
".",
"forAttr",
")",
";",
"}",
"WriteRenderAppender",
"writer",
"=",
"new",
"WriteRenderAppender",
"(",
"pageContext",
")",
";",
"TagRenderingBase",
"br",
"=",
"TagRenderingBase",
".",
"Factory",
".",
"getRendering",
"(",
"TagRenderingBase",
".",
"LABEL_TAG",
",",
"req",
")",
";",
"br",
".",
"doStartTag",
"(",
"writer",
",",
"_state",
")",
";",
"// push the evaluated expression when we are not client side bound...",
"//if (!usingDefault)",
"// labelValue = formatText(labelValue);",
"if",
"(",
"!",
"bypassEscape",
")",
"filter",
"(",
"labelValue",
",",
"writer",
",",
"_escapeWhiteSpace",
")",
";",
"else",
"write",
"(",
"labelValue",
")",
";",
"br",
".",
"doEndTag",
"(",
"writer",
")",
";",
"if",
"(",
"scriptId",
"!=",
"null",
")",
"write",
"(",
"scriptId",
")",
";",
"localRelease",
"(",
")",
";",
"return",
"EVAL_PAGE",
";",
"}"
] |
Render the label.
@throws JspException if a JSP exception has occurred
|
[
"Render",
"the",
"label",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Label.java#L90-L154
|
146,628
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/LogView.java
|
LogView.addFilter
|
public void addFilter(AbstractLogFilter<E> filter) {
Validate.notNull(filter);
filters.add(filter);
uptodate = false;
filter.addObserver(this);
}
|
java
|
public void addFilter(AbstractLogFilter<E> filter) {
Validate.notNull(filter);
filters.add(filter);
uptodate = false;
filter.addObserver(this);
}
|
[
"public",
"void",
"addFilter",
"(",
"AbstractLogFilter",
"<",
"E",
">",
"filter",
")",
"{",
"Validate",
".",
"notNull",
"(",
"filter",
")",
";",
"filters",
".",
"add",
"(",
"filter",
")",
";",
"uptodate",
"=",
"false",
";",
"filter",
".",
"addObserver",
"(",
"this",
")",
";",
"}"
] |
Adds a new filter to the view.
@param filter
|
[
"Adds",
"a",
"new",
"filter",
"to",
"the",
"view",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/LogView.java#L77-L82
|
146,629
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/LogView.java
|
LogView.removeFilter
|
public void removeFilter(AbstractLogFilter<E> filter) {
Validate.notNull(filter);
filters.remove(filter);
uptodate = false;
filter.deleteObserver(this);
}
|
java
|
public void removeFilter(AbstractLogFilter<E> filter) {
Validate.notNull(filter);
filters.remove(filter);
uptodate = false;
filter.deleteObserver(this);
}
|
[
"public",
"void",
"removeFilter",
"(",
"AbstractLogFilter",
"<",
"E",
">",
"filter",
")",
"{",
"Validate",
".",
"notNull",
"(",
"filter",
")",
";",
"filters",
".",
"remove",
"(",
"filter",
")",
";",
"uptodate",
"=",
"false",
";",
"filter",
".",
"deleteObserver",
"(",
"this",
")",
";",
"}"
] |
Removes a filter to the view.
@param filter
|
[
"Removes",
"a",
"filter",
"to",
"the",
"view",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/LogView.java#L89-L94
|
146,630
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/LogView.java
|
LogView.update
|
private void update() {
if (!uptodate) {
summary.clear();
distinctTraces.clear();
traces.clear();
addTraces(allTraces, false);
uptodate = true;
}
}
|
java
|
private void update() {
if (!uptodate) {
summary.clear();
distinctTraces.clear();
traces.clear();
addTraces(allTraces, false);
uptodate = true;
}
}
|
[
"private",
"void",
"update",
"(",
")",
"{",
"if",
"(",
"!",
"uptodate",
")",
"{",
"summary",
".",
"clear",
"(",
")",
";",
"distinctTraces",
".",
"clear",
"(",
")",
";",
"traces",
".",
"clear",
"(",
")",
";",
"addTraces",
"(",
"allTraces",
",",
"false",
")",
";",
"uptodate",
"=",
"true",
";",
"}",
"}"
] |
Updates the summary, set of distinct traces and list of traces if the
filter set has been changed.
|
[
"Updates",
"the",
"summary",
"set",
"of",
"distinct",
"traces",
"and",
"list",
"of",
"traces",
"if",
"the",
"filter",
"set",
"has",
"been",
"changed",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/LogView.java#L175-L183
|
146,631
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/filter/TimeFilter.java
|
TimeFilter.setStartDate
|
public final void setStartDate(Date startDate) {
if (this.startDate == null || !this.startDate.equals(startDate)) {
if (startDate != null && endDate != null && endDate.before(startDate)) {
throw new ParameterException("The start date must be before the end date of the filter.");
}
this.startDate = startDate;
setChanged();
notifyObservers();
}
}
|
java
|
public final void setStartDate(Date startDate) {
if (this.startDate == null || !this.startDate.equals(startDate)) {
if (startDate != null && endDate != null && endDate.before(startDate)) {
throw new ParameterException("The start date must be before the end date of the filter.");
}
this.startDate = startDate;
setChanged();
notifyObservers();
}
}
|
[
"public",
"final",
"void",
"setStartDate",
"(",
"Date",
"startDate",
")",
"{",
"if",
"(",
"this",
".",
"startDate",
"==",
"null",
"||",
"!",
"this",
".",
"startDate",
".",
"equals",
"(",
"startDate",
")",
")",
"{",
"if",
"(",
"startDate",
"!=",
"null",
"&&",
"endDate",
"!=",
"null",
"&&",
"endDate",
".",
"before",
"(",
"startDate",
")",
")",
"{",
"throw",
"new",
"ParameterException",
"(",
"\"The start date must be before the end date of the filter.\"",
")",
";",
"}",
"this",
".",
"startDate",
"=",
"startDate",
";",
"setChanged",
"(",
")",
";",
"notifyObservers",
"(",
")",
";",
"}",
"}"
] |
Sets the start date.
@param startDate
|
[
"Sets",
"the",
"start",
"date",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/filter/TimeFilter.java#L110-L119
|
146,632
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/filter/TimeFilter.java
|
TimeFilter.setEndDate
|
public final void setEndDate(Date endDate) {
if (this.endDate == null || !this.endDate.equals(endDate)) {
if (endDate != null && startDate != null && endDate.before(startDate)) {
throw new ParameterException("The start date must be before the end date of the filter.");
}
this.endDate = endDate;
setChanged();
notifyObservers();
}
}
|
java
|
public final void setEndDate(Date endDate) {
if (this.endDate == null || !this.endDate.equals(endDate)) {
if (endDate != null && startDate != null && endDate.before(startDate)) {
throw new ParameterException("The start date must be before the end date of the filter.");
}
this.endDate = endDate;
setChanged();
notifyObservers();
}
}
|
[
"public",
"final",
"void",
"setEndDate",
"(",
"Date",
"endDate",
")",
"{",
"if",
"(",
"this",
".",
"endDate",
"==",
"null",
"||",
"!",
"this",
".",
"endDate",
".",
"equals",
"(",
"endDate",
")",
")",
"{",
"if",
"(",
"endDate",
"!=",
"null",
"&&",
"startDate",
"!=",
"null",
"&&",
"endDate",
".",
"before",
"(",
"startDate",
")",
")",
"{",
"throw",
"new",
"ParameterException",
"(",
"\"The start date must be before the end date of the filter.\"",
")",
";",
"}",
"this",
".",
"endDate",
"=",
"endDate",
";",
"setChanged",
"(",
")",
";",
"notifyObservers",
"(",
")",
";",
"}",
"}"
] |
Sets the end date.
@param endDate
|
[
"Sets",
"the",
"end",
"date",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/filter/TimeFilter.java#L126-L135
|
146,633
|
iig-uni-freiburg/SEWOL
|
src/de/uni/freiburg/iig/telematik/sewol/log/filter/TimeFilter.java
|
TimeFilter.getType
|
public TimeFrameFilterType getType() {
if (startDate == null && endDate == null) {
return TimeFrameFilterType.INOPERATIVE;
} else if (startDate != null && endDate == null) {
return TimeFrameFilterType.MIN_DATE;
} else if (startDate == null && endDate != null) {
return TimeFrameFilterType.MAX_DATE;
} else {
return TimeFrameFilterType.TIMEFRAME;
}
}
|
java
|
public TimeFrameFilterType getType() {
if (startDate == null && endDate == null) {
return TimeFrameFilterType.INOPERATIVE;
} else if (startDate != null && endDate == null) {
return TimeFrameFilterType.MIN_DATE;
} else if (startDate == null && endDate != null) {
return TimeFrameFilterType.MAX_DATE;
} else {
return TimeFrameFilterType.TIMEFRAME;
}
}
|
[
"public",
"TimeFrameFilterType",
"getType",
"(",
")",
"{",
"if",
"(",
"startDate",
"==",
"null",
"&&",
"endDate",
"==",
"null",
")",
"{",
"return",
"TimeFrameFilterType",
".",
"INOPERATIVE",
";",
"}",
"else",
"if",
"(",
"startDate",
"!=",
"null",
"&&",
"endDate",
"==",
"null",
")",
"{",
"return",
"TimeFrameFilterType",
".",
"MIN_DATE",
";",
"}",
"else",
"if",
"(",
"startDate",
"==",
"null",
"&&",
"endDate",
"!=",
"null",
")",
"{",
"return",
"TimeFrameFilterType",
".",
"MAX_DATE",
";",
"}",
"else",
"{",
"return",
"TimeFrameFilterType",
".",
"TIMEFRAME",
";",
"}",
"}"
] |
Returns the type of the time filter.
@return
|
[
"Returns",
"the",
"type",
"of",
"the",
"time",
"filter",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/filter/TimeFilter.java#L155-L165
|
146,634
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/IdentifierToken.java
|
IdentifierToken.read
|
public Object read(Object object) {
if(object == null) {
String msg = "Can not evaluate the identifier \"" + _identifier + "\" on a null object.";
LOGGER.error(msg);
throw new RuntimeException(msg);
}
if(TRACE_ENABLED)
LOGGER.trace("Read property " + _identifier + " on object of type " + object.getClass().getName());
if(object instanceof Map)
return mapLookup((Map)object, _identifier);
else if(object instanceof List) {
int i = parseIndex(_identifier);
return listLookup((List)object, i);
}
else if(object.getClass().isArray()) {
int i = parseIndex(_identifier);
return arrayLookup(object, i);
}
else return beanLookup(object, _identifier);
}
|
java
|
public Object read(Object object) {
if(object == null) {
String msg = "Can not evaluate the identifier \"" + _identifier + "\" on a null object.";
LOGGER.error(msg);
throw new RuntimeException(msg);
}
if(TRACE_ENABLED)
LOGGER.trace("Read property " + _identifier + " on object of type " + object.getClass().getName());
if(object instanceof Map)
return mapLookup((Map)object, _identifier);
else if(object instanceof List) {
int i = parseIndex(_identifier);
return listLookup((List)object, i);
}
else if(object.getClass().isArray()) {
int i = parseIndex(_identifier);
return arrayLookup(object, i);
}
else return beanLookup(object, _identifier);
}
|
[
"public",
"Object",
"read",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"Can not evaluate the identifier \\\"\"",
"+",
"_identifier",
"+",
"\"\\\" on a null object.\"",
";",
"LOGGER",
".",
"error",
"(",
"msg",
")",
";",
"throw",
"new",
"RuntimeException",
"(",
"msg",
")",
";",
"}",
"if",
"(",
"TRACE_ENABLED",
")",
"LOGGER",
".",
"trace",
"(",
"\"Read property \"",
"+",
"_identifier",
"+",
"\" on object of type \"",
"+",
"object",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"object",
"instanceof",
"Map",
")",
"return",
"mapLookup",
"(",
"(",
"Map",
")",
"object",
",",
"_identifier",
")",
";",
"else",
"if",
"(",
"object",
"instanceof",
"List",
")",
"{",
"int",
"i",
"=",
"parseIndex",
"(",
"_identifier",
")",
";",
"return",
"listLookup",
"(",
"(",
"List",
")",
"object",
",",
"i",
")",
";",
"}",
"else",
"if",
"(",
"object",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
")",
"{",
"int",
"i",
"=",
"parseIndex",
"(",
"_identifier",
")",
";",
"return",
"arrayLookup",
"(",
"object",
",",
"i",
")",
";",
"}",
"else",
"return",
"beanLookup",
"(",
"object",
",",
"_identifier",
")",
";",
"}"
] |
Read the object represetned by this token from the given object.
@param object the object from which to read
@return the read object
|
[
"Read",
"the",
"object",
"represetned",
"by",
"this",
"token",
"from",
"the",
"given",
"object",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/IdentifierToken.java#L48-L69
|
146,635
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XIdentityExtension.java
|
XIdentityExtension.extractID
|
public XID extractID(XAttributable element) {
XAttribute attribute = element.getAttributes().get(KEY_ID);
if (attribute == null) {
return null;
} else {
return ((XAttributeID) attribute).getValue();
}
}
|
java
|
public XID extractID(XAttributable element) {
XAttribute attribute = element.getAttributes().get(KEY_ID);
if (attribute == null) {
return null;
} else {
return ((XAttributeID) attribute).getValue();
}
}
|
[
"public",
"XID",
"extractID",
"(",
"XAttributable",
"element",
")",
"{",
"XAttribute",
"attribute",
"=",
"element",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"KEY_ID",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"(",
"XAttributeID",
")",
"attribute",
")",
".",
"getValue",
"(",
")",
";",
"}",
"}"
] |
Retrieves the id of a log data hierarchy element, if set by this
extension's id attribute.
@param element
Log hierarchy element to extract name from.
@return The requested element id.
|
[
"Retrieves",
"the",
"id",
"of",
"a",
"log",
"data",
"hierarchy",
"element",
"if",
"set",
"by",
"this",
"extension",
"s",
"id",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XIdentityExtension.java#L129-L136
|
146,636
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/extension/std/XIdentityExtension.java
|
XIdentityExtension.assignID
|
public void assignID(XAttributable element, XID id) {
if (id != null) {
XAttributeID attr = (XAttributeID) ATTR_ID.clone();
attr.setValue(id);
element.getAttributes().put(KEY_ID, attr);
}
}
|
java
|
public void assignID(XAttributable element, XID id) {
if (id != null) {
XAttributeID attr = (XAttributeID) ATTR_ID.clone();
attr.setValue(id);
element.getAttributes().put(KEY_ID, attr);
}
}
|
[
"public",
"void",
"assignID",
"(",
"XAttributable",
"element",
",",
"XID",
"id",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
")",
"{",
"XAttributeID",
"attr",
"=",
"(",
"XAttributeID",
")",
"ATTR_ID",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValue",
"(",
"id",
")",
";",
"element",
".",
"getAttributes",
"(",
")",
".",
"put",
"(",
"KEY_ID",
",",
"attr",
")",
";",
"}",
"}"
] |
Assigns any log data hierarchy element its id, as defined by this
extension's id attribute.
@param element
Log hierarchy element to assign id to.
@param id
The id to be assigned.
|
[
"Assigns",
"any",
"log",
"data",
"hierarchy",
"element",
"its",
"id",
"as",
"defined",
"by",
"this",
"extension",
"s",
"id",
"attribute",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XIdentityExtension.java#L147-L153
|
146,637
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
|
ValidatableField.mergeDependsList
|
void mergeDependsList(Element element)
{
String depends = getElementAttribute(element, "depends");
StringBuffer updatedDepends = new StringBuffer();
if ( depends != null ) {
updatedDepends.append( depends );
}
else {
depends = "";
}
ArrayList rules = new ArrayList();
for ( Iterator i = _rules.iterator(); i.hasNext(); )
{
ValidatorRule rule = ( ValidatorRule ) i.next();
String name = rule.getRuleName();
if ( depends.indexOf( name ) == -1 ) rules.add( name );
}
Collections.sort( rules );
for ( Iterator i = rules.iterator(); i.hasNext(); )
{
if ( updatedDepends.length() > 0 ) updatedDepends.append( ',' );
updatedDepends.append( ( String ) i.next() );
}
if ( updatedDepends.length() != 0 )
{
element.setAttribute("depends", updatedDepends.toString());
}
}
|
java
|
void mergeDependsList(Element element)
{
String depends = getElementAttribute(element, "depends");
StringBuffer updatedDepends = new StringBuffer();
if ( depends != null ) {
updatedDepends.append( depends );
}
else {
depends = "";
}
ArrayList rules = new ArrayList();
for ( Iterator i = _rules.iterator(); i.hasNext(); )
{
ValidatorRule rule = ( ValidatorRule ) i.next();
String name = rule.getRuleName();
if ( depends.indexOf( name ) == -1 ) rules.add( name );
}
Collections.sort( rules );
for ( Iterator i = rules.iterator(); i.hasNext(); )
{
if ( updatedDepends.length() > 0 ) updatedDepends.append( ',' );
updatedDepends.append( ( String ) i.next() );
}
if ( updatedDepends.length() != 0 )
{
element.setAttribute("depends", updatedDepends.toString());
}
}
|
[
"void",
"mergeDependsList",
"(",
"Element",
"element",
")",
"{",
"String",
"depends",
"=",
"getElementAttribute",
"(",
"element",
",",
"\"depends\"",
")",
";",
"StringBuffer",
"updatedDepends",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"if",
"(",
"depends",
"!=",
"null",
")",
"{",
"updatedDepends",
".",
"append",
"(",
"depends",
")",
";",
"}",
"else",
"{",
"depends",
"=",
"\"\"",
";",
"}",
"ArrayList",
"rules",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"Iterator",
"i",
"=",
"_rules",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"ValidatorRule",
"rule",
"=",
"(",
"ValidatorRule",
")",
"i",
".",
"next",
"(",
")",
";",
"String",
"name",
"=",
"rule",
".",
"getRuleName",
"(",
")",
";",
"if",
"(",
"depends",
".",
"indexOf",
"(",
"name",
")",
"==",
"-",
"1",
")",
"rules",
".",
"add",
"(",
"name",
")",
";",
"}",
"Collections",
".",
"sort",
"(",
"rules",
")",
";",
"for",
"(",
"Iterator",
"i",
"=",
"rules",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"if",
"(",
"updatedDepends",
".",
"length",
"(",
")",
">",
"0",
")",
"updatedDepends",
".",
"append",
"(",
"'",
"'",
")",
";",
"updatedDepends",
".",
"append",
"(",
"(",
"String",
")",
"i",
".",
"next",
"(",
")",
")",
";",
"}",
"if",
"(",
"updatedDepends",
".",
"length",
"(",
")",
"!=",
"0",
")",
"{",
"element",
".",
"setAttribute",
"(",
"\"depends\"",
",",
"updatedDepends",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] |
Merge the rule names with the list in the field element's depends attribute.
|
[
"Merge",
"the",
"rule",
"names",
"with",
"the",
"list",
"in",
"the",
"field",
"element",
"s",
"depends",
"attribute",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java#L84-L116
|
146,638
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
|
ValidatableField.setDefaultArg0Element
|
void setDefaultArg0Element(XmlModelWriter xw, String displayName, boolean displayNameIsResource, Element element)
{
Element defaultArg0Element = getArgElement(xw, element, 0, null, _rules.size() > 0);
if (defaultArg0Element != null)
{
setElementAttribute(defaultArg0Element, "key", displayName);
setElementAttribute(defaultArg0Element, "resource", Boolean.toString(displayNameIsResource));
defaultArg0Element.removeAttribute("bundle");
}
}
|
java
|
void setDefaultArg0Element(XmlModelWriter xw, String displayName, boolean displayNameIsResource, Element element)
{
Element defaultArg0Element = getArgElement(xw, element, 0, null, _rules.size() > 0);
if (defaultArg0Element != null)
{
setElementAttribute(defaultArg0Element, "key", displayName);
setElementAttribute(defaultArg0Element, "resource", Boolean.toString(displayNameIsResource));
defaultArg0Element.removeAttribute("bundle");
}
}
|
[
"void",
"setDefaultArg0Element",
"(",
"XmlModelWriter",
"xw",
",",
"String",
"displayName",
",",
"boolean",
"displayNameIsResource",
",",
"Element",
"element",
")",
"{",
"Element",
"defaultArg0Element",
"=",
"getArgElement",
"(",
"xw",
",",
"element",
",",
"0",
",",
"null",
",",
"_rules",
".",
"size",
"(",
")",
">",
"0",
")",
";",
"if",
"(",
"defaultArg0Element",
"!=",
"null",
")",
"{",
"setElementAttribute",
"(",
"defaultArg0Element",
",",
"\"key\"",
",",
"displayName",
")",
";",
"setElementAttribute",
"(",
"defaultArg0Element",
",",
"\"resource\"",
",",
"Boolean",
".",
"toString",
"(",
"displayNameIsResource",
")",
")",
";",
"defaultArg0Element",
".",
"removeAttribute",
"(",
"\"bundle\"",
")",
";",
"}",
"}"
] |
Find or create a default arg 0 element not associated with a specific rule and set it to the display name.
|
[
"Find",
"or",
"create",
"a",
"default",
"arg",
"0",
"element",
"not",
"associated",
"with",
"a",
"specific",
"rule",
"and",
"set",
"it",
"to",
"the",
"display",
"name",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java#L218-L228
|
146,639
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
|
ValidatableField.setRuleMessage
|
void setRuleMessage(XmlModelWriter xw, ValidatorRule rule, Element element)
{
String messageKey = rule.getMessageKey();
String message = rule.getMessage();
if ( messageKey != null || message != null )
{
Element msgElementToUse = findChildElement(xw, element, "msg", "name", rule.getRuleName(), true, null);
setElementAttribute(msgElementToUse, "resource", true);
if ( messageKey != null )
{
setElementAttribute(msgElementToUse, "key", messageKey);
if (_isValidatorOneOne) {
setElementAttribute(msgElementToUse, "bundle", rule.getBundle());
}
}
else // message != null (it's a hardcoded message)
{
// Add our special constant as the message key, append the hardcoded message to it.
setElementAttribute(msgElementToUse, "key", ValidatorConstants.EXPRESSION_KEY_PREFIX + message);
}
}
}
|
java
|
void setRuleMessage(XmlModelWriter xw, ValidatorRule rule, Element element)
{
String messageKey = rule.getMessageKey();
String message = rule.getMessage();
if ( messageKey != null || message != null )
{
Element msgElementToUse = findChildElement(xw, element, "msg", "name", rule.getRuleName(), true, null);
setElementAttribute(msgElementToUse, "resource", true);
if ( messageKey != null )
{
setElementAttribute(msgElementToUse, "key", messageKey);
if (_isValidatorOneOne) {
setElementAttribute(msgElementToUse, "bundle", rule.getBundle());
}
}
else // message != null (it's a hardcoded message)
{
// Add our special constant as the message key, append the hardcoded message to it.
setElementAttribute(msgElementToUse, "key", ValidatorConstants.EXPRESSION_KEY_PREFIX + message);
}
}
}
|
[
"void",
"setRuleMessage",
"(",
"XmlModelWriter",
"xw",
",",
"ValidatorRule",
"rule",
",",
"Element",
"element",
")",
"{",
"String",
"messageKey",
"=",
"rule",
".",
"getMessageKey",
"(",
")",
";",
"String",
"message",
"=",
"rule",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"messageKey",
"!=",
"null",
"||",
"message",
"!=",
"null",
")",
"{",
"Element",
"msgElementToUse",
"=",
"findChildElement",
"(",
"xw",
",",
"element",
",",
"\"msg\"",
",",
"\"name\"",
",",
"rule",
".",
"getRuleName",
"(",
")",
",",
"true",
",",
"null",
")",
";",
"setElementAttribute",
"(",
"msgElementToUse",
",",
"\"resource\"",
",",
"true",
")",
";",
"if",
"(",
"messageKey",
"!=",
"null",
")",
"{",
"setElementAttribute",
"(",
"msgElementToUse",
",",
"\"key\"",
",",
"messageKey",
")",
";",
"if",
"(",
"_isValidatorOneOne",
")",
"{",
"setElementAttribute",
"(",
"msgElementToUse",
",",
"\"bundle\"",
",",
"rule",
".",
"getBundle",
"(",
")",
")",
";",
"}",
"}",
"else",
"// message != null (it's a hardcoded message)",
"{",
"// Add our special constant as the message key, append the hardcoded message to it.",
"setElementAttribute",
"(",
"msgElementToUse",
",",
"\"key\"",
",",
"ValidatorConstants",
".",
"EXPRESSION_KEY_PREFIX",
"+",
"message",
")",
";",
"}",
"}",
"}"
] |
Set up the desired <msg> element and attributes for the given rule.
@param rule the rule with the message to use
|
[
"Set",
"up",
"the",
"desired",
"<",
";",
"msg>",
";",
"element",
"and",
"attributes",
"for",
"the",
"given",
"rule",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java#L235-L258
|
146,640
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
|
ValidatableField.setRuleArg
|
void setRuleArg(XmlModelWriter xw, ValidatorRule rule, int argNum, Element element, String altMessageVar)
{
Integer argPosition = new Integer( argNum );
ValidatorRule.MessageArg arg = rule.getArg( argPosition );
if ( arg != null || altMessageVar != null )
{
String ruleName = rule.getRuleName();
Element argElementToUse = getArgElement(xw, element, argNum, ruleName, true);
if ( arg != null )
{
String argMessage = arg.getMessage();
String key = arg.isKey() ? argMessage : ValidatorConstants.EXPRESSION_KEY_PREFIX + argMessage;
setElementAttribute(argElementToUse, "key", key);
setElementAttribute(argElementToUse, "resource", true);
if (arg.isKey() && _isValidatorOneOne) {
setElementAttribute(argElementToUse, "bundle", rule.getBundle());
}
}
else
{
altMessageVar = "${var:" + altMessageVar + '}';
setElementAttribute(argElementToUse, "key", altMessageVar);
setElementAttribute(argElementToUse, "resource", "false");
}
setElementAttribute(argElementToUse, "name", ruleName);
}
}
|
java
|
void setRuleArg(XmlModelWriter xw, ValidatorRule rule, int argNum, Element element, String altMessageVar)
{
Integer argPosition = new Integer( argNum );
ValidatorRule.MessageArg arg = rule.getArg( argPosition );
if ( arg != null || altMessageVar != null )
{
String ruleName = rule.getRuleName();
Element argElementToUse = getArgElement(xw, element, argNum, ruleName, true);
if ( arg != null )
{
String argMessage = arg.getMessage();
String key = arg.isKey() ? argMessage : ValidatorConstants.EXPRESSION_KEY_PREFIX + argMessage;
setElementAttribute(argElementToUse, "key", key);
setElementAttribute(argElementToUse, "resource", true);
if (arg.isKey() && _isValidatorOneOne) {
setElementAttribute(argElementToUse, "bundle", rule.getBundle());
}
}
else
{
altMessageVar = "${var:" + altMessageVar + '}';
setElementAttribute(argElementToUse, "key", altMessageVar);
setElementAttribute(argElementToUse, "resource", "false");
}
setElementAttribute(argElementToUse, "name", ruleName);
}
}
|
[
"void",
"setRuleArg",
"(",
"XmlModelWriter",
"xw",
",",
"ValidatorRule",
"rule",
",",
"int",
"argNum",
",",
"Element",
"element",
",",
"String",
"altMessageVar",
")",
"{",
"Integer",
"argPosition",
"=",
"new",
"Integer",
"(",
"argNum",
")",
";",
"ValidatorRule",
".",
"MessageArg",
"arg",
"=",
"rule",
".",
"getArg",
"(",
"argPosition",
")",
";",
"if",
"(",
"arg",
"!=",
"null",
"||",
"altMessageVar",
"!=",
"null",
")",
"{",
"String",
"ruleName",
"=",
"rule",
".",
"getRuleName",
"(",
")",
";",
"Element",
"argElementToUse",
"=",
"getArgElement",
"(",
"xw",
",",
"element",
",",
"argNum",
",",
"ruleName",
",",
"true",
")",
";",
"if",
"(",
"arg",
"!=",
"null",
")",
"{",
"String",
"argMessage",
"=",
"arg",
".",
"getMessage",
"(",
")",
";",
"String",
"key",
"=",
"arg",
".",
"isKey",
"(",
")",
"?",
"argMessage",
":",
"ValidatorConstants",
".",
"EXPRESSION_KEY_PREFIX",
"+",
"argMessage",
";",
"setElementAttribute",
"(",
"argElementToUse",
",",
"\"key\"",
",",
"key",
")",
";",
"setElementAttribute",
"(",
"argElementToUse",
",",
"\"resource\"",
",",
"true",
")",
";",
"if",
"(",
"arg",
".",
"isKey",
"(",
")",
"&&",
"_isValidatorOneOne",
")",
"{",
"setElementAttribute",
"(",
"argElementToUse",
",",
"\"bundle\"",
",",
"rule",
".",
"getBundle",
"(",
")",
")",
";",
"}",
"}",
"else",
"{",
"altMessageVar",
"=",
"\"${var:\"",
"+",
"altMessageVar",
"+",
"'",
"'",
";",
"setElementAttribute",
"(",
"argElementToUse",
",",
"\"key\"",
",",
"altMessageVar",
")",
";",
"setElementAttribute",
"(",
"argElementToUse",
",",
"\"resource\"",
",",
"\"false\"",
")",
";",
"}",
"setElementAttribute",
"(",
"argElementToUse",
",",
"\"name\"",
",",
"ruleName",
")",
";",
"}",
"}"
] |
Set up the desired <arg> element and attributes for the given rule.
@param rule the rule with the message and arg information to use
@param argNum the position of the arg in the message
@param element a <code><field></code> element in the validation XML to update
@param altMessageVar alternative message var
|
[
"Set",
"up",
"the",
"desired",
"<",
";",
"arg>",
";",
"element",
"and",
"attributes",
"for",
"the",
"given",
"rule",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java#L268-L297
|
146,641
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
|
SpanCell.setTitle
|
public void setTitle(String title) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
}
|
java
|
public void setTitle(String title) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
}
|
[
"public",
"void",
"setTitle",
"(",
"String",
"title",
")",
"{",
"_spanState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"TITLE",
",",
"title",
")",
";",
"}"
] |
Sets the value of the title attribute for the HTML span.
@param title
@jsptagref.attributedescription The title for the HTML span.
@jsptagref.attributesyntaxvalue <i>string_title</i>
@netui:attribute required="false" rtexprvalue="true" description="The title for the HTML span."
|
[
"Sets",
"the",
"value",
"of",
"the",
"title",
"attribute",
"for",
"the",
"HTML",
"span",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L248-L250
|
146,642
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
|
SpanCell.setLang
|
public void setLang(String lang)
{
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LANG, lang);
}
|
java
|
public void setLang(String lang)
{
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LANG, lang);
}
|
[
"public",
"void",
"setLang",
"(",
"String",
"lang",
")",
"{",
"_spanState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"LANG",
",",
"lang",
")",
";",
"}"
] |
Sets the lang attribute for the HTML span.
@param lang
@jsptagref.attributedescription The lang for the HTML span.
@jsptagref.attributesyntaxvalue <i>string_lang</i>
@netui:attribute required="false" rtexprvalue="true"
description="The lang for the HTML span"
|
[
"Sets",
"the",
"lang",
"attribute",
"for",
"the",
"HTML",
"span",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L260-L263
|
146,643
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
|
SpanCell.setDir
|
public void setDir(String dir)
{
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.DIR, dir);
}
|
java
|
public void setDir(String dir)
{
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.DIR, dir);
}
|
[
"public",
"void",
"setDir",
"(",
"String",
"dir",
")",
"{",
"_spanState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"DIR",
",",
"dir",
")",
";",
"}"
] |
Sets the dir attribute for the HTML span.
@param dir
@jsptagref.attributedescription The dir.
@jsptagref.attributesyntaxvalue <i>string_dir</i>
@netui:attribute required="false" rtexprvalue="true"
description="The dir for the HTML span."
|
[
"Sets",
"the",
"dir",
"attribute",
"for",
"the",
"HTML",
"span",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L273-L276
|
146,644
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
|
SpanCell.renderDataCellContents
|
protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) {
/* render any JavaScript needed to support framework features */
if (_spanState.id != null) {
HttpServletRequest request = JspUtil.getRequest(getJspContext());
String script = renderNameAndId(request, _spanState, null);
if(script != null)
_spanCellModel.setJavascript(script);
}
DECORATOR.decorate(getJspContext(), appender, _spanCellModel);
}
|
java
|
protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) {
/* render any JavaScript needed to support framework features */
if (_spanState.id != null) {
HttpServletRequest request = JspUtil.getRequest(getJspContext());
String script = renderNameAndId(request, _spanState, null);
if(script != null)
_spanCellModel.setJavascript(script);
}
DECORATOR.decorate(getJspContext(), appender, _spanCellModel);
}
|
[
"protected",
"void",
"renderDataCellContents",
"(",
"AbstractRenderAppender",
"appender",
",",
"String",
"jspFragmentOutput",
")",
"{",
"/* render any JavaScript needed to support framework features */",
"if",
"(",
"_spanState",
".",
"id",
"!=",
"null",
")",
"{",
"HttpServletRequest",
"request",
"=",
"JspUtil",
".",
"getRequest",
"(",
"getJspContext",
"(",
")",
")",
";",
"String",
"script",
"=",
"renderNameAndId",
"(",
"request",
",",
"_spanState",
",",
"null",
")",
";",
"if",
"(",
"script",
"!=",
"null",
")",
"_spanCellModel",
".",
"setJavascript",
"(",
"script",
")",
";",
"}",
"DECORATOR",
".",
"decorate",
"(",
"getJspContext",
"(",
")",
",",
"appender",
",",
"_spanCellModel",
")",
";",
"}"
] |
Render the cell's contents. This method implements support for executing the span cell's decorator.
@param appender the {@link AbstractRenderAppender} used to collect the rendered output
@param jspFragmentOutput the String result of having evaluated the span cell's {@link javax.servlet.jsp.tagext.JspFragment}
|
[
"Render",
"the",
"cell",
"s",
"contents",
".",
"This",
"method",
"implements",
"support",
"for",
"executing",
"the",
"span",
"cell",
"s",
"decorator",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L343-L353
|
146,645
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBean.java
|
FacesBackingBean.removeFromSession
|
public void removeFromSession( HttpServletRequest request )
{
StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
RequestContext rc = new RequestContext( unwrappedRequest, null );
String attrName =
ScopedServletUtils.getScopedSessionAttrName( InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
sh.removeAttribute( rc, attrName );
}
|
java
|
public void removeFromSession( HttpServletRequest request )
{
StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
RequestContext rc = new RequestContext( unwrappedRequest, null );
String attrName =
ScopedServletUtils.getScopedSessionAttrName( InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
sh.removeAttribute( rc, attrName );
}
|
[
"public",
"void",
"removeFromSession",
"(",
"HttpServletRequest",
"request",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"getServletContext",
"(",
")",
")",
".",
"getStorageHandler",
"(",
")",
";",
"HttpServletRequest",
"unwrappedRequest",
"=",
"PageFlowUtils",
".",
"unwrapMultipart",
"(",
"request",
")",
";",
"RequestContext",
"rc",
"=",
"new",
"RequestContext",
"(",
"unwrappedRequest",
",",
"null",
")",
";",
"String",
"attrName",
"=",
"ScopedServletUtils",
".",
"getScopedSessionAttrName",
"(",
"InternalConstants",
".",
"FACES_BACKING_ATTR",
",",
"unwrappedRequest",
")",
";",
"sh",
".",
"removeAttribute",
"(",
"rc",
",",
"attrName",
")",
";",
"}"
] |
Remove this instance from the session.
|
[
"Remove",
"this",
"instance",
"from",
"the",
"session",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBean.java#L84-L93
|
146,646
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBean.java
|
FacesBackingBean.reinitialize
|
public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
{
super.reinitialize( request, response, servletContext );
if ( _pageInputs == null )
{
Map map = InternalUtils.getActionOutputMap( request, false );
if ( map != null ) _pageInputs = Collections.unmodifiableMap( map );
}
//
// Initialize the page flow field.
//
Field pageFlowMemberField = getCachedInfo().getPageFlowMemberField();
// TODO: should we add a compiler warning if this field isn't transient? All this reinitialization logic is
// for the transient case.
if ( fieldIsUninitialized( pageFlowMemberField ) )
{
PageFlowController pfc = PageFlowUtils.getCurrentPageFlow( request, servletContext );
initializeField( pageFlowMemberField, pfc );
}
//
// Initialize the shared flow fields.
//
CachedSharedFlowRefInfo.SharedFlowFieldInfo[] sharedFlowMemberFields =
getCachedInfo().getSharedFlowMemberFields();
if ( sharedFlowMemberFields != null )
{
for ( int i = 0; i < sharedFlowMemberFields.length; i++ )
{
CachedSharedFlowRefInfo.SharedFlowFieldInfo fi = sharedFlowMemberFields[i];
Field field = fi.field;
if ( fieldIsUninitialized( field ) )
{
Map/*< String, SharedFlowController >*/ sharedFlows = PageFlowUtils.getSharedFlows( request );
String name = fi.sharedFlowName;
SharedFlowController sf =
name != null ? ( SharedFlowController ) sharedFlows.get( name ) : PageFlowUtils.getGlobalApp( request );
if ( sf != null )
{
initializeField( field, sf );
}
else
{
_log.error( "Could not find shared flow with name \"" + fi.sharedFlowName
+ "\" to initialize field " + field.getName() + " in " + getClass().getName() );
}
}
}
}
}
|
java
|
public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
{
super.reinitialize( request, response, servletContext );
if ( _pageInputs == null )
{
Map map = InternalUtils.getActionOutputMap( request, false );
if ( map != null ) _pageInputs = Collections.unmodifiableMap( map );
}
//
// Initialize the page flow field.
//
Field pageFlowMemberField = getCachedInfo().getPageFlowMemberField();
// TODO: should we add a compiler warning if this field isn't transient? All this reinitialization logic is
// for the transient case.
if ( fieldIsUninitialized( pageFlowMemberField ) )
{
PageFlowController pfc = PageFlowUtils.getCurrentPageFlow( request, servletContext );
initializeField( pageFlowMemberField, pfc );
}
//
// Initialize the shared flow fields.
//
CachedSharedFlowRefInfo.SharedFlowFieldInfo[] sharedFlowMemberFields =
getCachedInfo().getSharedFlowMemberFields();
if ( sharedFlowMemberFields != null )
{
for ( int i = 0; i < sharedFlowMemberFields.length; i++ )
{
CachedSharedFlowRefInfo.SharedFlowFieldInfo fi = sharedFlowMemberFields[i];
Field field = fi.field;
if ( fieldIsUninitialized( field ) )
{
Map/*< String, SharedFlowController >*/ sharedFlows = PageFlowUtils.getSharedFlows( request );
String name = fi.sharedFlowName;
SharedFlowController sf =
name != null ? ( SharedFlowController ) sharedFlows.get( name ) : PageFlowUtils.getGlobalApp( request );
if ( sf != null )
{
initializeField( field, sf );
}
else
{
_log.error( "Could not find shared flow with name \"" + fi.sharedFlowName
+ "\" to initialize field " + field.getName() + " in " + getClass().getName() );
}
}
}
}
}
|
[
"public",
"void",
"reinitialize",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"{",
"super",
".",
"reinitialize",
"(",
"request",
",",
"response",
",",
"servletContext",
")",
";",
"if",
"(",
"_pageInputs",
"==",
"null",
")",
"{",
"Map",
"map",
"=",
"InternalUtils",
".",
"getActionOutputMap",
"(",
"request",
",",
"false",
")",
";",
"if",
"(",
"map",
"!=",
"null",
")",
"_pageInputs",
"=",
"Collections",
".",
"unmodifiableMap",
"(",
"map",
")",
";",
"}",
"//",
"// Initialize the page flow field.",
"//",
"Field",
"pageFlowMemberField",
"=",
"getCachedInfo",
"(",
")",
".",
"getPageFlowMemberField",
"(",
")",
";",
"// TODO: should we add a compiler warning if this field isn't transient? All this reinitialization logic is",
"// for the transient case.",
"if",
"(",
"fieldIsUninitialized",
"(",
"pageFlowMemberField",
")",
")",
"{",
"PageFlowController",
"pfc",
"=",
"PageFlowUtils",
".",
"getCurrentPageFlow",
"(",
"request",
",",
"servletContext",
")",
";",
"initializeField",
"(",
"pageFlowMemberField",
",",
"pfc",
")",
";",
"}",
"//",
"// Initialize the shared flow fields.",
"//",
"CachedSharedFlowRefInfo",
".",
"SharedFlowFieldInfo",
"[",
"]",
"sharedFlowMemberFields",
"=",
"getCachedInfo",
"(",
")",
".",
"getSharedFlowMemberFields",
"(",
")",
";",
"if",
"(",
"sharedFlowMemberFields",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sharedFlowMemberFields",
".",
"length",
";",
"i",
"++",
")",
"{",
"CachedSharedFlowRefInfo",
".",
"SharedFlowFieldInfo",
"fi",
"=",
"sharedFlowMemberFields",
"[",
"i",
"]",
";",
"Field",
"field",
"=",
"fi",
".",
"field",
";",
"if",
"(",
"fieldIsUninitialized",
"(",
"field",
")",
")",
"{",
"Map",
"/*< String, SharedFlowController >*/",
"sharedFlows",
"=",
"PageFlowUtils",
".",
"getSharedFlows",
"(",
"request",
")",
";",
"String",
"name",
"=",
"fi",
".",
"sharedFlowName",
";",
"SharedFlowController",
"sf",
"=",
"name",
"!=",
"null",
"?",
"(",
"SharedFlowController",
")",
"sharedFlows",
".",
"get",
"(",
"name",
")",
":",
"PageFlowUtils",
".",
"getGlobalApp",
"(",
"request",
")",
";",
"if",
"(",
"sf",
"!=",
"null",
")",
"{",
"initializeField",
"(",
"field",
",",
"sf",
")",
";",
"}",
"else",
"{",
"_log",
".",
"error",
"(",
"\"Could not find shared flow with name \\\"\"",
"+",
"fi",
".",
"sharedFlowName",
"+",
"\"\\\" to initialize field \"",
"+",
"field",
".",
"getName",
"(",
")",
"+",
"\" in \"",
"+",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}",
"}",
"}",
"}",
"}"
] |
Reinitialize the bean for a new request. Used by the framework; normally should not be called directly.
|
[
"Reinitialize",
"the",
"bean",
"for",
"a",
"new",
"request",
".",
"Used",
"by",
"the",
"framework",
";",
"normally",
"should",
"not",
"be",
"called",
"directly",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBean.java#L124-L179
|
146,647
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBean.java
|
FacesBackingBean.getPageInput
|
protected Object getPageInput( String pageInputName )
{
return _pageInputs != null ? _pageInputs.get( pageInputName ) : null;
}
|
java
|
protected Object getPageInput( String pageInputName )
{
return _pageInputs != null ? _pageInputs.get( pageInputName ) : null;
}
|
[
"protected",
"Object",
"getPageInput",
"(",
"String",
"pageInputName",
")",
"{",
"return",
"_pageInputs",
"!=",
"null",
"?",
"_pageInputs",
".",
"get",
"(",
"pageInputName",
")",
":",
"null",
";",
"}"
] |
Get a page input that was passed from a Page Flow action as an "action output".
@param pageInputName the name of the page input. This is the same as the name of the "action output".
@return the value of the page input, or <code>null</code> if the given one does not exist.
|
[
"Get",
"a",
"page",
"input",
"that",
"was",
"passed",
"from",
"a",
"Page",
"Flow",
"action",
"as",
"an",
"action",
"output",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBean.java#L187-L190
|
146,648
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java
|
TypeMappingsFactory.convertStringToSQLType
|
public int convertStringToSQLType(String type) {
if (_typeSqlNameMap.containsKey(type.toUpperCase())) {
return _typeSqlNameMap.get(type.toUpperCase());
}
return TYPE_UNKNOWN;
}
|
java
|
public int convertStringToSQLType(String type) {
if (_typeSqlNameMap.containsKey(type.toUpperCase())) {
return _typeSqlNameMap.get(type.toUpperCase());
}
return TYPE_UNKNOWN;
}
|
[
"public",
"int",
"convertStringToSQLType",
"(",
"String",
"type",
")",
"{",
"if",
"(",
"_typeSqlNameMap",
".",
"containsKey",
"(",
"type",
".",
"toUpperCase",
"(",
")",
")",
")",
"{",
"return",
"_typeSqlNameMap",
".",
"get",
"(",
"type",
".",
"toUpperCase",
"(",
")",
")",
";",
"}",
"return",
"TYPE_UNKNOWN",
";",
"}"
] |
Convert a type string to its SQL Type int value.
@param type A String containing the SQL type name.
@return The SQL type, TYPE_UNKNOWN if cannot convert.
|
[
"Convert",
"a",
"type",
"string",
"to",
"its",
"SQL",
"Type",
"int",
"value",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java#L248-L253
|
146,649
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java
|
TypeMappingsFactory.getSqlType
|
public int getSqlType(Class classType) {
final Class origType = classType;
while (classType != null) {
Integer type = _typeSqlMap.get(classType);
if (type != null) {
return type.intValue();
}
classType = classType.getSuperclass();
}
//
// special check for blobs/clobs they are interfaces not derived from
//
if (Blob.class.isAssignableFrom(origType)) {
return _typeSqlMap.get(Blob.class).intValue();
} else if (Clob.class.isAssignableFrom(origType)) {
return _typeSqlMap.get(Clob.class).intValue();
}
return Types.OTHER;
}
|
java
|
public int getSqlType(Class classType) {
final Class origType = classType;
while (classType != null) {
Integer type = _typeSqlMap.get(classType);
if (type != null) {
return type.intValue();
}
classType = classType.getSuperclass();
}
//
// special check for blobs/clobs they are interfaces not derived from
//
if (Blob.class.isAssignableFrom(origType)) {
return _typeSqlMap.get(Blob.class).intValue();
} else if (Clob.class.isAssignableFrom(origType)) {
return _typeSqlMap.get(Clob.class).intValue();
}
return Types.OTHER;
}
|
[
"public",
"int",
"getSqlType",
"(",
"Class",
"classType",
")",
"{",
"final",
"Class",
"origType",
"=",
"classType",
";",
"while",
"(",
"classType",
"!=",
"null",
")",
"{",
"Integer",
"type",
"=",
"_typeSqlMap",
".",
"get",
"(",
"classType",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"return",
"type",
".",
"intValue",
"(",
")",
";",
"}",
"classType",
"=",
"classType",
".",
"getSuperclass",
"(",
")",
";",
"}",
"//",
"// special check for blobs/clobs they are interfaces not derived from",
"//",
"if",
"(",
"Blob",
".",
"class",
".",
"isAssignableFrom",
"(",
"origType",
")",
")",
"{",
"return",
"_typeSqlMap",
".",
"get",
"(",
"Blob",
".",
"class",
")",
".",
"intValue",
"(",
")",
";",
"}",
"else",
"if",
"(",
"Clob",
".",
"class",
".",
"isAssignableFrom",
"(",
"origType",
")",
")",
"{",
"return",
"_typeSqlMap",
".",
"get",
"(",
"Clob",
".",
"class",
")",
".",
"intValue",
"(",
")",
";",
"}",
"return",
"Types",
".",
"OTHER",
";",
"}"
] |
Get the SQL type of a class, start at top level class an check all super classes until match is found.
@param classType Class to get SQL type of.
@return Types.OTHER if cannot find SQL type.
|
[
"Get",
"the",
"SQL",
"type",
"of",
"a",
"class",
"start",
"at",
"top",
"level",
"class",
"an",
"check",
"all",
"super",
"classes",
"until",
"match",
"is",
"found",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java#L260-L281
|
146,650
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java
|
TypeMappingsFactory.getSqlType
|
public int getSqlType(Object o) {
if (null == o) {
return Types.NULL;
}
return getSqlType(o.getClass());
}
|
java
|
public int getSqlType(Object o) {
if (null == o) {
return Types.NULL;
}
return getSqlType(o.getClass());
}
|
[
"public",
"int",
"getSqlType",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"null",
"==",
"o",
")",
"{",
"return",
"Types",
".",
"NULL",
";",
"}",
"return",
"getSqlType",
"(",
"o",
".",
"getClass",
"(",
")",
")",
";",
"}"
] |
Get the SQL type for an object.
@param o Object to get SQL type of.
@return SQL type of the object, Types.OTHER if cannot classify.
|
[
"Get",
"the",
"SQL",
"type",
"for",
"an",
"object",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java#L288-L293
|
146,651
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java
|
TypeMappingsFactory.fixNull
|
public Object fixNull(Class type) {
return type.isPrimitive() ? _primitiveDefaults.get(type) : null;
}
|
java
|
public Object fixNull(Class type) {
return type.isPrimitive() ? _primitiveDefaults.get(type) : null;
}
|
[
"public",
"Object",
"fixNull",
"(",
"Class",
"type",
")",
"{",
"return",
"type",
".",
"isPrimitive",
"(",
")",
"?",
"_primitiveDefaults",
".",
"get",
"(",
"type",
")",
":",
"null",
";",
"}"
] |
Returns a primitive legal value as opposed to null if type is primitive.
@param type type to get null value for.
@return null value for specifed type.
|
[
"Returns",
"a",
"primitive",
"legal",
"value",
"as",
"opposed",
"to",
"null",
"if",
"type",
"is",
"primitive",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/TypeMappingsFactory.java#L342-L344
|
146,652
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/config/DelegatingActionMapping.java
|
DelegatingActionMapping.findForward
|
public ActionForward findForward(String forwardName) {
ForwardConfig config = _delegate.findForwardConfig(forwardName);
if (config == null) {
config = getModuleConfig().findForwardConfig(forwardName);
}
if (config == null) {
config = _delegate.getModuleConfig().findForwardConfig(forwardName);
}
return (ActionForward) config;
}
|
java
|
public ActionForward findForward(String forwardName) {
ForwardConfig config = _delegate.findForwardConfig(forwardName);
if (config == null) {
config = getModuleConfig().findForwardConfig(forwardName);
}
if (config == null) {
config = _delegate.getModuleConfig().findForwardConfig(forwardName);
}
return (ActionForward) config;
}
|
[
"public",
"ActionForward",
"findForward",
"(",
"String",
"forwardName",
")",
"{",
"ForwardConfig",
"config",
"=",
"_delegate",
".",
"findForwardConfig",
"(",
"forwardName",
")",
";",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"config",
"=",
"getModuleConfig",
"(",
")",
".",
"findForwardConfig",
"(",
"forwardName",
")",
";",
"}",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"config",
"=",
"_delegate",
".",
"getModuleConfig",
"(",
")",
".",
"findForwardConfig",
"(",
"forwardName",
")",
";",
"}",
"return",
"(",
"ActionForward",
")",
"config",
";",
"}"
] |
the delegate.
|
[
"the",
"delegate",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/config/DelegatingActionMapping.java#L136-L145
|
146,653
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java
|
RowMapperFactory.getRowMapper
|
public static RowMapper getRowMapper(ResultSet rs, Class returnTypeClass, Calendar cal) {
Class<? extends RowMapper> rm = _rowMappings.get(returnTypeClass);
if (rm != null) {
return getMapper(rm, rs, returnTypeClass, cal);
}
//
// if we made it to here, check if the default XMLObject Mapper can be used,
// otherwise use the default object mapper
//
if (XMLOBJ_CLASS != null && XMLOBJ_CLASS.isAssignableFrom(returnTypeClass)) {
return getMapper(DEFAULT_XMLOBJ_ROWMAPPING, rs, returnTypeClass, cal);
} else {
return getMapper(DEFAULT_OBJ_ROWMAPPING, rs, returnTypeClass, cal);
}
}
|
java
|
public static RowMapper getRowMapper(ResultSet rs, Class returnTypeClass, Calendar cal) {
Class<? extends RowMapper> rm = _rowMappings.get(returnTypeClass);
if (rm != null) {
return getMapper(rm, rs, returnTypeClass, cal);
}
//
// if we made it to here, check if the default XMLObject Mapper can be used,
// otherwise use the default object mapper
//
if (XMLOBJ_CLASS != null && XMLOBJ_CLASS.isAssignableFrom(returnTypeClass)) {
return getMapper(DEFAULT_XMLOBJ_ROWMAPPING, rs, returnTypeClass, cal);
} else {
return getMapper(DEFAULT_OBJ_ROWMAPPING, rs, returnTypeClass, cal);
}
}
|
[
"public",
"static",
"RowMapper",
"getRowMapper",
"(",
"ResultSet",
"rs",
",",
"Class",
"returnTypeClass",
",",
"Calendar",
"cal",
")",
"{",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rm",
"=",
"_rowMappings",
".",
"get",
"(",
"returnTypeClass",
")",
";",
"if",
"(",
"rm",
"!=",
"null",
")",
"{",
"return",
"getMapper",
"(",
"rm",
",",
"rs",
",",
"returnTypeClass",
",",
"cal",
")",
";",
"}",
"//",
"// if we made it to here, check if the default XMLObject Mapper can be used,",
"// otherwise use the default object mapper",
"//",
"if",
"(",
"XMLOBJ_CLASS",
"!=",
"null",
"&&",
"XMLOBJ_CLASS",
".",
"isAssignableFrom",
"(",
"returnTypeClass",
")",
")",
"{",
"return",
"getMapper",
"(",
"DEFAULT_XMLOBJ_ROWMAPPING",
",",
"rs",
",",
"returnTypeClass",
",",
"cal",
")",
";",
"}",
"else",
"{",
"return",
"getMapper",
"(",
"DEFAULT_OBJ_ROWMAPPING",
",",
"rs",
",",
"returnTypeClass",
",",
"cal",
")",
";",
"}",
"}"
] |
Get a RowMapper instance which knows how to map a ResultSet row to the given return type.
@param rs The ResultSet to map.
@param returnTypeClass The class to map a ResultSet row to.
@param cal Calendar instance for mapping date/time values.
@return A RowMapper instance.
|
[
"Get",
"a",
"RowMapper",
"instance",
"which",
"knows",
"how",
"to",
"map",
"a",
"ResultSet",
"row",
"to",
"the",
"given",
"return",
"type",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L71-L87
|
146,654
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java
|
RowMapperFactory.addRowMapping
|
public static void addRowMapping(Class returnTypeClass, Class<? extends RowMapper> rowMapperClass) {
_rowMappings.put(returnTypeClass, rowMapperClass);
}
|
java
|
public static void addRowMapping(Class returnTypeClass, Class<? extends RowMapper> rowMapperClass) {
_rowMappings.put(returnTypeClass, rowMapperClass);
}
|
[
"public",
"static",
"void",
"addRowMapping",
"(",
"Class",
"returnTypeClass",
",",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rowMapperClass",
")",
"{",
"_rowMappings",
".",
"put",
"(",
"returnTypeClass",
",",
"rowMapperClass",
")",
";",
"}"
] |
Add a new row mapper to the list of available row mappers. The getRowMapper method traverses the
list of mappers from beginning to end, checking to see if a mapper can handle the specified
returnTypeClass. There is a default mapper which is used if a match cannot be found in the list.
@param returnTypeClass Class which this mapper maps a row to.
@param rowMapperClass The row mapper class.
|
[
"Add",
"a",
"new",
"row",
"mapper",
"to",
"the",
"list",
"of",
"available",
"row",
"mappers",
".",
"The",
"getRowMapper",
"method",
"traverses",
"the",
"list",
"of",
"mappers",
"from",
"beginning",
"to",
"end",
"checking",
"to",
"see",
"if",
"a",
"mapper",
"can",
"handle",
"the",
"specified",
"returnTypeClass",
".",
"There",
"is",
"a",
"default",
"mapper",
"which",
"is",
"used",
"if",
"a",
"match",
"cannot",
"be",
"found",
"in",
"the",
"list",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L97-L99
|
146,655
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java
|
RowMapperFactory.replaceRowMapping
|
public static Class<? extends RowMapper> replaceRowMapping(Class returnTypeClass, Class<? extends RowMapper> rowMapperClass) {
return _rowMappings.put(returnTypeClass, rowMapperClass);
}
|
java
|
public static Class<? extends RowMapper> replaceRowMapping(Class returnTypeClass, Class<? extends RowMapper> rowMapperClass) {
return _rowMappings.put(returnTypeClass, rowMapperClass);
}
|
[
"public",
"static",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"replaceRowMapping",
"(",
"Class",
"returnTypeClass",
",",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rowMapperClass",
")",
"{",
"return",
"_rowMappings",
".",
"put",
"(",
"returnTypeClass",
",",
"rowMapperClass",
")",
";",
"}"
] |
Replace a row mapping.
@param returnTypeClass Class which this mapper maps a row to.
@param rowMapperClass The row mapper class.
@return if the mapper was replaced, false mapper for returnTypeClass was not found, no action taken.
|
[
"Replace",
"a",
"row",
"mapping",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L108-L110
|
146,656
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java
|
RowMapperFactory.setDefaultRowMapping
|
public static Class <? extends RowMapper> setDefaultRowMapping(Class<? extends RowMapper> rowMapperClass) {
Class<? extends RowMapper> ret = DEFAULT_OBJ_ROWMAPPING;
DEFAULT_OBJ_ROWMAPPING = rowMapperClass;
return ret;
}
|
java
|
public static Class <? extends RowMapper> setDefaultRowMapping(Class<? extends RowMapper> rowMapperClass) {
Class<? extends RowMapper> ret = DEFAULT_OBJ_ROWMAPPING;
DEFAULT_OBJ_ROWMAPPING = rowMapperClass;
return ret;
}
|
[
"public",
"static",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"setDefaultRowMapping",
"(",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rowMapperClass",
")",
"{",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"ret",
"=",
"DEFAULT_OBJ_ROWMAPPING",
";",
"DEFAULT_OBJ_ROWMAPPING",
"=",
"rowMapperClass",
";",
"return",
"ret",
";",
"}"
] |
Sets the rowmapper for Object.class
@param rowMapperClass
|
[
"Sets",
"the",
"rowmapper",
"for",
"Object",
".",
"class"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L128-L132
|
146,657
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java
|
RowMapperFactory.setDefaultXmlRowMapping
|
public static Class<? extends RowMapper> setDefaultXmlRowMapping(Class mapToClass, Class<? extends RowMapper> rowMapperClass) {
Class<? extends RowMapper> ret = DEFAULT_XMLOBJ_ROWMAPPING;
DEFAULT_XMLOBJ_ROWMAPPING = rowMapperClass;
XMLOBJ_CLASS = mapToClass;
return ret;
}
|
java
|
public static Class<? extends RowMapper> setDefaultXmlRowMapping(Class mapToClass, Class<? extends RowMapper> rowMapperClass) {
Class<? extends RowMapper> ret = DEFAULT_XMLOBJ_ROWMAPPING;
DEFAULT_XMLOBJ_ROWMAPPING = rowMapperClass;
XMLOBJ_CLASS = mapToClass;
return ret;
}
|
[
"public",
"static",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"setDefaultXmlRowMapping",
"(",
"Class",
"mapToClass",
",",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rowMapperClass",
")",
"{",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"ret",
"=",
"DEFAULT_XMLOBJ_ROWMAPPING",
";",
"DEFAULT_XMLOBJ_ROWMAPPING",
"=",
"rowMapperClass",
";",
"XMLOBJ_CLASS",
"=",
"mapToClass",
";",
"return",
"ret",
";",
"}"
] |
Sets the rowmapper for XmlObject.class
@param rowMapperClass
|
[
"Sets",
"the",
"rowmapper",
"for",
"XmlObject",
".",
"class"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L139-L144
|
146,658
|
moparisthebest/beehive
|
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java
|
RowMapperFactory.getMapper
|
private static RowMapper getMapper(Class<? extends RowMapper> rowMapper, ResultSet rs, Class returnType, Calendar cal)
{
Constructor c = null;
try {
c = rowMapper.getDeclaredConstructor(_params);
return (RowMapper) c.newInstance(new Object[]{rs, returnType, cal});
} catch (NoSuchMethodException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
} catch (InstantiationException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
} catch (IllegalAccessException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
} catch (InvocationTargetException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.getCause().toString(), e);
}
}
|
java
|
private static RowMapper getMapper(Class<? extends RowMapper> rowMapper, ResultSet rs, Class returnType, Calendar cal)
{
Constructor c = null;
try {
c = rowMapper.getDeclaredConstructor(_params);
return (RowMapper) c.newInstance(new Object[]{rs, returnType, cal});
} catch (NoSuchMethodException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
} catch (InstantiationException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
} catch (IllegalAccessException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
} catch (InvocationTargetException e) {
throw new ControlException("Failure creating new instance of RowMapper, " + e.getCause().toString(), e);
}
}
|
[
"private",
"static",
"RowMapper",
"getMapper",
"(",
"Class",
"<",
"?",
"extends",
"RowMapper",
">",
"rowMapper",
",",
"ResultSet",
"rs",
",",
"Class",
"returnType",
",",
"Calendar",
"cal",
")",
"{",
"Constructor",
"c",
"=",
"null",
";",
"try",
"{",
"c",
"=",
"rowMapper",
".",
"getDeclaredConstructor",
"(",
"_params",
")",
";",
"return",
"(",
"RowMapper",
")",
"c",
".",
"newInstance",
"(",
"new",
"Object",
"[",
"]",
"{",
"rs",
",",
"returnType",
",",
"cal",
"}",
")",
";",
"}",
"catch",
"(",
"NoSuchMethodException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Failure creating new instance of RowMapper, \"",
"+",
"e",
".",
"toString",
"(",
")",
",",
"e",
")",
";",
"}",
"catch",
"(",
"InstantiationException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Failure creating new instance of RowMapper, \"",
"+",
"e",
".",
"toString",
"(",
")",
",",
"e",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Failure creating new instance of RowMapper, \"",
"+",
"e",
".",
"toString",
"(",
")",
",",
"e",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"e",
")",
"{",
"throw",
"new",
"ControlException",
"(",
"\"Failure creating new instance of RowMapper, \"",
"+",
"e",
".",
"getCause",
"(",
")",
".",
"toString",
"(",
")",
",",
"e",
")",
";",
"}",
"}"
] |
Create an instance of the RowMapper class.
@param rowMapper
@param rs ResultSet we are mapping from.
@param returnType Class to map rows to.
@param cal Calendar instance for date/time values.
@return A RowMapper instance.
|
[
"Create",
"an",
"instance",
"of",
"the",
"RowMapper",
"class",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/RowMapperFactory.java#L155-L170
|
146,659
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/handler/Handlers.java
|
Handlers.createHandler
|
private static Handler createHandler( String className, Class baseClassOrInterface, Handler previousHandler,
ServletContext servletContext )
{
assert Handler.class.isAssignableFrom( baseClassOrInterface )
: baseClassOrInterface.getName() + " cannot be assigned to " + Handler.class.getName();
ClassLoader cl = DiscoveryUtils.getClassLoader();
try
{
Class handlerClass = cl.loadClass( className );
if ( ! baseClassOrInterface.isAssignableFrom( handlerClass ) )
{
_log.error( "Handler " + handlerClass.getName() + " does not implement or extend "
+ baseClassOrInterface.getName() );
return null;
}
Handler handler = ( Handler ) handlerClass.newInstance();
return handler;
}
catch ( ClassNotFoundException e )
{
_log.error( "Could not find Handler class " + className, e );
}
catch ( InstantiationException e )
{
_log.error( "Could not instantiate Handler class " + className, e );
}
catch ( IllegalAccessException e )
{
_log.error( "Could not instantiate Handler class " + className, e );
}
return null;
}
|
java
|
private static Handler createHandler( String className, Class baseClassOrInterface, Handler previousHandler,
ServletContext servletContext )
{
assert Handler.class.isAssignableFrom( baseClassOrInterface )
: baseClassOrInterface.getName() + " cannot be assigned to " + Handler.class.getName();
ClassLoader cl = DiscoveryUtils.getClassLoader();
try
{
Class handlerClass = cl.loadClass( className );
if ( ! baseClassOrInterface.isAssignableFrom( handlerClass ) )
{
_log.error( "Handler " + handlerClass.getName() + " does not implement or extend "
+ baseClassOrInterface.getName() );
return null;
}
Handler handler = ( Handler ) handlerClass.newInstance();
return handler;
}
catch ( ClassNotFoundException e )
{
_log.error( "Could not find Handler class " + className, e );
}
catch ( InstantiationException e )
{
_log.error( "Could not instantiate Handler class " + className, e );
}
catch ( IllegalAccessException e )
{
_log.error( "Could not instantiate Handler class " + className, e );
}
return null;
}
|
[
"private",
"static",
"Handler",
"createHandler",
"(",
"String",
"className",
",",
"Class",
"baseClassOrInterface",
",",
"Handler",
"previousHandler",
",",
"ServletContext",
"servletContext",
")",
"{",
"assert",
"Handler",
".",
"class",
".",
"isAssignableFrom",
"(",
"baseClassOrInterface",
")",
":",
"baseClassOrInterface",
".",
"getName",
"(",
")",
"+",
"\" cannot be assigned to \"",
"+",
"Handler",
".",
"class",
".",
"getName",
"(",
")",
";",
"ClassLoader",
"cl",
"=",
"DiscoveryUtils",
".",
"getClassLoader",
"(",
")",
";",
"try",
"{",
"Class",
"handlerClass",
"=",
"cl",
".",
"loadClass",
"(",
"className",
")",
";",
"if",
"(",
"!",
"baseClassOrInterface",
".",
"isAssignableFrom",
"(",
"handlerClass",
")",
")",
"{",
"_log",
".",
"error",
"(",
"\"Handler \"",
"+",
"handlerClass",
".",
"getName",
"(",
")",
"+",
"\" does not implement or extend \"",
"+",
"baseClassOrInterface",
".",
"getName",
"(",
")",
")",
";",
"return",
"null",
";",
"}",
"Handler",
"handler",
"=",
"(",
"Handler",
")",
"handlerClass",
".",
"newInstance",
"(",
")",
";",
"return",
"handler",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"_log",
".",
"error",
"(",
"\"Could not find Handler class \"",
"+",
"className",
",",
"e",
")",
";",
"}",
"catch",
"(",
"InstantiationException",
"e",
")",
"{",
"_log",
".",
"error",
"(",
"\"Could not instantiate Handler class \"",
"+",
"className",
",",
"e",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"_log",
".",
"error",
"(",
"\"Could not instantiate Handler class \"",
"+",
"className",
",",
"e",
")",
";",
"}",
"return",
"null",
";",
"}"
] |
Instantiates a handler, based on the class name in the given HandlerConfig.
@param className the class name of the desired Handler.
@param baseClassOrInterface the required base class or interface. May be <code>null</code>.
@return an initialized Handler.
|
[
"Instantiates",
"a",
"handler",
"based",
"on",
"the",
"class",
"name",
"in",
"the",
"given",
"HandlerConfig",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/handler/Handlers.java#L218-L254
|
146,660
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnDblClick
|
public void setCellOnDblClick(String onDblClick) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick);
}
|
java
|
public void setCellOnDblClick(String onDblClick) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick);
}
|
[
"public",
"void",
"setCellOnDblClick",
"(",
"String",
"onDblClick",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONDBLCLICK",
",",
"onDblClick",
")",
";",
"}"
] |
Sets the onDblClick javascript event for the HTML table cell.
@param onDblClick the onDblClick event.
@jsptagref.attributedescription The onDblClick JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnDblClick</i>
@netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event."
|
[
"Sets",
"the",
"onDblClick",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L128-L130
|
146,661
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnKeyDown
|
public void setCellOnKeyDown(String onKeyDown) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown);
}
|
java
|
public void setCellOnKeyDown(String onKeyDown) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown);
}
|
[
"public",
"void",
"setCellOnKeyDown",
"(",
"String",
"onKeyDown",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONKEYDOWN",
",",
"onKeyDown",
")",
";",
"}"
] |
Sets the onKeyDown javascript event for the HTML table cell.
@param onKeyDown the onKeyDown event.
@jsptagref.attributedescription The onKeyDown JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnKeyDown</i>
@netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event."
|
[
"Sets",
"the",
"onKeyDown",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L140-L142
|
146,662
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnKeyUp
|
public void setCellOnKeyUp(String onKeyUp) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp);
}
|
java
|
public void setCellOnKeyUp(String onKeyUp) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp);
}
|
[
"public",
"void",
"setCellOnKeyUp",
"(",
"String",
"onKeyUp",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONKEYUP",
",",
"onKeyUp",
")",
";",
"}"
] |
Sets the onKeyUp javascript event for the HTML table cell.
@param onKeyUp the onKeyUp event.
@jsptagref.attributedescription The onKeyUp JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnKeyUp</i>
@netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event."
|
[
"Sets",
"the",
"onKeyUp",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L152-L154
|
146,663
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnKeyPress
|
public void setCellOnKeyPress(String onKeyPress) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress);
}
|
java
|
public void setCellOnKeyPress(String onKeyPress) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress);
}
|
[
"public",
"void",
"setCellOnKeyPress",
"(",
"String",
"onKeyPress",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONKEYPRESS",
",",
"onKeyPress",
")",
";",
"}"
] |
Sets the onKeyPress javascript event for the HTML table cell.
@param onKeyPress the onKeyPress event.
@jsptagref.attributedescription The onKeyPress JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnKeyPress</i>
@netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event."
|
[
"Sets",
"the",
"onKeyPress",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L164-L166
|
146,664
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnMouseDown
|
public void setCellOnMouseDown(String onMouseDown) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown);
}
|
java
|
public void setCellOnMouseDown(String onMouseDown) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEDOWN, onMouseDown);
}
|
[
"public",
"void",
"setCellOnMouseDown",
"(",
"String",
"onMouseDown",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEDOWN",
",",
"onMouseDown",
")",
";",
"}"
] |
Sets the onMouseDown javascript event for the HTML table cell.
@param onMouseDown the onMouseDown event.
@jsptagref.attributedescription The onMouseDown JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnMouseDown</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseDown JavaScript event."
|
[
"Sets",
"the",
"onMouseDown",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L176-L178
|
146,665
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnMouseUp
|
public void setCellOnMouseUp(String onMouseUp) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp);
}
|
java
|
public void setCellOnMouseUp(String onMouseUp) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEUP, onMouseUp);
}
|
[
"public",
"void",
"setCellOnMouseUp",
"(",
"String",
"onMouseUp",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEUP",
",",
"onMouseUp",
")",
";",
"}"
] |
Sets the onMouseUp javascript event for the HTML table cell.
@param onMouseUp the onMouseUp event.
@jsptagref.attributedescription The onMouseUp JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnMouseUp</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseUp JavaScript event."
|
[
"Sets",
"the",
"onMouseUp",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L188-L190
|
146,666
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnMouseMove
|
public void setCellOnMouseMove(String onMouseMove) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove);
}
|
java
|
public void setCellOnMouseMove(String onMouseMove) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEMOVE, onMouseMove);
}
|
[
"public",
"void",
"setCellOnMouseMove",
"(",
"String",
"onMouseMove",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEMOVE",
",",
"onMouseMove",
")",
";",
"}"
] |
Sets the onMouseMove javascript event for the HTML table cell.
@param onMouseMove the onMouseMove event.
@jsptagref.attributedescription The onMouseMove JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnMouseMove</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseMove JavaScript event."
|
[
"Sets",
"the",
"onMouseMove",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L200-L202
|
146,667
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnMouseOut
|
public void setCellOnMouseOut(String onMouseOut) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut);
}
|
java
|
public void setCellOnMouseOut(String onMouseOut) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOUT, onMouseOut);
}
|
[
"public",
"void",
"setCellOnMouseOut",
"(",
"String",
"onMouseOut",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEOUT",
",",
"onMouseOut",
")",
";",
"}"
] |
Sets the onMouseOut javascript event for the HTML table cell.
@param onMouseOut the onMouseOut event.
@jsptagref.attributedescription The onMouseOut JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnMouseOut</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseOut JavaScript event."
|
[
"Sets",
"the",
"onMouseOut",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L212-L214
|
146,668
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellOnMouseOver
|
public void setCellOnMouseOver(String onMouseOver) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver);
}
|
java
|
public void setCellOnMouseOver(String onMouseOver) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONMOUSEOVER, onMouseOver);
}
|
[
"public",
"void",
"setCellOnMouseOver",
"(",
"String",
"onMouseOver",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_JAVASCRIPT",
",",
"HtmlConstants",
".",
"ONMOUSEOVER",
",",
"onMouseOver",
")",
";",
"}"
] |
Sets the onMouseOver javascript event for the HTML table cell.
@param onMouseOver the onMouseOver event.
@jsptagref.attributedescription The onMouseOver JavaScript event for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellOnMouseOver</i>
@netui:attribute required="false" rtexprvalue="true" description="The onMouseOver JavaScript event."
|
[
"Sets",
"the",
"onMouseOver",
"javascript",
"event",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L224-L226
|
146,669
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellTitle
|
public void setCellTitle(String title) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
}
|
java
|
public void setCellTitle(String title) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
}
|
[
"public",
"void",
"setCellTitle",
"(",
"String",
"title",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"TITLE",
",",
"title",
")",
";",
"}"
] |
Sets the value of the title attribute for the HTML table cell.
@param title the title
@jsptagref.attributedescription The title for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellTitle</i>
@netui:attribute required="false" rtexprvalue="true" description="The title."
|
[
"Sets",
"the",
"value",
"of",
"the",
"title",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L264-L266
|
146,670
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellAlign
|
public void setCellAlign(String align) {
/* todo: should this enforce left|center|right|justify|char as in the spec */
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align);
}
|
java
|
public void setCellAlign(String align) {
/* todo: should this enforce left|center|right|justify|char as in the spec */
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALIGN, align);
}
|
[
"public",
"void",
"setCellAlign",
"(",
"String",
"align",
")",
"{",
"/* todo: should this enforce left|center|right|justify|char as in the spec */",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"ALIGN",
",",
"align",
")",
";",
"}"
] |
Sets the horizontal alignment of the HTML table cell.
@param align the alignment
@jsptagref.attributedescription The horizontal alignment of the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellAlign</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's horizontal alignment"
|
[
"Sets",
"the",
"horizontal",
"alignment",
"of",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L300-L303
|
146,671
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellChar
|
public void setCellChar(String alignChar) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAR, alignChar);
}
|
java
|
public void setCellChar(String alignChar) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAR, alignChar);
}
|
[
"public",
"void",
"setCellChar",
"(",
"String",
"alignChar",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"CHAR",
",",
"alignChar",
")",
";",
"}"
] |
Sets the value of the horizontal alignment character attribute for the HTML table cell.
@param alignChar the horizontal alignment character
@jsptagref.attributedescription The horizontal alignment character for the HTML table cell
@jsptagref.attributesyntaxvalue <i>string_cellAlignChar</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's horizontal alignment character"
|
[
"Sets",
"the",
"value",
"of",
"the",
"horizontal",
"alignment",
"character",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L313-L315
|
146,672
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellCharoff
|
public void setCellCharoff(String alignCharOff) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAROFF, alignCharOff);
}
|
java
|
public void setCellCharoff(String alignCharOff) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAROFF, alignCharOff);
}
|
[
"public",
"void",
"setCellCharoff",
"(",
"String",
"alignCharOff",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"CHAROFF",
",",
"alignCharOff",
")",
";",
"}"
] |
Sets the value of the horizontal alignment character offset attribute for the HTML table cell.
@param alignCharOff the alingnment character offset
@jsptagref.attributedescription The horizontal alignment character offset for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellAignCharOff</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",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L325-L327
|
146,673
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellValign
|
public void setCellValign(String align) {
/* todo: should this enforce top|middle|bottom|baseline as in the spec */
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VALIGN, align);
}
|
java
|
public void setCellValign(String align) {
/* todo: should this enforce top|middle|bottom|baseline as in the spec */
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VALIGN, align);
}
|
[
"public",
"void",
"setCellValign",
"(",
"String",
"align",
")",
"{",
"/* todo: should this enforce top|middle|bottom|baseline as in the spec */",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"VALIGN",
",",
"align",
")",
";",
"}"
] |
Sets the value of the vertical alignment attribute for the HTML table cell.
@param align the vertical alignment
@jsptagref.attributedescription The vertical alignment for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellAlign</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's vertical alignment"
|
[
"Sets",
"the",
"value",
"of",
"the",
"vertical",
"alignment",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L337-L340
|
146,674
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellLang
|
public void setCellLang(String lang) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LANG, lang);
}
|
java
|
public void setCellLang(String lang) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.LANG, lang);
}
|
[
"public",
"void",
"setCellLang",
"(",
"String",
"lang",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"LANG",
",",
"lang",
")",
";",
"}"
] |
Sets the value of the language attribute for the HTML table cell.
@param lang the language
@jsptagref.attributedescription The language for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellLang</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's language"
|
[
"Sets",
"the",
"value",
"of",
"the",
"language",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L350-L352
|
146,675
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellDir
|
public void setCellDir(String dir) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.DIR, dir);
}
|
java
|
public void setCellDir(String dir) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.DIR, dir);
}
|
[
"public",
"void",
"setCellDir",
"(",
"String",
"dir",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"DIR",
",",
"dir",
")",
";",
"}"
] |
Sets the value of the text direction attribute for the HTML table cell.
@param dir the text direction
@jsptagref.attributedescription The text direction attribute for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellDir</i>
@netui:attribute required="false" rtexprvalue="true" description="The cell's text direction"
|
[
"Sets",
"the",
"value",
"of",
"the",
"text",
"direction",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L362-L364
|
146,676
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellAbbr
|
public void setCellAbbr(String abbr) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ABBR, abbr);
}
|
java
|
public void setCellAbbr(String abbr) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ABBR, abbr);
}
|
[
"public",
"void",
"setCellAbbr",
"(",
"String",
"abbr",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"ABBR",
",",
"abbr",
")",
";",
"}"
] |
Sets the value of the abbreviated form of the HTML table cell's content.
@param abbr the abbreviation
@jsptagref.attributedescription The abbreviated form of the HTML table cell's content.
@jsptagref.attributesyntaxvalue <i>string_cellAbbr</i>
@netui:attribute required="false" rtexprvalue="true" description="The abbreviated form of the cell's content"
|
[
"Sets",
"the",
"value",
"of",
"the",
"abbreviated",
"form",
"of",
"the",
"HTML",
"table",
"cell",
"s",
"content",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L374-L376
|
146,677
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellAxis
|
public void setCellAxis(String axis) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.AXIS, axis);
}
|
java
|
public void setCellAxis(String axis) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.AXIS, axis);
}
|
[
"public",
"void",
"setCellAxis",
"(",
"String",
"axis",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"AXIS",
",",
"axis",
")",
";",
"}"
] |
Sets the value of the axis attribute for the HTML table cell.
@param axis the axis
@jsptagref.attributedescription The axis attribute for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellAxis</i>
@netui:attribute required="false" rtexprvalue="true" description="The axis attribute"
|
[
"Sets",
"the",
"value",
"of",
"the",
"axis",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L386-L388
|
146,678
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellHeaders
|
public void setCellHeaders(String headers) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEADERS, headers);
}
|
java
|
public void setCellHeaders(String headers) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.HEADERS, headers);
}
|
[
"public",
"void",
"setCellHeaders",
"(",
"String",
"headers",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"HEADERS",
",",
"headers",
")",
";",
"}"
] |
Sets the value of the headers attribute for the HTML table cell.
@param headers the headers
@jsptagref.attributedescription The headers attribute for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellHeaders</i>
@netui:attribute required="false" rtexprvalue="true" description="The headers attribute"
|
[
"Sets",
"the",
"value",
"of",
"the",
"headers",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L398-L400
|
146,679
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
|
AbstractHtmlTableCell.setCellScope
|
public void setCellScope(String scope) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.SCOPE, scope);
}
|
java
|
public void setCellScope(String scope) {
_cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.SCOPE, scope);
}
|
[
"public",
"void",
"setCellScope",
"(",
"String",
"scope",
")",
"{",
"_cellState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"SCOPE",
",",
"scope",
")",
";",
"}"
] |
Sets the value of the scope attribute for the HTML table cell.
@param scope the scope
@jsptagref.attributedescription The scope attribute for the HTML table cell.
@jsptagref.attributesyntaxvalue <i>string_cellScope</i>
@netui:attribute required="false" rtexprvalue="true" description="The scope attribute"
|
[
"Sets",
"the",
"value",
"of",
"the",
"scope",
"attribute",
"for",
"the",
"HTML",
"table",
"cell",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java#L410-L412
|
146,680
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/StrutsApp.java
|
StrutsApp.addActionMapping
|
public void addActionMapping( ActionModel mapping )
{
String mappingPath = mapping.getPath();
ActionModel conflictingActionMapping = ( ActionModel ) _actionMappings.get( mappingPath );
if ( conflictingActionMapping != null )
{
ActionModel defaultMappingForThisPath = conflictingActionMapping;
//
// If the new action mapping takes no form, then it has the highest precedence, and replaces the existing
// "natural" mapping for the given path. Otherwise, replace the existing one if the existing one has a
// form bean and if the new mapping's form bean type comes alphabetically before the existing one's.
//
if ( mapping.getFormBeanName() == null
|| ( conflictingActionMapping.getFormBeanName() != null
&& getBeanType( mapping ).compareTo( getBeanType( conflictingActionMapping ) ) < 0 ) )
{
_actionMappings.remove( mappingPath );
_actionMappings.put( mappingPath, mapping );
defaultMappingForThisPath = mapping;
conflictingActionMapping.setOverloaded( false );
addDisambiguatedActionMapping( conflictingActionMapping );
}
else
{
addDisambiguatedActionMapping( mapping );
}
defaultMappingForThisPath.setOverloaded( true );
defaultMappingForThisPath.setComment( DUPLICATE_ACTION_COMMENT.replaceAll( "\\{0\\}", mappingPath ) ); // @TODO I18N
}
else
{
_actionMappings.put( mappingPath, mapping );
}
}
|
java
|
public void addActionMapping( ActionModel mapping )
{
String mappingPath = mapping.getPath();
ActionModel conflictingActionMapping = ( ActionModel ) _actionMappings.get( mappingPath );
if ( conflictingActionMapping != null )
{
ActionModel defaultMappingForThisPath = conflictingActionMapping;
//
// If the new action mapping takes no form, then it has the highest precedence, and replaces the existing
// "natural" mapping for the given path. Otherwise, replace the existing one if the existing one has a
// form bean and if the new mapping's form bean type comes alphabetically before the existing one's.
//
if ( mapping.getFormBeanName() == null
|| ( conflictingActionMapping.getFormBeanName() != null
&& getBeanType( mapping ).compareTo( getBeanType( conflictingActionMapping ) ) < 0 ) )
{
_actionMappings.remove( mappingPath );
_actionMappings.put( mappingPath, mapping );
defaultMappingForThisPath = mapping;
conflictingActionMapping.setOverloaded( false );
addDisambiguatedActionMapping( conflictingActionMapping );
}
else
{
addDisambiguatedActionMapping( mapping );
}
defaultMappingForThisPath.setOverloaded( true );
defaultMappingForThisPath.setComment( DUPLICATE_ACTION_COMMENT.replaceAll( "\\{0\\}", mappingPath ) ); // @TODO I18N
}
else
{
_actionMappings.put( mappingPath, mapping );
}
}
|
[
"public",
"void",
"addActionMapping",
"(",
"ActionModel",
"mapping",
")",
"{",
"String",
"mappingPath",
"=",
"mapping",
".",
"getPath",
"(",
")",
";",
"ActionModel",
"conflictingActionMapping",
"=",
"(",
"ActionModel",
")",
"_actionMappings",
".",
"get",
"(",
"mappingPath",
")",
";",
"if",
"(",
"conflictingActionMapping",
"!=",
"null",
")",
"{",
"ActionModel",
"defaultMappingForThisPath",
"=",
"conflictingActionMapping",
";",
"//",
"// If the new action mapping takes no form, then it has the highest precedence, and replaces the existing",
"// \"natural\" mapping for the given path. Otherwise, replace the existing one if the existing one has a",
"// form bean and if the new mapping's form bean type comes alphabetically before the existing one's.",
"//",
"if",
"(",
"mapping",
".",
"getFormBeanName",
"(",
")",
"==",
"null",
"||",
"(",
"conflictingActionMapping",
".",
"getFormBeanName",
"(",
")",
"!=",
"null",
"&&",
"getBeanType",
"(",
"mapping",
")",
".",
"compareTo",
"(",
"getBeanType",
"(",
"conflictingActionMapping",
")",
")",
"<",
"0",
")",
")",
"{",
"_actionMappings",
".",
"remove",
"(",
"mappingPath",
")",
";",
"_actionMappings",
".",
"put",
"(",
"mappingPath",
",",
"mapping",
")",
";",
"defaultMappingForThisPath",
"=",
"mapping",
";",
"conflictingActionMapping",
".",
"setOverloaded",
"(",
"false",
")",
";",
"addDisambiguatedActionMapping",
"(",
"conflictingActionMapping",
")",
";",
"}",
"else",
"{",
"addDisambiguatedActionMapping",
"(",
"mapping",
")",
";",
"}",
"defaultMappingForThisPath",
".",
"setOverloaded",
"(",
"true",
")",
";",
"defaultMappingForThisPath",
".",
"setComment",
"(",
"DUPLICATE_ACTION_COMMENT",
".",
"replaceAll",
"(",
"\"\\\\{0\\\\}\"",
",",
"mappingPath",
")",
")",
";",
"// @TODO I18N",
"}",
"else",
"{",
"_actionMappings",
".",
"put",
"(",
"mappingPath",
",",
"mapping",
")",
";",
"}",
"}"
] |
Adds a new ActionMapping to this StrutsApp.
|
[
"Adds",
"a",
"new",
"ActionMapping",
"to",
"this",
"StrutsApp",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/StrutsApp.java#L136-L172
|
146,681
|
moparisthebest/beehive
|
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/StrutsApp.java
|
StrutsApp.getFormBeansAsList
|
public List getFormBeansAsList()
{
ArrayList retList = new ArrayList();
for ( Iterator i = _formBeans.values().iterator(); i.hasNext(); )
{
FormBeanModel fb = ( FormBeanModel ) i.next();
if ( fb != null ) retList.add( fb );
}
return retList;
}
|
java
|
public List getFormBeansAsList()
{
ArrayList retList = new ArrayList();
for ( Iterator i = _formBeans.values().iterator(); i.hasNext(); )
{
FormBeanModel fb = ( FormBeanModel ) i.next();
if ( fb != null ) retList.add( fb );
}
return retList;
}
|
[
"public",
"List",
"getFormBeansAsList",
"(",
")",
"{",
"ArrayList",
"retList",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"Iterator",
"i",
"=",
"_formBeans",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"FormBeanModel",
"fb",
"=",
"(",
"FormBeanModel",
")",
"i",
".",
"next",
"(",
")",
";",
"if",
"(",
"fb",
"!=",
"null",
")",
"retList",
".",
"add",
"(",
"fb",
")",
";",
"}",
"return",
"retList",
";",
"}"
] |
Returns a list of all the form beans that are defined for this StrutsApp.
|
[
"Returns",
"a",
"list",
"of",
"all",
"the",
"form",
"beans",
"that",
"are",
"defined",
"for",
"this",
"StrutsApp",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/StrutsApp.java#L228-L239
|
146,682
|
moparisthebest/beehive
|
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ClientInitializer.java
|
ClientInitializer.getAnnotationMap
|
public static PropertyMap getAnnotationMap(ControlBeanContext cbc, AnnotatedElement annotElem)
{
if ( cbc == null )
return new AnnotatedElementMap(annotElem);
return cbc.getAnnotationMap(annotElem);
}
|
java
|
public static PropertyMap getAnnotationMap(ControlBeanContext cbc, AnnotatedElement annotElem)
{
if ( cbc == null )
return new AnnotatedElementMap(annotElem);
return cbc.getAnnotationMap(annotElem);
}
|
[
"public",
"static",
"PropertyMap",
"getAnnotationMap",
"(",
"ControlBeanContext",
"cbc",
",",
"AnnotatedElement",
"annotElem",
")",
"{",
"if",
"(",
"cbc",
"==",
"null",
")",
"return",
"new",
"AnnotatedElementMap",
"(",
"annotElem",
")",
";",
"return",
"cbc",
".",
"getAnnotationMap",
"(",
"annotElem",
")",
";",
"}"
] |
Returns the annotation map for the specified element.
|
[
"Returns",
"the",
"annotation",
"map",
"for",
"the",
"specified",
"element",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ClientInitializer.java#L56-L62
|
146,683
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Exceptions.java
|
Exceptions.doTag
|
public void doTag()
throws JspException
{
// First look for the exception in the pageflow/struts request attribute. If it's not there,
// look for it in the request attribute the container provides for web.xml-configured error
// pages.
InternalStringBuilder results = new InternalStringBuilder(128);
PageContext pageContext = getPageContext();
Throwable e = (Throwable) pageContext.getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE);
if (e == null) {
ServletRequest req = pageContext.getRequest();
e = (Throwable) req.getAttribute("javax.servlet.error.exception");
if (e == null) {
e = (Throwable) req.getAttribute("javax.servlet.jsp.jspException");
}
}
if (!_showStackTrace && _showDevModeStackTrace) {
boolean devMode = !AdapterManager.getServletContainerAdapter(pageContext.getServletContext()).isInProductionMode();
if (devMode)
_showStackTrace = true;
}
if (e != null) {
if (_showMessage) {
String msg = e.getMessage();
// if we have message lets output the exception name and the name of the
if ((msg != null) && (msg.length() > 0)) {
if (!_showStackTrace)
msg = e.getClass().getName() + ": " + msg;
results.append(HtmlExceptionFormatter.format(msg, e, _showStackTrace));
}
else {
results.append(HtmlExceptionFormatter.format(e.getClass().getName(), e, _showStackTrace));
}
}
else {
results.append(HtmlExceptionFormatter.format(null, e, _showStackTrace));
}
ResponseUtils.write(pageContext, results.toString());
}
}
|
java
|
public void doTag()
throws JspException
{
// First look for the exception in the pageflow/struts request attribute. If it's not there,
// look for it in the request attribute the container provides for web.xml-configured error
// pages.
InternalStringBuilder results = new InternalStringBuilder(128);
PageContext pageContext = getPageContext();
Throwable e = (Throwable) pageContext.getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE);
if (e == null) {
ServletRequest req = pageContext.getRequest();
e = (Throwable) req.getAttribute("javax.servlet.error.exception");
if (e == null) {
e = (Throwable) req.getAttribute("javax.servlet.jsp.jspException");
}
}
if (!_showStackTrace && _showDevModeStackTrace) {
boolean devMode = !AdapterManager.getServletContainerAdapter(pageContext.getServletContext()).isInProductionMode();
if (devMode)
_showStackTrace = true;
}
if (e != null) {
if (_showMessage) {
String msg = e.getMessage();
// if we have message lets output the exception name and the name of the
if ((msg != null) && (msg.length() > 0)) {
if (!_showStackTrace)
msg = e.getClass().getName() + ": " + msg;
results.append(HtmlExceptionFormatter.format(msg, e, _showStackTrace));
}
else {
results.append(HtmlExceptionFormatter.format(e.getClass().getName(), e, _showStackTrace));
}
}
else {
results.append(HtmlExceptionFormatter.format(null, e, _showStackTrace));
}
ResponseUtils.write(pageContext, results.toString());
}
}
|
[
"public",
"void",
"doTag",
"(",
")",
"throws",
"JspException",
"{",
"// First look for the exception in the pageflow/struts request attribute. If it's not there,",
"// look for it in the request attribute the container provides for web.xml-configured error",
"// pages.",
"InternalStringBuilder",
"results",
"=",
"new",
"InternalStringBuilder",
"(",
"128",
")",
";",
"PageContext",
"pageContext",
"=",
"getPageContext",
"(",
")",
";",
"Throwable",
"e",
"=",
"(",
"Throwable",
")",
"pageContext",
".",
"getAttribute",
"(",
"Globals",
".",
"EXCEPTION_KEY",
",",
"PageContext",
".",
"REQUEST_SCOPE",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"ServletRequest",
"req",
"=",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"e",
"=",
"(",
"Throwable",
")",
"req",
".",
"getAttribute",
"(",
"\"javax.servlet.error.exception\"",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"e",
"=",
"(",
"Throwable",
")",
"req",
".",
"getAttribute",
"(",
"\"javax.servlet.jsp.jspException\"",
")",
";",
"}",
"}",
"if",
"(",
"!",
"_showStackTrace",
"&&",
"_showDevModeStackTrace",
")",
"{",
"boolean",
"devMode",
"=",
"!",
"AdapterManager",
".",
"getServletContainerAdapter",
"(",
"pageContext",
".",
"getServletContext",
"(",
")",
")",
".",
"isInProductionMode",
"(",
")",
";",
"if",
"(",
"devMode",
")",
"_showStackTrace",
"=",
"true",
";",
"}",
"if",
"(",
"e",
"!=",
"null",
")",
"{",
"if",
"(",
"_showMessage",
")",
"{",
"String",
"msg",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"// if we have message lets output the exception name and the name of the",
"if",
"(",
"(",
"msg",
"!=",
"null",
")",
"&&",
"(",
"msg",
".",
"length",
"(",
")",
">",
"0",
")",
")",
"{",
"if",
"(",
"!",
"_showStackTrace",
")",
"msg",
"=",
"e",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\": \"",
"+",
"msg",
";",
"results",
".",
"append",
"(",
"HtmlExceptionFormatter",
".",
"format",
"(",
"msg",
",",
"e",
",",
"_showStackTrace",
")",
")",
";",
"}",
"else",
"{",
"results",
".",
"append",
"(",
"HtmlExceptionFormatter",
".",
"format",
"(",
"e",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"e",
",",
"_showStackTrace",
")",
")",
";",
"}",
"}",
"else",
"{",
"results",
".",
"append",
"(",
"HtmlExceptionFormatter",
".",
"format",
"(",
"null",
",",
"e",
",",
"_showStackTrace",
")",
")",
";",
"}",
"ResponseUtils",
".",
"write",
"(",
"pageContext",
",",
"results",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] |
Render the exception text based on the display attributes.
@throws JspException if a JSP exception has occurred
|
[
"Render",
"the",
"exception",
"text",
"based",
"on",
"the",
"display",
"attributes",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Exceptions.java#L104-L146
|
146,684
|
moparisthebest/beehive
|
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java
|
ExpressionToken.parseIndex
|
protected final int parseIndex(String indexString) {
try {
return Integer.parseInt(indexString);
} catch(Exception e) {
String msg = "Error converting \"" + indexString + "\" into an integer. Cause: " + e;
LOGGER.error(msg, e);
throw new RuntimeException(msg, e);
}
}
|
java
|
protected final int parseIndex(String indexString) {
try {
return Integer.parseInt(indexString);
} catch(Exception e) {
String msg = "Error converting \"" + indexString + "\" into an integer. Cause: " + e;
LOGGER.error(msg, e);
throw new RuntimeException(msg, e);
}
}
|
[
"protected",
"final",
"int",
"parseIndex",
"(",
"String",
"indexString",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"indexString",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"String",
"msg",
"=",
"\"Error converting \\\"\"",
"+",
"indexString",
"+",
"\"\\\" into an integer. Cause: \"",
"+",
"e",
";",
"LOGGER",
".",
"error",
"(",
"msg",
",",
"e",
")",
";",
"throw",
"new",
"RuntimeException",
"(",
"msg",
",",
"e",
")",
";",
"}",
"}"
] |
Attempt to convert a String indexString into an integer index.
@param indexString the index string
@return the converted integer
|
[
"Attempt",
"to",
"convert",
"a",
"String",
"indexString",
"into",
"an",
"integer",
"index",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java#L236-L244
|
146,685
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Metrics.java
|
Metrics.createGraph
|
public Graph createGraph(final String name) {
if (name == null) {
throw new IllegalArgumentException("Graph name cannot be null");
}
// Construct the graph object
final Graph graph = new Graph(name);
// Now we can add our graph
graphs.add(graph);
// and return back
return graph;
}
|
java
|
public Graph createGraph(final String name) {
if (name == null) {
throw new IllegalArgumentException("Graph name cannot be null");
}
// Construct the graph object
final Graph graph = new Graph(name);
// Now we can add our graph
graphs.add(graph);
// and return back
return graph;
}
|
[
"public",
"Graph",
"createGraph",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Graph name cannot be null\"",
")",
";",
"}",
"// Construct the graph object",
"final",
"Graph",
"graph",
"=",
"new",
"Graph",
"(",
"name",
")",
";",
"// Now we can add our graph",
"graphs",
".",
"add",
"(",
"graph",
")",
";",
"// and return back",
"return",
"graph",
";",
"}"
] |
Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
website. Plotters can be added to the graph object returned.
@param name The name of the graph
@return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given
|
[
"Construct",
"and",
"create",
"a",
"Graph",
"that",
"can",
"be",
"used",
"to",
"separate",
"specific",
"plotters",
"to",
"their",
"own",
"graphs",
"on",
"the",
"metrics",
"website",
".",
"Plotters",
"can",
"be",
"added",
"to",
"the",
"graph",
"object",
"returned",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Metrics.java#L179-L192
|
146,686
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Metrics.java
|
Metrics.isOptOut
|
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
properties.load(new FileInputStream(configurationFile));
} catch (IOException ex) {
if (debug) {
System.out.println("[Metrics] " + ex.getMessage());
}
return true;
}
return Boolean.parseBoolean(properties.getProperty("opt-out"));
}
}
|
java
|
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
properties.load(new FileInputStream(configurationFile));
} catch (IOException ex) {
if (debug) {
System.out.println("[Metrics] " + ex.getMessage());
}
return true;
}
return Boolean.parseBoolean(properties.getProperty("opt-out"));
}
}
|
[
"public",
"boolean",
"isOptOut",
"(",
")",
"{",
"synchronized",
"(",
"optOutLock",
")",
"{",
"try",
"{",
"// Reload the metrics file",
"properties",
".",
"load",
"(",
"new",
"FileInputStream",
"(",
"configurationFile",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"if",
"(",
"debug",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"[Metrics] \"",
"+",
"ex",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"return",
"true",
";",
"}",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"properties",
".",
"getProperty",
"(",
"\"opt-out\"",
")",
")",
";",
"}",
"}"
] |
Has the server owner denied plugin metrics?
@return true if metrics should be opted out of it
|
[
"Has",
"the",
"server",
"owner",
"denied",
"plugin",
"metrics?"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Metrics.java#L283-L297
|
146,687
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Metrics.java
|
Metrics.enable
|
public void enable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (isOptOut()) {
properties.setProperty("opt-out", "false");
properties.store(new FileOutputStream(configurationFile), "http://mcstats.org");
}
// Enable Task, if it is not running
if (thread == null) {
start();
}
}
}
|
java
|
public void enable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (isOptOut()) {
properties.setProperty("opt-out", "false");
properties.store(new FileOutputStream(configurationFile), "http://mcstats.org");
}
// Enable Task, if it is not running
if (thread == null) {
start();
}
}
}
|
[
"public",
"void",
"enable",
"(",
")",
"throws",
"IOException",
"{",
"// This has to be synchronized or it can collide with the check in the task.",
"synchronized",
"(",
"optOutLock",
")",
"{",
"// Check if the server owner has already set opt-out, if not, set it.",
"if",
"(",
"isOptOut",
"(",
")",
")",
"{",
"properties",
".",
"setProperty",
"(",
"\"opt-out\"",
",",
"\"false\"",
")",
";",
"properties",
".",
"store",
"(",
"new",
"FileOutputStream",
"(",
"configurationFile",
")",
",",
"\"http://mcstats.org\"",
")",
";",
"}",
"// Enable Task, if it is not running",
"if",
"(",
"thread",
"==",
"null",
")",
"{",
"start",
"(",
")",
";",
"}",
"}",
"}"
] |
Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
@throws java.io.IOException
|
[
"Enables",
"metrics",
"for",
"the",
"server",
"by",
"setting",
"opt",
"-",
"out",
"to",
"false",
"in",
"the",
"config",
"file",
"and",
"starting",
"the",
"metrics",
"task",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Metrics.java#L304-L318
|
146,688
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Metrics.java
|
Metrics.disable
|
public void disable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (!isOptOut()) {
properties.setProperty("opt-out", "true");
properties.store(new FileOutputStream(configurationFile), "http://mcstats.org");
}
// Disable Task, if it is running
if (thread != null) {
thread.interrupt();
thread = null;
}
}
}
|
java
|
public void disable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (!isOptOut()) {
properties.setProperty("opt-out", "true");
properties.store(new FileOutputStream(configurationFile), "http://mcstats.org");
}
// Disable Task, if it is running
if (thread != null) {
thread.interrupt();
thread = null;
}
}
}
|
[
"public",
"void",
"disable",
"(",
")",
"throws",
"IOException",
"{",
"// This has to be synchronized or it can collide with the check in the task.",
"synchronized",
"(",
"optOutLock",
")",
"{",
"// Check if the server owner has already set opt-out, if not, set it.",
"if",
"(",
"!",
"isOptOut",
"(",
")",
")",
"{",
"properties",
".",
"setProperty",
"(",
"\"opt-out\"",
",",
"\"true\"",
")",
";",
"properties",
".",
"store",
"(",
"new",
"FileOutputStream",
"(",
"configurationFile",
")",
",",
"\"http://mcstats.org\"",
")",
";",
"}",
"// Disable Task, if it is running",
"if",
"(",
"thread",
"!=",
"null",
")",
"{",
"thread",
".",
"interrupt",
"(",
")",
";",
"thread",
"=",
"null",
";",
"}",
"}",
"}"
] |
Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
@throws java.io.IOException
|
[
"Disables",
"metrics",
"for",
"the",
"server",
"by",
"setting",
"opt",
"-",
"out",
"to",
"true",
"in",
"the",
"config",
"file",
"and",
"canceling",
"the",
"metrics",
"task",
"."
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Metrics.java#L325-L340
|
146,689
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Metrics.java
|
Metrics.gzip
|
public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (gzos != null) {
try {
gzos.close();
} catch (IOException ignore) {
}
}
}
return baos.toByteArray();
}
|
java
|
public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (gzos != null) {
try {
gzos.close();
} catch (IOException ignore) {
}
}
}
return baos.toByteArray();
}
|
[
"public",
"static",
"byte",
"[",
"]",
"gzip",
"(",
"String",
"input",
")",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"GZIPOutputStream",
"gzos",
"=",
"null",
";",
"try",
"{",
"gzos",
"=",
"new",
"GZIPOutputStream",
"(",
"baos",
")",
";",
"gzos",
".",
"write",
"(",
"input",
".",
"getBytes",
"(",
"\"UTF-8\"",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"gzos",
"!=",
"null",
")",
"{",
"try",
"{",
"gzos",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ignore",
")",
"{",
"}",
"}",
"}",
"return",
"baos",
".",
"toByteArray",
"(",
")",
";",
"}"
] |
GZip compress a string of bytes
@param input
@return a byte array
|
[
"GZip",
"compress",
"a",
"string",
"of",
"bytes"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Metrics.java#L504-L523
|
146,690
|
greatman/GreatmancodeTools
|
src/main/java/com/greatmancode/tools/utils/Metrics.java
|
Metrics.escapeJSON
|
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
builder.append('\\');
builder.append(chr);
break;
case '\b':
builder.append("\\b");
break;
case '\t':
builder.append("\\t");
break;
case '\n':
builder.append("\\n");
break;
case '\r':
builder.append("\\r");
break;
default:
if (chr < ' ') {
String t = "000" + Integer.toHexString(chr);
builder.append("\\u" + t.substring(t.length() - 4));
} else {
builder.append(chr);
}
break;
}
}
builder.append('"');
return builder.toString();
}
|
java
|
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
builder.append('\\');
builder.append(chr);
break;
case '\b':
builder.append("\\b");
break;
case '\t':
builder.append("\\t");
break;
case '\n':
builder.append("\\n");
break;
case '\r':
builder.append("\\r");
break;
default:
if (chr < ' ') {
String t = "000" + Integer.toHexString(chr);
builder.append("\\u" + t.substring(t.length() - 4));
} else {
builder.append(chr);
}
break;
}
}
builder.append('"');
return builder.toString();
}
|
[
"private",
"static",
"String",
"escapeJSON",
"(",
"String",
"text",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"text",
".",
"length",
"(",
")",
";",
"index",
"++",
")",
"{",
"char",
"chr",
"=",
"text",
".",
"charAt",
"(",
"index",
")",
";",
"switch",
"(",
"chr",
")",
"{",
"case",
"'",
"'",
":",
"case",
"'",
"'",
":",
"builder",
".",
"append",
"(",
"'",
"'",
")",
";",
"builder",
".",
"append",
"(",
"chr",
")",
";",
"break",
";",
"case",
"'",
"'",
":",
"builder",
".",
"append",
"(",
"\"\\\\b\"",
")",
";",
"break",
";",
"case",
"'",
"'",
":",
"builder",
".",
"append",
"(",
"\"\\\\t\"",
")",
";",
"break",
";",
"case",
"'",
"'",
":",
"builder",
".",
"append",
"(",
"\"\\\\n\"",
")",
";",
"break",
";",
"case",
"'",
"'",
":",
"builder",
".",
"append",
"(",
"\"\\\\r\"",
")",
";",
"break",
";",
"default",
":",
"if",
"(",
"chr",
"<",
"'",
"'",
")",
"{",
"String",
"t",
"=",
"\"000\"",
"+",
"Integer",
".",
"toHexString",
"(",
"chr",
")",
";",
"builder",
".",
"append",
"(",
"\"\\\\u\"",
"+",
"t",
".",
"substring",
"(",
"t",
".",
"length",
"(",
")",
"-",
"4",
")",
")",
";",
"}",
"else",
"{",
"builder",
".",
"append",
"(",
"chr",
")",
";",
"}",
"break",
";",
"}",
"}",
"builder",
".",
"append",
"(",
"'",
"'",
")",
";",
"return",
"builder",
".",
"toString",
"(",
")",
";",
"}"
] |
Escape a string to create a valid JSON string
@param text
@return
|
[
"Escape",
"a",
"string",
"to",
"create",
"a",
"valid",
"JSON",
"string"
] |
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
|
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Metrics.java#L579-L617
|
146,691
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
|
Repeater.addContent
|
public void addContent(String content) {
if(_contentBuffer == null) {
int size = (content != null ? (5 * content.length()) : 1024);
_contentBuffer = new InternalStringBuilder(size);
}
_contentBuffer.append(content);
}
|
java
|
public void addContent(String content) {
if(_contentBuffer == null) {
int size = (content != null ? (5 * content.length()) : 1024);
_contentBuffer = new InternalStringBuilder(size);
}
_contentBuffer.append(content);
}
|
[
"public",
"void",
"addContent",
"(",
"String",
"content",
")",
"{",
"if",
"(",
"_contentBuffer",
"==",
"null",
")",
"{",
"int",
"size",
"=",
"(",
"content",
"!=",
"null",
"?",
"(",
"5",
"*",
"content",
".",
"length",
"(",
")",
")",
":",
"1024",
")",
";",
"_contentBuffer",
"=",
"new",
"InternalStringBuilder",
"(",
"size",
")",
";",
"}",
"_contentBuffer",
".",
"append",
"(",
"content",
")",
";",
"}"
] |
Add content to the content that is being buffered by this tag. All content
written by the body of this tag is added to this buffer. The buffer is rendered
at the end of the tag's lifecycle if no fatal errors have occurred during this
tag's lifecycle.
@param content content that this tag should render.
|
[
"Add",
"content",
"to",
"the",
"content",
"that",
"is",
"being",
"buffered",
"by",
"this",
"tag",
".",
"All",
"content",
"written",
"by",
"the",
"body",
"of",
"this",
"tag",
"is",
"added",
"to",
"this",
"buffer",
".",
"The",
"buffer",
"is",
"rendered",
"at",
"the",
"end",
"of",
"the",
"tag",
"s",
"lifecycle",
"if",
"no",
"fatal",
"errors",
"have",
"occurred",
"during",
"this",
"tag",
"s",
"lifecycle",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java#L336-L343
|
146,692
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
|
Repeater.doStartTag
|
public int doStartTag()
throws JspException {
Object source = evaluateDataSource();
// report any errors that may have occured
if(hasErrors())
return SKIP_BODY;
_renderState = INIT;
boolean empty = false;
if(source != null) {
_iterator = IteratorFactory.createIterator(source);
if(_iterator == null) {
LOGGER.warn(Bundle.getString("Tags_Repeater_nullIterator"));
_iterator = Collections.EMPTY_LIST.iterator();
}
if(_iterator.hasNext()) {
_currentIndex = 0;
_currentItem = _iterator.next();
if(_ignoreNulls && _currentItem == null) {
/*
doStartTag doesn't know if the repeater is structured or unstructured
thus, if ignoreNulls is true, it's going to make an attempt to go
through the body with a non-null item. if there are no non-null
items in the data structure, the doAfterBody method will handle
this correctly, but a data structure with a null first item
will render the same as a data structure with a null second item
*/
advanceToNonNullItem();
/*
this null check needs to re-run here because the advanceToNonNullItem method
side-effects the _currentItem.
*/
if(_currentItem == null)
empty = true;
}
}
/* there is no data set of there are zero items in the iterator */
else empty = true;
}
/* the dataSource evaluated to null */
else {
_iterator = Collections.EMPTY_LIST.iterator();
empty = true;
}
if(empty) {
/* if the defaultText attribute is non-null, it will be evaluated as an expression and rendered to the page */
if(_defaultText != null)
addContent(_defaultText.toString());
return SKIP_BODY;
}
else {
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
_containerInPageContext = true;
return EVAL_BODY_BUFFERED;
}
}
|
java
|
public int doStartTag()
throws JspException {
Object source = evaluateDataSource();
// report any errors that may have occured
if(hasErrors())
return SKIP_BODY;
_renderState = INIT;
boolean empty = false;
if(source != null) {
_iterator = IteratorFactory.createIterator(source);
if(_iterator == null) {
LOGGER.warn(Bundle.getString("Tags_Repeater_nullIterator"));
_iterator = Collections.EMPTY_LIST.iterator();
}
if(_iterator.hasNext()) {
_currentIndex = 0;
_currentItem = _iterator.next();
if(_ignoreNulls && _currentItem == null) {
/*
doStartTag doesn't know if the repeater is structured or unstructured
thus, if ignoreNulls is true, it's going to make an attempt to go
through the body with a non-null item. if there are no non-null
items in the data structure, the doAfterBody method will handle
this correctly, but a data structure with a null first item
will render the same as a data structure with a null second item
*/
advanceToNonNullItem();
/*
this null check needs to re-run here because the advanceToNonNullItem method
side-effects the _currentItem.
*/
if(_currentItem == null)
empty = true;
}
}
/* there is no data set of there are zero items in the iterator */
else empty = true;
}
/* the dataSource evaluated to null */
else {
_iterator = Collections.EMPTY_LIST.iterator();
empty = true;
}
if(empty) {
/* if the defaultText attribute is non-null, it will be evaluated as an expression and rendered to the page */
if(_defaultText != null)
addContent(_defaultText.toString());
return SKIP_BODY;
}
else {
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
_containerInPageContext = true;
return EVAL_BODY_BUFFERED;
}
}
|
[
"public",
"int",
"doStartTag",
"(",
")",
"throws",
"JspException",
"{",
"Object",
"source",
"=",
"evaluateDataSource",
"(",
")",
";",
"// report any errors that may have occured ",
"if",
"(",
"hasErrors",
"(",
")",
")",
"return",
"SKIP_BODY",
";",
"_renderState",
"=",
"INIT",
";",
"boolean",
"empty",
"=",
"false",
";",
"if",
"(",
"source",
"!=",
"null",
")",
"{",
"_iterator",
"=",
"IteratorFactory",
".",
"createIterator",
"(",
"source",
")",
";",
"if",
"(",
"_iterator",
"==",
"null",
")",
"{",
"LOGGER",
".",
"warn",
"(",
"Bundle",
".",
"getString",
"(",
"\"Tags_Repeater_nullIterator\"",
")",
")",
";",
"_iterator",
"=",
"Collections",
".",
"EMPTY_LIST",
".",
"iterator",
"(",
")",
";",
"}",
"if",
"(",
"_iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"_currentIndex",
"=",
"0",
";",
"_currentItem",
"=",
"_iterator",
".",
"next",
"(",
")",
";",
"if",
"(",
"_ignoreNulls",
"&&",
"_currentItem",
"==",
"null",
")",
"{",
"/*\n doStartTag doesn't know if the repeater is structured or unstructured\n thus, if ignoreNulls is true, it's going to make an attempt to go\n through the body with a non-null item. if there are no non-null\n items in the data structure, the doAfterBody method will handle\n this correctly, but a data structure with a null first item\n will render the same as a data structure with a null second item\n */",
"advanceToNonNullItem",
"(",
")",
";",
"/*\n this null check needs to re-run here because the advanceToNonNullItem method\n side-effects the _currentItem.\n */",
"if",
"(",
"_currentItem",
"==",
"null",
")",
"empty",
"=",
"true",
";",
"}",
"}",
"/* there is no data set of there are zero items in the iterator */",
"else",
"empty",
"=",
"true",
";",
"}",
"/* the dataSource evaluated to null */",
"else",
"{",
"_iterator",
"=",
"Collections",
".",
"EMPTY_LIST",
".",
"iterator",
"(",
")",
";",
"empty",
"=",
"true",
";",
"}",
"if",
"(",
"empty",
")",
"{",
"/* if the defaultText attribute is non-null, it will be evaluated as an expression and rendered to the page */",
"if",
"(",
"_defaultText",
"!=",
"null",
")",
"addContent",
"(",
"_defaultText",
".",
"toString",
"(",
")",
")",
";",
"return",
"SKIP_BODY",
";",
"}",
"else",
"{",
"DataAccessProviderStack",
".",
"addDataAccessProvider",
"(",
"this",
",",
"pageContext",
")",
";",
"_containerInPageContext",
"=",
"true",
";",
"return",
"EVAL_BODY_BUFFERED",
";",
"}",
"}"
] |
Start rendering the repeater.
@return {@link #SKIP_BODY} if an error occurs; {@link #EVAL_BODY_BUFFERED} otherwise
@throws JspException if an error occurs that can not be reported in the page
|
[
"Start",
"rendering",
"the",
"repeater",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java#L360-L421
|
146,693
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
|
Repeater.doEndTag
|
public int doEndTag()
throws JspException {
if(hasErrors())
reportErrors();
else if(_contentBuffer != null)
write(_contentBuffer.toString());
return EVAL_PAGE;
}
|
java
|
public int doEndTag()
throws JspException {
if(hasErrors())
reportErrors();
else if(_contentBuffer != null)
write(_contentBuffer.toString());
return EVAL_PAGE;
}
|
[
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"hasErrors",
"(",
")",
")",
"reportErrors",
"(",
")",
";",
"else",
"if",
"(",
"_contentBuffer",
"!=",
"null",
")",
"write",
"(",
"_contentBuffer",
".",
"toString",
"(",
")",
")",
";",
"return",
"EVAL_PAGE",
";",
"}"
] |
Complete rendering the repeater.
@return {@link #EVAL_PAGE}
@throws JspException if an error occurs that can not be reported in the page
|
[
"Complete",
"rendering",
"the",
"repeater",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java#L478-L487
|
146,694
|
moparisthebest/beehive
|
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
|
Repeater.evaluateDataSource
|
private Object evaluateDataSource()
throws JspException {
ExpressionHandling expr = new ExpressionHandling(this);
String dataSource = getDataSource();
String ds = expr.ensureValidExpression(dataSource, "dataSource", "DataSourceError");
if (ds == null)
return null;
/* have a valid expression */
return expr.evaluateExpression(dataSource, "dataSource", pageContext);
}
|
java
|
private Object evaluateDataSource()
throws JspException {
ExpressionHandling expr = new ExpressionHandling(this);
String dataSource = getDataSource();
String ds = expr.ensureValidExpression(dataSource, "dataSource", "DataSourceError");
if (ds == null)
return null;
/* have a valid expression */
return expr.evaluateExpression(dataSource, "dataSource", pageContext);
}
|
[
"private",
"Object",
"evaluateDataSource",
"(",
")",
"throws",
"JspException",
"{",
"ExpressionHandling",
"expr",
"=",
"new",
"ExpressionHandling",
"(",
"this",
")",
";",
"String",
"dataSource",
"=",
"getDataSource",
"(",
")",
";",
"String",
"ds",
"=",
"expr",
".",
"ensureValidExpression",
"(",
"dataSource",
",",
"\"dataSource\"",
",",
"\"DataSourceError\"",
")",
";",
"if",
"(",
"ds",
"==",
"null",
")",
"return",
"null",
";",
"/* have a valid expression */",
"return",
"expr",
".",
"evaluateExpression",
"(",
"dataSource",
",",
"\"dataSource\"",
",",
"pageContext",
")",
";",
"}"
] |
Return the Object that is represented by the specified data source.
@return Object
@throws JspException
|
[
"Return",
"the",
"Object",
"that",
"is",
"represented",
"by",
"the",
"specified",
"data",
"source",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java#L747-L757
|
146,695
|
moparisthebest/beehive
|
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java
|
EJBJarDescriptorHandler.insertEJBRefsInEJBJar
|
private void insertEJBRefsInEJBJar(Document document, EJBInfo ejbInfo, String ejbLinkValue, List ejbList) {
for (Object ejb : ejbList) {
if (ejbInfo.isLocal())
insertEJBLocalRefInEJBJar((Element)ejb, ejbInfo, ejbLinkValue, document);
else
insertEJBRefInEJBJar((Element)ejb, ejbInfo, ejbLinkValue, document);
}
}
|
java
|
private void insertEJBRefsInEJBJar(Document document, EJBInfo ejbInfo, String ejbLinkValue, List ejbList) {
for (Object ejb : ejbList) {
if (ejbInfo.isLocal())
insertEJBLocalRefInEJBJar((Element)ejb, ejbInfo, ejbLinkValue, document);
else
insertEJBRefInEJBJar((Element)ejb, ejbInfo, ejbLinkValue, document);
}
}
|
[
"private",
"void",
"insertEJBRefsInEJBJar",
"(",
"Document",
"document",
",",
"EJBInfo",
"ejbInfo",
",",
"String",
"ejbLinkValue",
",",
"List",
"ejbList",
")",
"{",
"for",
"(",
"Object",
"ejb",
":",
"ejbList",
")",
"{",
"if",
"(",
"ejbInfo",
".",
"isLocal",
"(",
")",
")",
"insertEJBLocalRefInEJBJar",
"(",
"(",
"Element",
")",
"ejb",
",",
"ejbInfo",
",",
"ejbLinkValue",
",",
"document",
")",
";",
"else",
"insertEJBRefInEJBJar",
"(",
"(",
"Element",
")",
"ejb",
",",
"ejbInfo",
",",
"ejbLinkValue",
",",
"document",
")",
";",
"}",
"}"
] |
Insert EJB references in all of the descriptors of the EJB's in the supplied list
@param document DOM tree of an ejb-jar.xml file.
@param ejbInfo Contains information about the EJB control.
@param ejbLinkValue The ejb-link value for the EJBs.
@param ejbList The list of EJB's
|
[
"Insert",
"EJB",
"references",
"in",
"all",
"of",
"the",
"descriptors",
"of",
"the",
"EJB",
"s",
"in",
"the",
"supplied",
"list"
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java#L93-L100
|
146,696
|
moparisthebest/beehive
|
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java
|
EJBJarDescriptorHandler.insertEJBRefInEJBJar
|
private void insertEJBRefInEJBJar(Element ejb, EJBInfo ei, String ejbLinkValue, Document ejbDoc) {
List ejbRefArray = DomUtils.getChildElementsByName(ejb, "ejb-ref");
String insertedEjbRefName = ei.getRefName();
Node nextSibling = null;
for (int j = ejbRefArray.size() - 1; j >= 0; j--) {
Element ejbRef = (Element) ejbRefArray.get(j);
String ejbRefName = DomUtils.getChildElementText(ejbRef, "ejb-ref-name");
if (insertedEjbRefName.equals(ejbRefName)) {
nextSibling = ejbRef.getNextSibling();
ejb.removeChild(ejbRef);
break;
}
}
// insert a new <ejb-ref> entry and fill in the values
Element insertedEjbRef = ejbDoc.createElement("ejb-ref");
if (nextSibling != null) {
ejb.insertBefore(insertedEjbRef, nextSibling);
}
else {
ejb.insertBefore(insertedEjbRef, findEjbRefInsertPoint(ejb));
}
Element ejbRefName = ejbDoc.createElement("ejb-ref-name");
ejbRefName.setTextContent(insertedEjbRefName);
insertedEjbRef.appendChild(ejbRefName);
Element ejbRefType = ejbDoc.createElement("ejb-ref-type");
ejbRefType.setTextContent(ei.getBeanType());
insertedEjbRef.appendChild(ejbRefType);
Element homeType = ejbDoc.createElement("home");
homeType.setTextContent(ei.getHomeInterface().getName());
insertedEjbRef.appendChild(homeType);
Element remoteType = ejbDoc.createElement("remote");
remoteType.setTextContent(ei.getBeanInterface().getName());
insertedEjbRef.appendChild(remoteType);
Element ejbLink = ejbDoc.createElement("ejb-link");
ejbLink.setTextContent(ejbLinkValue);
insertedEjbRef.appendChild(ejbLink);
}
|
java
|
private void insertEJBRefInEJBJar(Element ejb, EJBInfo ei, String ejbLinkValue, Document ejbDoc) {
List ejbRefArray = DomUtils.getChildElementsByName(ejb, "ejb-ref");
String insertedEjbRefName = ei.getRefName();
Node nextSibling = null;
for (int j = ejbRefArray.size() - 1; j >= 0; j--) {
Element ejbRef = (Element) ejbRefArray.get(j);
String ejbRefName = DomUtils.getChildElementText(ejbRef, "ejb-ref-name");
if (insertedEjbRefName.equals(ejbRefName)) {
nextSibling = ejbRef.getNextSibling();
ejb.removeChild(ejbRef);
break;
}
}
// insert a new <ejb-ref> entry and fill in the values
Element insertedEjbRef = ejbDoc.createElement("ejb-ref");
if (nextSibling != null) {
ejb.insertBefore(insertedEjbRef, nextSibling);
}
else {
ejb.insertBefore(insertedEjbRef, findEjbRefInsertPoint(ejb));
}
Element ejbRefName = ejbDoc.createElement("ejb-ref-name");
ejbRefName.setTextContent(insertedEjbRefName);
insertedEjbRef.appendChild(ejbRefName);
Element ejbRefType = ejbDoc.createElement("ejb-ref-type");
ejbRefType.setTextContent(ei.getBeanType());
insertedEjbRef.appendChild(ejbRefType);
Element homeType = ejbDoc.createElement("home");
homeType.setTextContent(ei.getHomeInterface().getName());
insertedEjbRef.appendChild(homeType);
Element remoteType = ejbDoc.createElement("remote");
remoteType.setTextContent(ei.getBeanInterface().getName());
insertedEjbRef.appendChild(remoteType);
Element ejbLink = ejbDoc.createElement("ejb-link");
ejbLink.setTextContent(ejbLinkValue);
insertedEjbRef.appendChild(ejbLink);
}
|
[
"private",
"void",
"insertEJBRefInEJBJar",
"(",
"Element",
"ejb",
",",
"EJBInfo",
"ei",
",",
"String",
"ejbLinkValue",
",",
"Document",
"ejbDoc",
")",
"{",
"List",
"ejbRefArray",
"=",
"DomUtils",
".",
"getChildElementsByName",
"(",
"ejb",
",",
"\"ejb-ref\"",
")",
";",
"String",
"insertedEjbRefName",
"=",
"ei",
".",
"getRefName",
"(",
")",
";",
"Node",
"nextSibling",
"=",
"null",
";",
"for",
"(",
"int",
"j",
"=",
"ejbRefArray",
".",
"size",
"(",
")",
"-",
"1",
";",
"j",
">=",
"0",
";",
"j",
"--",
")",
"{",
"Element",
"ejbRef",
"=",
"(",
"Element",
")",
"ejbRefArray",
".",
"get",
"(",
"j",
")",
";",
"String",
"ejbRefName",
"=",
"DomUtils",
".",
"getChildElementText",
"(",
"ejbRef",
",",
"\"ejb-ref-name\"",
")",
";",
"if",
"(",
"insertedEjbRefName",
".",
"equals",
"(",
"ejbRefName",
")",
")",
"{",
"nextSibling",
"=",
"ejbRef",
".",
"getNextSibling",
"(",
")",
";",
"ejb",
".",
"removeChild",
"(",
"ejbRef",
")",
";",
"break",
";",
"}",
"}",
"// insert a new <ejb-ref> entry and fill in the values",
"Element",
"insertedEjbRef",
"=",
"ejbDoc",
".",
"createElement",
"(",
"\"ejb-ref\"",
")",
";",
"if",
"(",
"nextSibling",
"!=",
"null",
")",
"{",
"ejb",
".",
"insertBefore",
"(",
"insertedEjbRef",
",",
"nextSibling",
")",
";",
"}",
"else",
"{",
"ejb",
".",
"insertBefore",
"(",
"insertedEjbRef",
",",
"findEjbRefInsertPoint",
"(",
"ejb",
")",
")",
";",
"}",
"Element",
"ejbRefName",
"=",
"ejbDoc",
".",
"createElement",
"(",
"\"ejb-ref-name\"",
")",
";",
"ejbRefName",
".",
"setTextContent",
"(",
"insertedEjbRefName",
")",
";",
"insertedEjbRef",
".",
"appendChild",
"(",
"ejbRefName",
")",
";",
"Element",
"ejbRefType",
"=",
"ejbDoc",
".",
"createElement",
"(",
"\"ejb-ref-type\"",
")",
";",
"ejbRefType",
".",
"setTextContent",
"(",
"ei",
".",
"getBeanType",
"(",
")",
")",
";",
"insertedEjbRef",
".",
"appendChild",
"(",
"ejbRefType",
")",
";",
"Element",
"homeType",
"=",
"ejbDoc",
".",
"createElement",
"(",
"\"home\"",
")",
";",
"homeType",
".",
"setTextContent",
"(",
"ei",
".",
"getHomeInterface",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"insertedEjbRef",
".",
"appendChild",
"(",
"homeType",
")",
";",
"Element",
"remoteType",
"=",
"ejbDoc",
".",
"createElement",
"(",
"\"remote\"",
")",
";",
"remoteType",
".",
"setTextContent",
"(",
"ei",
".",
"getBeanInterface",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"insertedEjbRef",
".",
"appendChild",
"(",
"remoteType",
")",
";",
"Element",
"ejbLink",
"=",
"ejbDoc",
".",
"createElement",
"(",
"\"ejb-link\"",
")",
";",
"ejbLink",
".",
"setTextContent",
"(",
"ejbLinkValue",
")",
";",
"insertedEjbRef",
".",
"appendChild",
"(",
"ejbLink",
")",
";",
"}"
] |
Insert a remote ejb-ref into the specified EJB's descriptor, if an ejb-ref already
exists with the same name, remove it before adding a new ref.
@param ejb Root DOM element of the EJB descriptor.
@param ei EJBInfo helper.
@param ejbLinkValue New ejb-link value.
@param ejbDoc The ejb-jar DOM root.
|
[
"Insert",
"a",
"remote",
"ejb",
"-",
"ref",
"into",
"the",
"specified",
"EJB",
"s",
"descriptor",
"if",
"an",
"ejb",
"-",
"ref",
"already",
"exists",
"with",
"the",
"same",
"name",
"remove",
"it",
"before",
"adding",
"a",
"new",
"ref",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java#L111-L155
|
146,697
|
moparisthebest/beehive
|
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java
|
EJBJarDescriptorHandler.findEjbRefInsertPoint
|
private Node findEjbRefInsertPoint(Element parent) {
Element e = DomUtils.getChildElementByName(parent, "ejb-local-ref");
if (e != null)
return e;
return findEjbLocalRefInsertPoint(parent);
}
|
java
|
private Node findEjbRefInsertPoint(Element parent) {
Element e = DomUtils.getChildElementByName(parent, "ejb-local-ref");
if (e != null)
return e;
return findEjbLocalRefInsertPoint(parent);
}
|
[
"private",
"Node",
"findEjbRefInsertPoint",
"(",
"Element",
"parent",
")",
"{",
"Element",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"ejb-local-ref\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"return",
"findEjbLocalRefInsertPoint",
"(",
"parent",
")",
";",
"}"
] |
ejb-refs must be inserted before any ejb-local-ref tags.
@param parent The 'session' or 'entity' XML element.
@return A suitable node to insert the ejb-ref BEFORE.
|
[
"ejb",
"-",
"refs",
"must",
"be",
"inserted",
"before",
"any",
"ejb",
"-",
"local",
"-",
"ref",
"tags",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java#L218-L225
|
146,698
|
moparisthebest/beehive
|
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java
|
EJBJarDescriptorHandler.findEjbLocalRefInsertPoint
|
private Node findEjbLocalRefInsertPoint(Element parent) {
Element e = DomUtils.getChildElementByName(parent, "service-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "resource-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "resource-env-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "message-destination-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "security-role-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "security-identity");
if (e != null)
return e;
// only applies to entity beans
e = DomUtils.getChildElementByName(parent, "query");
if (e != null)
return e;
return null;
}
|
java
|
private Node findEjbLocalRefInsertPoint(Element parent) {
Element e = DomUtils.getChildElementByName(parent, "service-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "resource-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "resource-env-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "message-destination-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "security-role-ref");
if (e != null)
return e;
e = DomUtils.getChildElementByName(parent, "security-identity");
if (e != null)
return e;
// only applies to entity beans
e = DomUtils.getChildElementByName(parent, "query");
if (e != null)
return e;
return null;
}
|
[
"private",
"Node",
"findEjbLocalRefInsertPoint",
"(",
"Element",
"parent",
")",
"{",
"Element",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"service-ref\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"resource-ref\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"resource-env-ref\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"message-destination-ref\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"security-role-ref\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"security-identity\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"// only applies to entity beans",
"e",
"=",
"DomUtils",
".",
"getChildElementByName",
"(",
"parent",
",",
"\"query\"",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"return",
"e",
";",
"return",
"null",
";",
"}"
] |
The local ref must be inserted into the ejb-jar file at the proper
location based on the ejb-jar schema definition. Check for elements which
can immediatly FOLLOW an ejb-ref from the closest to farthest as
defined by the schema.
@param parent The 'session' or 'entity' XML element.
@return A suitable node to insert the ejb-local-ref BEFORE.
|
[
"The",
"local",
"ref",
"must",
"be",
"inserted",
"into",
"the",
"ejb",
"-",
"jar",
"file",
"at",
"the",
"proper",
"location",
"based",
"on",
"the",
"ejb",
"-",
"jar",
"schema",
"definition",
".",
"Check",
"for",
"elements",
"which",
"can",
"immediatly",
"FOLLOW",
"an",
"ejb",
"-",
"ref",
"from",
"the",
"closest",
"to",
"farthest",
"as",
"defined",
"by",
"the",
"schema",
"."
] |
4246a0cc40ce3c05f1a02c2da2653ac622703d77
|
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java#L236-L268
|
146,699
|
iig-uni-freiburg/SEWOL
|
ext/org/deckfour/xes/nikefs2/NikeFS2Block.java
|
NikeFS2Block.read
|
public synchronized int read(int blockOffset, byte[] buffer, int offset, int length)
throws IOException {
return provider.read(blockNumber, blockOffset, buffer, offset, length);
}
|
java
|
public synchronized int read(int blockOffset, byte[] buffer, int offset, int length)
throws IOException {
return provider.read(blockNumber, blockOffset, buffer, offset, length);
}
|
[
"public",
"synchronized",
"int",
"read",
"(",
"int",
"blockOffset",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"return",
"provider",
".",
"read",
"(",
"blockNumber",
",",
"blockOffset",
",",
"buffer",
",",
"offset",
",",
"length",
")",
";",
"}"
] |
Read a number of bytes from this block.
@param blockOffset Offset, in bytes, within this block.
@param buffer Buffer to store read data in.
@param offset Offset within the buffer to write to.
@param length Number of bytes to be read.
@return The number of read bytes.
|
[
"Read",
"a",
"number",
"of",
"bytes",
"from",
"this",
"block",
"."
] |
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
|
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2Block.java#L104-L107
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.