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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
145,800
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.seqTrain
|
private void seqTrain() throws IOException {
// load training parameters file
final String paramFile = this.parsedArguments.getString("params");
final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
String outModel = null;
if (params.getSettings().get("OutputModel") == null
|| params.getSettings().get("OutputModel").length() == 0) {
outModel = Files.getNameWithoutExtension(paramFile) + ".bin";
params.put("OutputModel", outModel);
} else {
outModel = Flags.getModel(params);
}
final SequenceLabelerTrainer nercTrainer = new SequenceLabelerTrainer(
params);
final SequenceLabelerModel trainedModel = nercTrainer.train(params);
CmdLineUtil.writeModel("ixa-pipe-ml", new File(outModel), trainedModel);
}
|
java
|
private void seqTrain() throws IOException {
// load training parameters file
final String paramFile = this.parsedArguments.getString("params");
final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
String outModel = null;
if (params.getSettings().get("OutputModel") == null
|| params.getSettings().get("OutputModel").length() == 0) {
outModel = Files.getNameWithoutExtension(paramFile) + ".bin";
params.put("OutputModel", outModel);
} else {
outModel = Flags.getModel(params);
}
final SequenceLabelerTrainer nercTrainer = new SequenceLabelerTrainer(
params);
final SequenceLabelerModel trainedModel = nercTrainer.train(params);
CmdLineUtil.writeModel("ixa-pipe-ml", new File(outModel), trainedModel);
}
|
[
"private",
"void",
"seqTrain",
"(",
")",
"throws",
"IOException",
"{",
"// load training parameters file",
"final",
"String",
"paramFile",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"params\"",
")",
";",
"final",
"TrainingParameters",
"params",
"=",
"IOUtils",
".",
"loadTrainingParameters",
"(",
"paramFile",
")",
";",
"String",
"outModel",
"=",
"null",
";",
"if",
"(",
"params",
".",
"getSettings",
"(",
")",
".",
"get",
"(",
"\"OutputModel\"",
")",
"==",
"null",
"||",
"params",
".",
"getSettings",
"(",
")",
".",
"get",
"(",
"\"OutputModel\"",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"outModel",
"=",
"Files",
".",
"getNameWithoutExtension",
"(",
"paramFile",
")",
"+",
"\".bin\"",
";",
"params",
".",
"put",
"(",
"\"OutputModel\"",
",",
"outModel",
")",
";",
"}",
"else",
"{",
"outModel",
"=",
"Flags",
".",
"getModel",
"(",
"params",
")",
";",
"}",
"final",
"SequenceLabelerTrainer",
"nercTrainer",
"=",
"new",
"SequenceLabelerTrainer",
"(",
"params",
")",
";",
"final",
"SequenceLabelerModel",
"trainedModel",
"=",
"nercTrainer",
".",
"train",
"(",
"params",
")",
";",
"CmdLineUtil",
".",
"writeModel",
"(",
"\"ixa-pipe-ml\"",
",",
"new",
"File",
"(",
"outModel",
")",
",",
"trainedModel",
")",
";",
"}"
] |
Main access to the Sequence Labeler train functionalities.
@throws IOException
input output exception if problems with corpora
|
[
"Main",
"access",
"to",
"the",
"Sequence",
"Labeler",
"train",
"functionalities",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L229-L246
|
145,801
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.parserTrain
|
private void parserTrain() throws IOException {
// load training parameters file
final String paramFile = this.parsedArguments.getString("params");
final String taggerParamsFile = this.parsedArguments
.getString("taggerParams");
final String chunkerParamsFile = this.parsedArguments
.getString("chunkerParams");
final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
final TrainingParameters chunkerParams = IOUtils
.loadTrainingParameters(chunkerParamsFile);
ParserModel trainedModel;
String outModel;
if (params.getSettings().get("OutputModel") == null
|| params.getSettings().get("OutputModel").length() == 0) {
outModel = Files.getNameWithoutExtension(paramFile) + ".bin";
params.put("OutputModel", outModel);
} else {
outModel = Flags.getModel(params);
}
if (taggerParamsFile.endsWith(".bin")) {
final InputStream posModel = new FileInputStream(taggerParamsFile);
final ShiftReduceParserTrainer parserTrainer = new ShiftReduceParserTrainer(
params, chunkerParams);
trainedModel = parserTrainer.train(params, posModel, chunkerParams);
} else {
final TrainingParameters taggerParams = IOUtils
.loadTrainingParameters(taggerParamsFile);
final ShiftReduceParserTrainer parserTrainer = new ShiftReduceParserTrainer(
params, taggerParams, chunkerParams);
trainedModel = parserTrainer.train(params, taggerParams, chunkerParams);
}
CmdLineUtil.writeModel("ixa-pipe-ml", new File(outModel), trainedModel);
}
|
java
|
private void parserTrain() throws IOException {
// load training parameters file
final String paramFile = this.parsedArguments.getString("params");
final String taggerParamsFile = this.parsedArguments
.getString("taggerParams");
final String chunkerParamsFile = this.parsedArguments
.getString("chunkerParams");
final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
final TrainingParameters chunkerParams = IOUtils
.loadTrainingParameters(chunkerParamsFile);
ParserModel trainedModel;
String outModel;
if (params.getSettings().get("OutputModel") == null
|| params.getSettings().get("OutputModel").length() == 0) {
outModel = Files.getNameWithoutExtension(paramFile) + ".bin";
params.put("OutputModel", outModel);
} else {
outModel = Flags.getModel(params);
}
if (taggerParamsFile.endsWith(".bin")) {
final InputStream posModel = new FileInputStream(taggerParamsFile);
final ShiftReduceParserTrainer parserTrainer = new ShiftReduceParserTrainer(
params, chunkerParams);
trainedModel = parserTrainer.train(params, posModel, chunkerParams);
} else {
final TrainingParameters taggerParams = IOUtils
.loadTrainingParameters(taggerParamsFile);
final ShiftReduceParserTrainer parserTrainer = new ShiftReduceParserTrainer(
params, taggerParams, chunkerParams);
trainedModel = parserTrainer.train(params, taggerParams, chunkerParams);
}
CmdLineUtil.writeModel("ixa-pipe-ml", new File(outModel), trainedModel);
}
|
[
"private",
"void",
"parserTrain",
"(",
")",
"throws",
"IOException",
"{",
"// load training parameters file",
"final",
"String",
"paramFile",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"params\"",
")",
";",
"final",
"String",
"taggerParamsFile",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"taggerParams\"",
")",
";",
"final",
"String",
"chunkerParamsFile",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"chunkerParams\"",
")",
";",
"final",
"TrainingParameters",
"params",
"=",
"IOUtils",
".",
"loadTrainingParameters",
"(",
"paramFile",
")",
";",
"final",
"TrainingParameters",
"chunkerParams",
"=",
"IOUtils",
".",
"loadTrainingParameters",
"(",
"chunkerParamsFile",
")",
";",
"ParserModel",
"trainedModel",
";",
"String",
"outModel",
";",
"if",
"(",
"params",
".",
"getSettings",
"(",
")",
".",
"get",
"(",
"\"OutputModel\"",
")",
"==",
"null",
"||",
"params",
".",
"getSettings",
"(",
")",
".",
"get",
"(",
"\"OutputModel\"",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"outModel",
"=",
"Files",
".",
"getNameWithoutExtension",
"(",
"paramFile",
")",
"+",
"\".bin\"",
";",
"params",
".",
"put",
"(",
"\"OutputModel\"",
",",
"outModel",
")",
";",
"}",
"else",
"{",
"outModel",
"=",
"Flags",
".",
"getModel",
"(",
"params",
")",
";",
"}",
"if",
"(",
"taggerParamsFile",
".",
"endsWith",
"(",
"\".bin\"",
")",
")",
"{",
"final",
"InputStream",
"posModel",
"=",
"new",
"FileInputStream",
"(",
"taggerParamsFile",
")",
";",
"final",
"ShiftReduceParserTrainer",
"parserTrainer",
"=",
"new",
"ShiftReduceParserTrainer",
"(",
"params",
",",
"chunkerParams",
")",
";",
"trainedModel",
"=",
"parserTrainer",
".",
"train",
"(",
"params",
",",
"posModel",
",",
"chunkerParams",
")",
";",
"}",
"else",
"{",
"final",
"TrainingParameters",
"taggerParams",
"=",
"IOUtils",
".",
"loadTrainingParameters",
"(",
"taggerParamsFile",
")",
";",
"final",
"ShiftReduceParserTrainer",
"parserTrainer",
"=",
"new",
"ShiftReduceParserTrainer",
"(",
"params",
",",
"taggerParams",
",",
"chunkerParams",
")",
";",
"trainedModel",
"=",
"parserTrainer",
".",
"train",
"(",
"params",
",",
"taggerParams",
",",
"chunkerParams",
")",
";",
"}",
"CmdLineUtil",
".",
"writeModel",
"(",
"\"ixa-pipe-ml\"",
",",
"new",
"File",
"(",
"outModel",
")",
",",
"trainedModel",
")",
";",
"}"
] |
Main access to the ShiftReduceParser train functionalities.
@throws IOException
input output exception if problems with corpora
|
[
"Main",
"access",
"to",
"the",
"ShiftReduceParser",
"train",
"functionalities",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L254-L287
|
145,802
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.seqeval
|
private void seqeval() throws IOException {
final String metric = this.parsedArguments.getString("metric");
final String lang = this.parsedArguments.getString("language");
final String model = this.parsedArguments.getString("model");
final String testset = this.parsedArguments.getString("testset");
final String corpusFormat = this.parsedArguments.getString("corpusFormat");
final String netypes = this.parsedArguments.getString("types");
final String clearFeatures = this.parsedArguments
.getString("clearFeatures");
final String unknownAccuracy = this.parsedArguments
.getString("unknownAccuracy");
final Properties props = setEvalProperties(lang, model, testset,
corpusFormat, netypes, clearFeatures, unknownAccuracy);
final SequenceLabelerEvaluate evaluator = new SequenceLabelerEvaluate(
props);
if (metric.equalsIgnoreCase("accuracy")) {
evaluator.evaluateAccuracy();
} else {
if (this.parsedArguments.getString("evalReport") != null) {
if (this.parsedArguments.getString("evalReport")
.equalsIgnoreCase("brief")) {
evaluator.evaluate();
} else if (this.parsedArguments.getString("evalReport")
.equalsIgnoreCase("error")) {
evaluator.evalError();
} else if (this.parsedArguments.getString("evalReport")
.equalsIgnoreCase("detailed")) {
evaluator.detailEvaluate();
}
} else {
evaluator.detailEvaluate();
}
}
}
|
java
|
private void seqeval() throws IOException {
final String metric = this.parsedArguments.getString("metric");
final String lang = this.parsedArguments.getString("language");
final String model = this.parsedArguments.getString("model");
final String testset = this.parsedArguments.getString("testset");
final String corpusFormat = this.parsedArguments.getString("corpusFormat");
final String netypes = this.parsedArguments.getString("types");
final String clearFeatures = this.parsedArguments
.getString("clearFeatures");
final String unknownAccuracy = this.parsedArguments
.getString("unknownAccuracy");
final Properties props = setEvalProperties(lang, model, testset,
corpusFormat, netypes, clearFeatures, unknownAccuracy);
final SequenceLabelerEvaluate evaluator = new SequenceLabelerEvaluate(
props);
if (metric.equalsIgnoreCase("accuracy")) {
evaluator.evaluateAccuracy();
} else {
if (this.parsedArguments.getString("evalReport") != null) {
if (this.parsedArguments.getString("evalReport")
.equalsIgnoreCase("brief")) {
evaluator.evaluate();
} else if (this.parsedArguments.getString("evalReport")
.equalsIgnoreCase("error")) {
evaluator.evalError();
} else if (this.parsedArguments.getString("evalReport")
.equalsIgnoreCase("detailed")) {
evaluator.detailEvaluate();
}
} else {
evaluator.detailEvaluate();
}
}
}
|
[
"private",
"void",
"seqeval",
"(",
")",
"throws",
"IOException",
"{",
"final",
"String",
"metric",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"metric\"",
")",
";",
"final",
"String",
"lang",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"language\"",
")",
";",
"final",
"String",
"model",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"model\"",
")",
";",
"final",
"String",
"testset",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"testset\"",
")",
";",
"final",
"String",
"corpusFormat",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"corpusFormat\"",
")",
";",
"final",
"String",
"netypes",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"types\"",
")",
";",
"final",
"String",
"clearFeatures",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"clearFeatures\"",
")",
";",
"final",
"String",
"unknownAccuracy",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"unknownAccuracy\"",
")",
";",
"final",
"Properties",
"props",
"=",
"setEvalProperties",
"(",
"lang",
",",
"model",
",",
"testset",
",",
"corpusFormat",
",",
"netypes",
",",
"clearFeatures",
",",
"unknownAccuracy",
")",
";",
"final",
"SequenceLabelerEvaluate",
"evaluator",
"=",
"new",
"SequenceLabelerEvaluate",
"(",
"props",
")",
";",
"if",
"(",
"metric",
".",
"equalsIgnoreCase",
"(",
"\"accuracy\"",
")",
")",
"{",
"evaluator",
".",
"evaluateAccuracy",
"(",
")",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"evalReport\"",
")",
"!=",
"null",
")",
"{",
"if",
"(",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"evalReport\"",
")",
".",
"equalsIgnoreCase",
"(",
"\"brief\"",
")",
")",
"{",
"evaluator",
".",
"evaluate",
"(",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"evalReport\"",
")",
".",
"equalsIgnoreCase",
"(",
"\"error\"",
")",
")",
"{",
"evaluator",
".",
"evalError",
"(",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"evalReport\"",
")",
".",
"equalsIgnoreCase",
"(",
"\"detailed\"",
")",
")",
"{",
"evaluator",
".",
"detailEvaluate",
"(",
")",
";",
"}",
"}",
"else",
"{",
"evaluator",
".",
"detailEvaluate",
"(",
")",
";",
"}",
"}",
"}"
] |
Main evaluation entry point for sequence labeling.
@throws IOException
throws exception if test set not available
|
[
"Main",
"evaluation",
"entry",
"point",
"for",
"sequence",
"labeling",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L318-L353
|
145,803
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.parseval
|
private void parseval() throws IOException {
final String lang = this.parsedArguments.getString("language");
final String model = this.parsedArguments.getString("model");
final String testset = this.parsedArguments.getString("testset");
final Properties props = setParsevalProperties(lang, model, testset);
final ParserEvaluate parserEvaluator = new ParserEvaluate(props);
parserEvaluator.evaluate();
}
|
java
|
private void parseval() throws IOException {
final String lang = this.parsedArguments.getString("language");
final String model = this.parsedArguments.getString("model");
final String testset = this.parsedArguments.getString("testset");
final Properties props = setParsevalProperties(lang, model, testset);
final ParserEvaluate parserEvaluator = new ParserEvaluate(props);
parserEvaluator.evaluate();
}
|
[
"private",
"void",
"parseval",
"(",
")",
"throws",
"IOException",
"{",
"final",
"String",
"lang",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"language\"",
")",
";",
"final",
"String",
"model",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"model\"",
")",
";",
"final",
"String",
"testset",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"testset\"",
")",
";",
"final",
"Properties",
"props",
"=",
"setParsevalProperties",
"(",
"lang",
",",
"model",
",",
"testset",
")",
";",
"final",
"ParserEvaluate",
"parserEvaluator",
"=",
"new",
"ParserEvaluate",
"(",
"props",
")",
";",
"parserEvaluator",
".",
"evaluate",
"(",
")",
";",
"}"
] |
Main parsing evaluation entry point.
@throws IOException
throws exception if test set not available
|
[
"Main",
"parsing",
"evaluation",
"entry",
"point",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L361-L370
|
145,804
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.tokeval
|
private final void tokeval() throws IOException {
final String lang = this.parsedArguments.getString("language");
final String testset = this.parsedArguments.getString("testset");
final Properties props = setTokevalProperties(lang, testset);
final TokenizerEvaluate evaluator = new TokenizerEvaluate(props);
// evaluator.evaluateAccuracy();
}
|
java
|
private final void tokeval() throws IOException {
final String lang = this.parsedArguments.getString("language");
final String testset = this.parsedArguments.getString("testset");
final Properties props = setTokevalProperties(lang, testset);
final TokenizerEvaluate evaluator = new TokenizerEvaluate(props);
// evaluator.evaluateAccuracy();
}
|
[
"private",
"final",
"void",
"tokeval",
"(",
")",
"throws",
"IOException",
"{",
"final",
"String",
"lang",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"language\"",
")",
";",
"final",
"String",
"testset",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"testset\"",
")",
";",
"final",
"Properties",
"props",
"=",
"setTokevalProperties",
"(",
"lang",
",",
"testset",
")",
";",
"final",
"TokenizerEvaluate",
"evaluator",
"=",
"new",
"TokenizerEvaluate",
"(",
"props",
")",
";",
"// evaluator.evaluateAccuracy();",
"}"
] |
Main evaluation entry point for the tokenizer.
@throws IOException
throws exception if test set not available
|
[
"Main",
"evaluation",
"entry",
"point",
"for",
"the",
"tokenizer",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L400-L407
|
145,805
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.sequenceCrossValidate
|
private void sequenceCrossValidate() throws IOException {
final String paramFile = this.parsedArguments.getString("params");
final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
final SequenceCrossValidator crossValidator = new SequenceCrossValidator(params);
crossValidator.crossValidate(params);
}
|
java
|
private void sequenceCrossValidate() throws IOException {
final String paramFile = this.parsedArguments.getString("params");
final TrainingParameters params = IOUtils.loadTrainingParameters(paramFile);
final SequenceCrossValidator crossValidator = new SequenceCrossValidator(params);
crossValidator.crossValidate(params);
}
|
[
"private",
"void",
"sequenceCrossValidate",
"(",
")",
"throws",
"IOException",
"{",
"final",
"String",
"paramFile",
"=",
"this",
".",
"parsedArguments",
".",
"getString",
"(",
"\"params\"",
")",
";",
"final",
"TrainingParameters",
"params",
"=",
"IOUtils",
".",
"loadTrainingParameters",
"(",
"paramFile",
")",
";",
"final",
"SequenceCrossValidator",
"crossValidator",
"=",
"new",
"SequenceCrossValidator",
"(",
"params",
")",
";",
"crossValidator",
".",
"crossValidate",
"(",
"params",
")",
";",
"}"
] |
Main access to the sequence labeler cross validation.
@throws IOException
input output exception if problems with corpora
|
[
"Main",
"access",
"to",
"the",
"sequence",
"labeler",
"cross",
"validation",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L415-L421
|
145,806
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/CLI.java
|
CLI.loadParserTrainingParameters
|
private void loadParserTrainingParameters() {
this.parserTrainerParser.addArgument("-p", "--params").required(true)
.help("Load the parsing training parameters file.\n");
this.parserTrainerParser.addArgument("-t", "--taggerParams").required(true)
.help(
"Load the tagger training parameters file or an already trained POS tagger model.\n");
this.parserTrainerParser.addArgument("-c", "--chunkerParams").required(true)
.help("Load the chunker training parameters file.\n");
}
|
java
|
private void loadParserTrainingParameters() {
this.parserTrainerParser.addArgument("-p", "--params").required(true)
.help("Load the parsing training parameters file.\n");
this.parserTrainerParser.addArgument("-t", "--taggerParams").required(true)
.help(
"Load the tagger training parameters file or an already trained POS tagger model.\n");
this.parserTrainerParser.addArgument("-c", "--chunkerParams").required(true)
.help("Load the chunker training parameters file.\n");
}
|
[
"private",
"void",
"loadParserTrainingParameters",
"(",
")",
"{",
"this",
".",
"parserTrainerParser",
".",
"addArgument",
"(",
"\"-p\"",
",",
"\"--params\"",
")",
".",
"required",
"(",
"true",
")",
".",
"help",
"(",
"\"Load the parsing training parameters file.\\n\"",
")",
";",
"this",
".",
"parserTrainerParser",
".",
"addArgument",
"(",
"\"-t\"",
",",
"\"--taggerParams\"",
")",
".",
"required",
"(",
"true",
")",
".",
"help",
"(",
"\"Load the tagger training parameters file or an already trained POS tagger model.\\n\"",
")",
";",
"this",
".",
"parserTrainerParser",
".",
"addArgument",
"(",
"\"-c\"",
",",
"\"--chunkerParams\"",
")",
".",
"required",
"(",
"true",
")",
".",
"help",
"(",
"\"Load the chunker training parameters file.\\n\"",
")",
";",
"}"
] |
Create the main parameters available for training ShiftReduceParse models.
|
[
"Create",
"the",
"main",
"parameters",
"available",
"for",
"training",
"ShiftReduceParse",
"models",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/CLI.java#L441-L449
|
145,807
|
OpenBEL/openbel-framework
|
org.openbel.framework.common/src/main/java/org/openbel/framework/common/external/ReadCache.java
|
ReadCache.cache
|
public void cache(Integer key, Object value) {
synchronized (this) {
Integer curkey = keys.get(value);
// Already cached?
if (curkey != null) return;
cache.put(key, value);
keys.put(value, key);
}
}
|
java
|
public void cache(Integer key, Object value) {
synchronized (this) {
Integer curkey = keys.get(value);
// Already cached?
if (curkey != null) return;
cache.put(key, value);
keys.put(value, key);
}
}
|
[
"public",
"void",
"cache",
"(",
"Integer",
"key",
",",
"Object",
"value",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Integer",
"curkey",
"=",
"keys",
".",
"get",
"(",
"value",
")",
";",
"// Already cached?",
"if",
"(",
"curkey",
"!=",
"null",
")",
"return",
";",
"cache",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"keys",
".",
"put",
"(",
"value",
",",
"key",
")",
";",
"}",
"}"
] |
Caches an object by the provided key.
@param key {@link Integer} key
@param value {@link Object} to cache
|
[
"Caches",
"an",
"object",
"by",
"the",
"provided",
"key",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/external/ReadCache.java#L102-L110
|
145,808
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/features/TokenClassFeatureGenerator.java
|
TokenClassFeatureGenerator.processRangeOptions
|
private void processRangeOptions(final Map<String, String> properties) {
final String featuresRange = properties.get("range");
final String[] rangeArray = Flags
.processTokenClassFeaturesRange(featuresRange);
if (rangeArray[0].equalsIgnoreCase("lower")) {
this.isLower = true;
}
if (rangeArray[1].equalsIgnoreCase("wac")) {
this.isWordAndClassFeature = true;
}
}
|
java
|
private void processRangeOptions(final Map<String, String> properties) {
final String featuresRange = properties.get("range");
final String[] rangeArray = Flags
.processTokenClassFeaturesRange(featuresRange);
if (rangeArray[0].equalsIgnoreCase("lower")) {
this.isLower = true;
}
if (rangeArray[1].equalsIgnoreCase("wac")) {
this.isWordAndClassFeature = true;
}
}
|
[
"private",
"void",
"processRangeOptions",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"final",
"String",
"featuresRange",
"=",
"properties",
".",
"get",
"(",
"\"range\"",
")",
";",
"final",
"String",
"[",
"]",
"rangeArray",
"=",
"Flags",
".",
"processTokenClassFeaturesRange",
"(",
"featuresRange",
")",
";",
"if",
"(",
"rangeArray",
"[",
"0",
"]",
".",
"equalsIgnoreCase",
"(",
"\"lower\"",
")",
")",
"{",
"this",
".",
"isLower",
"=",
"true",
";",
"}",
"if",
"(",
"rangeArray",
"[",
"1",
"]",
".",
"equalsIgnoreCase",
"(",
"\"wac\"",
")",
")",
"{",
"this",
".",
"isWordAndClassFeature",
"=",
"true",
";",
"}",
"}"
] |
Process the options of which type of features are to be generated.
@param properties
the properties map
|
[
"Process",
"the",
"options",
"of",
"which",
"type",
"of",
"features",
"are",
"to",
"be",
"generated",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/features/TokenClassFeatureGenerator.java#L139-L149
|
145,809
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/request/RequestInvoker.java
|
RequestInvoker.call
|
@Override
public T call()
throws Exception
{
T response = requestor.call();
try {
validateResponse( response );
return response;
} catch ( RuntimeException ex ) {
if ( response instanceof Closeable ) {
PcsUtils.closeQuietly( ( Closeable ) response );
}
throw ex;
}
}
|
java
|
@Override
public T call()
throws Exception
{
T response = requestor.call();
try {
validateResponse( response );
return response;
} catch ( RuntimeException ex ) {
if ( response instanceof Closeable ) {
PcsUtils.closeQuietly( ( Closeable ) response );
}
throw ex;
}
}
|
[
"@",
"Override",
"public",
"T",
"call",
"(",
")",
"throws",
"Exception",
"{",
"T",
"response",
"=",
"requestor",
".",
"call",
"(",
")",
";",
"try",
"{",
"validateResponse",
"(",
"response",
")",
";",
"return",
"response",
";",
"}",
"catch",
"(",
"RuntimeException",
"ex",
")",
"{",
"if",
"(",
"response",
"instanceof",
"Closeable",
")",
"{",
"PcsUtils",
".",
"closeQuietly",
"(",
"(",
"Closeable",
")",
"response",
")",
";",
"}",
"throw",
"ex",
";",
"}",
"}"
] |
Performs and validates http request.
Two steps:<ol>
<li>requests server with doRequest()</li>
<li>validates response with validateResponse()</li>
</ol>
@return The request result
@throws Exception Request invocation error
|
[
"Performs",
"and",
"validates",
"http",
"request",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/RequestInvoker.java#L52-L68
|
145,810
|
ihaolin/session
|
session-api/src/main/java/me/hao0/session/util/WebUtil.java
|
WebUtil.getClientIpAddr
|
public static String getClientIpAddr(HttpServletRequest request) {
for (String header : HEADERS_ABOUT_CLIENT_IP) {
String ip = request.getHeader(header);
if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) {
return ip;
}
}
return request.getRemoteAddr();
}
|
java
|
public static String getClientIpAddr(HttpServletRequest request) {
for (String header : HEADERS_ABOUT_CLIENT_IP) {
String ip = request.getHeader(header);
if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) {
return ip;
}
}
return request.getRemoteAddr();
}
|
[
"public",
"static",
"String",
"getClientIpAddr",
"(",
"HttpServletRequest",
"request",
")",
"{",
"for",
"(",
"String",
"header",
":",
"HEADERS_ABOUT_CLIENT_IP",
")",
"{",
"String",
"ip",
"=",
"request",
".",
"getHeader",
"(",
"header",
")",
";",
"if",
"(",
"ip",
"!=",
"null",
"&&",
"ip",
".",
"length",
"(",
")",
"!=",
"0",
"&&",
"!",
"\"unknown\"",
".",
"equalsIgnoreCase",
"(",
"ip",
")",
")",
"{",
"return",
"ip",
";",
"}",
"}",
"return",
"request",
".",
"getRemoteAddr",
"(",
")",
";",
"}"
] |
get client ip
@param request current request
@return client ip
|
[
"get",
"client",
"ip"
] |
322c3a9f47b305a39345135fa8163dd7e065b4f8
|
https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L45-L53
|
145,811
|
ihaolin/session
|
session-api/src/main/java/me/hao0/session/util/WebUtil.java
|
WebUtil.findCookie
|
public static Cookie findCookie(HttpServletRequest request, String name) {
if (request != null) {
Cookie[] cookies = request.getCookies();
if (cookies != null && cookies.length > 0) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals(name)) {
return cookie;
}
}
}
}
return null;
}
|
java
|
public static Cookie findCookie(HttpServletRequest request, String name) {
if (request != null) {
Cookie[] cookies = request.getCookies();
if (cookies != null && cookies.length > 0) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals(name)) {
return cookie;
}
}
}
}
return null;
}
|
[
"public",
"static",
"Cookie",
"findCookie",
"(",
"HttpServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"if",
"(",
"request",
"!=",
"null",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"request",
".",
"getCookies",
"(",
")",
";",
"if",
"(",
"cookies",
"!=",
"null",
"&&",
"cookies",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"Cookie",
"cookie",
":",
"cookies",
")",
"{",
"if",
"(",
"cookie",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
"{",
"return",
"cookie",
";",
"}",
"}",
"}",
"}",
"return",
"null",
";",
"}"
] |
find cookie from request
@param request current request
@param name cookie name
@return cookie value or null
|
[
"find",
"cookie",
"from",
"request"
] |
322c3a9f47b305a39345135fa8163dd7e065b4f8
|
https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L61-L73
|
145,812
|
ihaolin/session
|
session-api/src/main/java/me/hao0/session/util/WebUtil.java
|
WebUtil.findCookieValue
|
public static String findCookieValue(HttpServletRequest request, String name) {
Cookie cookie = findCookie(request, name);
return cookie != null ? cookie.getValue() : null;
}
|
java
|
public static String findCookieValue(HttpServletRequest request, String name) {
Cookie cookie = findCookie(request, name);
return cookie != null ? cookie.getValue() : null;
}
|
[
"public",
"static",
"String",
"findCookieValue",
"(",
"HttpServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"Cookie",
"cookie",
"=",
"findCookie",
"(",
"request",
",",
"name",
")",
";",
"return",
"cookie",
"!=",
"null",
"?",
"cookie",
".",
"getValue",
"(",
")",
":",
"null",
";",
"}"
] |
find cookie value
@param request current request
@param name cookie name
@return cookie value
|
[
"find",
"cookie",
"value"
] |
322c3a9f47b305a39345135fa8163dd7e065b4f8
|
https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L81-L84
|
145,813
|
ihaolin/session
|
session-api/src/main/java/me/hao0/session/util/WebUtil.java
|
WebUtil.getFullRequestUrl
|
public static String getFullRequestUrl(HttpServletRequest request) {
StringBuilder buff = new StringBuilder(
request.getRequestURL().toString());
String queryString = request.getQueryString();
if (queryString != null) {
buff.append("?").append(queryString);
}
return buff.toString();
}
|
java
|
public static String getFullRequestUrl(HttpServletRequest request) {
StringBuilder buff = new StringBuilder(
request.getRequestURL().toString());
String queryString = request.getQueryString();
if (queryString != null) {
buff.append("?").append(queryString);
}
return buff.toString();
}
|
[
"public",
"static",
"String",
"getFullRequestUrl",
"(",
"HttpServletRequest",
"request",
")",
"{",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
"request",
".",
"getRequestURL",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"String",
"queryString",
"=",
"request",
".",
"getQueryString",
"(",
")",
";",
"if",
"(",
"queryString",
"!=",
"null",
")",
"{",
"buff",
".",
"append",
"(",
"\"?\"",
")",
".",
"append",
"(",
"queryString",
")",
";",
"}",
"return",
"buff",
".",
"toString",
"(",
")",
";",
"}"
] |
get request full url, include params
@param request current request
@return request full url, include params
|
[
"get",
"request",
"full",
"url",
"include",
"params"
] |
322c3a9f47b305a39345135fa8163dd7e065b4f8
|
https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L181-L190
|
145,814
|
ihaolin/session
|
session-api/src/main/java/me/hao0/session/util/WebUtil.java
|
WebUtil.redirect
|
public static void redirect(HttpServletResponse response, String url,
boolean movePermanently) throws IOException {
if (!movePermanently) {
response.sendRedirect(url);
} else {
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", url);
}
}
|
java
|
public static void redirect(HttpServletResponse response, String url,
boolean movePermanently) throws IOException {
if (!movePermanently) {
response.sendRedirect(url);
} else {
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", url);
}
}
|
[
"public",
"static",
"void",
"redirect",
"(",
"HttpServletResponse",
"response",
",",
"String",
"url",
",",
"boolean",
"movePermanently",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"movePermanently",
")",
"{",
"response",
".",
"sendRedirect",
"(",
"url",
")",
";",
"}",
"else",
"{",
"response",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_MOVED_PERMANENTLY",
")",
";",
"response",
".",
"setHeader",
"(",
"\"Location\"",
",",
"url",
")",
";",
"}",
"}"
] |
redirect to url
@param response HttpServletResponse object
@param url recirect url
@param movePermanently true 301 for permanent redirect, false 302(temporary redirect)
@throws java.io.IOException
|
[
"redirect",
"to",
"url"
] |
322c3a9f47b305a39345135fa8163dd7e065b4f8
|
https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L200-L208
|
145,815
|
geomajas/geomajas-project-client-gwt2
|
plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java
|
WmsClient.createLayer
|
public WmsLayer createLayer(String title, String crs, TileConfiguration tileConfig,
WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo) {
if (layerInfo == null || layerInfo.isQueryable()) {
return new FeatureInfoSupportedWmsLayer(title, crs, layerConfig, tileConfig, layerInfo);
} else {
return new WmsLayerImpl(title, crs, layerConfig, tileConfig, layerInfo);
}
}
|
java
|
public WmsLayer createLayer(String title, String crs, TileConfiguration tileConfig,
WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo) {
if (layerInfo == null || layerInfo.isQueryable()) {
return new FeatureInfoSupportedWmsLayer(title, crs, layerConfig, tileConfig, layerInfo);
} else {
return new WmsLayerImpl(title, crs, layerConfig, tileConfig, layerInfo);
}
}
|
[
"public",
"WmsLayer",
"createLayer",
"(",
"String",
"title",
",",
"String",
"crs",
",",
"TileConfiguration",
"tileConfig",
",",
"WmsLayerConfiguration",
"layerConfig",
",",
"WmsLayerInfo",
"layerInfo",
")",
"{",
"if",
"(",
"layerInfo",
"==",
"null",
"||",
"layerInfo",
".",
"isQueryable",
"(",
")",
")",
"{",
"return",
"new",
"FeatureInfoSupportedWmsLayer",
"(",
"title",
",",
"crs",
",",
"layerConfig",
",",
"tileConfig",
",",
"layerInfo",
")",
";",
"}",
"else",
"{",
"return",
"new",
"WmsLayerImpl",
"(",
"title",
",",
"crs",
",",
"layerConfig",
",",
"tileConfig",
",",
"layerInfo",
")",
";",
"}",
"}"
] |
Create a new WMS layer. This layer does not support a GetFeatureInfo call! If you need that, you'll have to use
the server extension of this plug-in.
@param title The layer title.
@param crs The CRS for this layer.
@param tileConfig The tile configuration object.
@param layerConfig The layer configuration object.
@param layerInfo The layer info object. Acquired from a WMS GetCapabilities. This object is optional.
@return A new WMS layer.
|
[
"Create",
"a",
"new",
"WMS",
"layer",
".",
"This",
"layer",
"does",
"not",
"support",
"a",
"GetFeatureInfo",
"call!",
"If",
"you",
"need",
"that",
"you",
"ll",
"have",
"to",
"use",
"the",
"server",
"extension",
"of",
"this",
"plug",
"-",
"in",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java#L94-L101
|
145,816
|
geomajas/geomajas-project-client-gwt2
|
plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java
|
WmsClient.createTileConfig
|
public TileConfiguration createTileConfig(WmsLayerInfo layerInfo, ViewPort viewPort, int tileWidth, int tileHeight)
throws IllegalArgumentException {
Bbox bbox = layerInfo.getBoundingBox(viewPort.getCrs());
if (bbox == null) {
throw new IllegalArgumentException("Layer does not support map CRS (" + viewPort.getCrs() + ").");
}
Coordinate origin = new Coordinate(bbox.getX(), bbox.getY());
return new TileConfiguration(tileWidth, tileHeight, origin, viewPort);
}
|
java
|
public TileConfiguration createTileConfig(WmsLayerInfo layerInfo, ViewPort viewPort, int tileWidth, int tileHeight)
throws IllegalArgumentException {
Bbox bbox = layerInfo.getBoundingBox(viewPort.getCrs());
if (bbox == null) {
throw new IllegalArgumentException("Layer does not support map CRS (" + viewPort.getCrs() + ").");
}
Coordinate origin = new Coordinate(bbox.getX(), bbox.getY());
return new TileConfiguration(tileWidth, tileHeight, origin, viewPort);
}
|
[
"public",
"TileConfiguration",
"createTileConfig",
"(",
"WmsLayerInfo",
"layerInfo",
",",
"ViewPort",
"viewPort",
",",
"int",
"tileWidth",
",",
"int",
"tileHeight",
")",
"throws",
"IllegalArgumentException",
"{",
"Bbox",
"bbox",
"=",
"layerInfo",
".",
"getBoundingBox",
"(",
"viewPort",
".",
"getCrs",
"(",
")",
")",
";",
"if",
"(",
"bbox",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Layer does not support map CRS (\"",
"+",
"viewPort",
".",
"getCrs",
"(",
")",
"+",
"\").\"",
")",
";",
"}",
"Coordinate",
"origin",
"=",
"new",
"Coordinate",
"(",
"bbox",
".",
"getX",
"(",
")",
",",
"bbox",
".",
"getY",
"(",
")",
")",
";",
"return",
"new",
"TileConfiguration",
"(",
"tileWidth",
",",
"tileHeight",
",",
"origin",
",",
"viewPort",
")",
";",
"}"
] |
Create a new tile configuration object from a WmsLayerInfo object.
@param layerInfo The layer info object. Acquired from a WMS GetCapabilities.
@param viewPort The ViewPort to get the CRS and fixed resolutions from.
@param tileWidth The tile width in pixels.
@param tileHeight The tile height in pixels.
@return Returns a tile configuration object.
@throws IllegalArgumentException Throw when the CRS is not supported for this layerInfo object.
|
[
"Create",
"a",
"new",
"tile",
"configuration",
"object",
"from",
"a",
"WmsLayerInfo",
"object",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java#L113-L121
|
145,817
|
geomajas/geomajas-project-client-gwt2
|
plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java
|
WmsClient.createLayerConfig
|
public WmsLayerConfiguration createLayerConfig(WmsLayerInfo layerInfo,
String baseUrl, WmsService.WmsVersion version) {
WmsLayerConfiguration layerConfig = new WmsLayerConfiguration();
layerConfig.setBaseUrl(baseUrl);
layerConfig.setLayers(layerInfo.getName());
layerConfig.setVersion(version);
return layerConfig;
}
|
java
|
public WmsLayerConfiguration createLayerConfig(WmsLayerInfo layerInfo,
String baseUrl, WmsService.WmsVersion version) {
WmsLayerConfiguration layerConfig = new WmsLayerConfiguration();
layerConfig.setBaseUrl(baseUrl);
layerConfig.setLayers(layerInfo.getName());
layerConfig.setVersion(version);
return layerConfig;
}
|
[
"public",
"WmsLayerConfiguration",
"createLayerConfig",
"(",
"WmsLayerInfo",
"layerInfo",
",",
"String",
"baseUrl",
",",
"WmsService",
".",
"WmsVersion",
"version",
")",
"{",
"WmsLayerConfiguration",
"layerConfig",
"=",
"new",
"WmsLayerConfiguration",
"(",
")",
";",
"layerConfig",
".",
"setBaseUrl",
"(",
"baseUrl",
")",
";",
"layerConfig",
".",
"setLayers",
"(",
"layerInfo",
".",
"getName",
"(",
")",
")",
";",
"layerConfig",
".",
"setVersion",
"(",
"version",
")",
";",
"return",
"layerConfig",
";",
"}"
] |
Create a WMS layer configuration object from a LayerInfo object acquired through a WMS GetCapabilities call.
@param layerInfo The layer info object. Acquired from a WMS GetCapabilities.
@param baseUrl The WMS base URL. This is the same URL you fed the GetCapabilities call. See {@link
WmsService#getCapabilities(String,
org.geomajas.gwt2.plugin.wms.client.service.WmsService.WmsVersion,
com.google.gwt.core.client.Callback)}.
@param version The WMS version.
@return Returns the WMS layer configuration object.
|
[
"Create",
"a",
"WMS",
"layer",
"configuration",
"object",
"from",
"a",
"LayerInfo",
"object",
"acquired",
"through",
"a",
"WMS",
"GetCapabilities",
"call",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java#L134-L141
|
145,818
|
OpenBEL/openbel-framework
|
org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java
|
DefaultCacheableResourceService.downloadResourceForUse
|
private File downloadResourceForUse(String resourceLocation,
ResourceType type)
throws ResourceDownloadError {
File downloadResource = downloadResource(resourceLocation, type);
return copyResource(downloadResource, resourceLocation);
}
|
java
|
private File downloadResourceForUse(String resourceLocation,
ResourceType type)
throws ResourceDownloadError {
File downloadResource = downloadResource(resourceLocation, type);
return copyResource(downloadResource, resourceLocation);
}
|
[
"private",
"File",
"downloadResourceForUse",
"(",
"String",
"resourceLocation",
",",
"ResourceType",
"type",
")",
"throws",
"ResourceDownloadError",
"{",
"File",
"downloadResource",
"=",
"downloadResource",
"(",
"resourceLocation",
",",
"type",
")",
";",
"return",
"copyResource",
"(",
"downloadResource",
",",
"resourceLocation",
")",
";",
"}"
] |
Download and copy the resource for use.
@param resourceLocation {@link String}, the resource location
@param type {@link ResourceType}, the type of resource
@return the resource copy {@link File} ready for processing
@throws ResourceDownloadError Throw if an error occurred resolving or
copying the resource
|
[
"Download",
"and",
"copy",
"the",
"resource",
"for",
"use",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java#L196-L201
|
145,819
|
OpenBEL/openbel-framework
|
org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java
|
DefaultCacheableResourceService.copyResource
|
private File
copyResource(final File resource, final String resourceLocation)
throws ResourceDownloadError {
final String tmpPath = asPath(getSystemConfiguration()
.getCacheDirectory().getAbsolutePath(),
ResourceType.TMP_FILE.getResourceFolderName());
final String uuidDirName = UUID.randomUUID().toString();
// load copy file and create parent directories
final File copyFile = new File(asPath(tmpPath, uuidDirName,
resource.getName()));
// copy to temp directory
File resourceCopy =
copyToDirectory(resource, resourceLocation, copyFile);
// hash uuid temp directory for cleanup later
tempResources.add(new File(asPath(tmpPath, uuidDirName)));
return resourceCopy;
}
|
java
|
private File
copyResource(final File resource, final String resourceLocation)
throws ResourceDownloadError {
final String tmpPath = asPath(getSystemConfiguration()
.getCacheDirectory().getAbsolutePath(),
ResourceType.TMP_FILE.getResourceFolderName());
final String uuidDirName = UUID.randomUUID().toString();
// load copy file and create parent directories
final File copyFile = new File(asPath(tmpPath, uuidDirName,
resource.getName()));
// copy to temp directory
File resourceCopy =
copyToDirectory(resource, resourceLocation, copyFile);
// hash uuid temp directory for cleanup later
tempResources.add(new File(asPath(tmpPath, uuidDirName)));
return resourceCopy;
}
|
[
"private",
"File",
"copyResource",
"(",
"final",
"File",
"resource",
",",
"final",
"String",
"resourceLocation",
")",
"throws",
"ResourceDownloadError",
"{",
"final",
"String",
"tmpPath",
"=",
"asPath",
"(",
"getSystemConfiguration",
"(",
")",
".",
"getCacheDirectory",
"(",
")",
".",
"getAbsolutePath",
"(",
")",
",",
"ResourceType",
".",
"TMP_FILE",
".",
"getResourceFolderName",
"(",
")",
")",
";",
"final",
"String",
"uuidDirName",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"// load copy file and create parent directories",
"final",
"File",
"copyFile",
"=",
"new",
"File",
"(",
"asPath",
"(",
"tmpPath",
",",
"uuidDirName",
",",
"resource",
".",
"getName",
"(",
")",
")",
")",
";",
"// copy to temp directory",
"File",
"resourceCopy",
"=",
"copyToDirectory",
"(",
"resource",
",",
"resourceLocation",
",",
"copyFile",
")",
";",
"// hash uuid temp directory for cleanup later",
"tempResources",
".",
"add",
"(",
"new",
"File",
"(",
"asPath",
"(",
"tmpPath",
",",
"uuidDirName",
")",
")",
")",
";",
"return",
"resourceCopy",
";",
"}"
] |
Copy the resource to the system's temporary resources.
@param resource {@link File}, the resource to copy from
@param resourceLocation {@link String}, the resource location
@return the resource copy {@link File} ready for processing
@throws ResourceDownloadError Throw if an error occurred copying the
resource
|
[
"Copy",
"the",
"resource",
"to",
"the",
"system",
"s",
"temporary",
"resources",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java#L212-L232
|
145,820
|
OpenBEL/openbel-framework
|
org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java
|
DefaultCacheableResourceService.areHashFilesEqual
|
private boolean areHashFilesEqual(File hashFile1, File hashFile2,
String remoteLocation) throws ResourceDownloadError {
try {
String resource1Hash = readFileToString(hashFile1, UTF_8);
String resource2Hash = readFileToString(hashFile2, UTF_8);
return resource1Hash.trim().equalsIgnoreCase(resource2Hash.trim());
} catch (IOException e) {
throw new ResourceDownloadError(remoteLocation, e.getMessage());
}
}
|
java
|
private boolean areHashFilesEqual(File hashFile1, File hashFile2,
String remoteLocation) throws ResourceDownloadError {
try {
String resource1Hash = readFileToString(hashFile1, UTF_8);
String resource2Hash = readFileToString(hashFile2, UTF_8);
return resource1Hash.trim().equalsIgnoreCase(resource2Hash.trim());
} catch (IOException e) {
throw new ResourceDownloadError(remoteLocation, e.getMessage());
}
}
|
[
"private",
"boolean",
"areHashFilesEqual",
"(",
"File",
"hashFile1",
",",
"File",
"hashFile2",
",",
"String",
"remoteLocation",
")",
"throws",
"ResourceDownloadError",
"{",
"try",
"{",
"String",
"resource1Hash",
"=",
"readFileToString",
"(",
"hashFile1",
",",
"UTF_8",
")",
";",
"String",
"resource2Hash",
"=",
"readFileToString",
"(",
"hashFile2",
",",
"UTF_8",
")",
";",
"return",
"resource1Hash",
".",
"trim",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"resource2Hash",
".",
"trim",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"ResourceDownloadError",
"(",
"remoteLocation",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}"
] |
Compares the hashes contained in the resource files. The hashes in the
files are compared case-insensitively in order to support hexadecimal
variations on a-f and A-F.
@param hashFile1 {@link File}, the first hash file
@param hashFile2 {@link File}, the second hash file
@param remoteLocation {@link String}, the resource remote location
@return <tt>boolean</tt> indicating <tt>true</tt>, if the hash files are
equal, or <tt>false</tt> if the hash files are not equal
@throws IOException Thrown if an IO error occurred reading the resource
hashes
|
[
"Compares",
"the",
"hashes",
"contained",
"in",
"the",
"resource",
"files",
".",
"The",
"hashes",
"in",
"the",
"files",
"are",
"compared",
"case",
"-",
"insensitively",
"in",
"order",
"to",
"support",
"hexadecimal",
"variations",
"on",
"a",
"-",
"f",
"and",
"A",
"-",
"F",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java#L247-L257
|
145,821
|
astrapi69/jaulp-wicket
|
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/beaneditor/BeanEditorPanel.java
|
BeanEditorPanel.newRepeatingView
|
protected RepeatingView newRepeatingView(final String id, final IModel<T> model)
{
final RepeatingView fields = new RepeatingView("fields");
form.add(fields);
final T modelObject = model.getObject();
for (final Field field : modelObject.getClass().getDeclaredFields())
{
// skip serialVersionUID...
if (field.getName().equalsIgnoreCase("serialVersionUID"))
{
continue;
}
final WebMarkupContainer row = new WebMarkupContainer(fields.newChildId());
fields.add(row);
final IModel<String> labelModel = Model.of(field.getName());
row.add(new Label("name", labelModel));
final IModel<?> fieldModel = new PropertyModel<Object>(modelObject, field.getName());
// Create the editor for the field.
row.add(newEditorForBeanField("editor", field, fieldModel));
}
return fields;
}
|
java
|
protected RepeatingView newRepeatingView(final String id, final IModel<T> model)
{
final RepeatingView fields = new RepeatingView("fields");
form.add(fields);
final T modelObject = model.getObject();
for (final Field field : modelObject.getClass().getDeclaredFields())
{
// skip serialVersionUID...
if (field.getName().equalsIgnoreCase("serialVersionUID"))
{
continue;
}
final WebMarkupContainer row = new WebMarkupContainer(fields.newChildId());
fields.add(row);
final IModel<String> labelModel = Model.of(field.getName());
row.add(new Label("name", labelModel));
final IModel<?> fieldModel = new PropertyModel<Object>(modelObject, field.getName());
// Create the editor for the field.
row.add(newEditorForBeanField("editor", field, fieldModel));
}
return fields;
}
|
[
"protected",
"RepeatingView",
"newRepeatingView",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"RepeatingView",
"fields",
"=",
"new",
"RepeatingView",
"(",
"\"fields\"",
")",
";",
"form",
".",
"add",
"(",
"fields",
")",
";",
"final",
"T",
"modelObject",
"=",
"model",
".",
"getObject",
"(",
")",
";",
"for",
"(",
"final",
"Field",
"field",
":",
"modelObject",
".",
"getClass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
")",
"{",
"// skip serialVersionUID...\r",
"if",
"(",
"field",
".",
"getName",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"\"serialVersionUID\"",
")",
")",
"{",
"continue",
";",
"}",
"final",
"WebMarkupContainer",
"row",
"=",
"new",
"WebMarkupContainer",
"(",
"fields",
".",
"newChildId",
"(",
")",
")",
";",
"fields",
".",
"add",
"(",
"row",
")",
";",
"final",
"IModel",
"<",
"String",
">",
"labelModel",
"=",
"Model",
".",
"of",
"(",
"field",
".",
"getName",
"(",
")",
")",
";",
"row",
".",
"add",
"(",
"new",
"Label",
"(",
"\"name\"",
",",
"labelModel",
")",
")",
";",
"final",
"IModel",
"<",
"?",
">",
"fieldModel",
"=",
"new",
"PropertyModel",
"<",
"Object",
">",
"(",
"modelObject",
",",
"field",
".",
"getName",
"(",
")",
")",
";",
"// Create the editor for the field.\r",
"row",
".",
"add",
"(",
"newEditorForBeanField",
"(",
"\"editor\"",
",",
"field",
",",
"fieldModel",
")",
")",
";",
"}",
"return",
"fields",
";",
"}"
] |
Factory method for creating the RepeatingView. This method is invoked in the constructor from
the derived classes and can be overridden so users can provide their own version of a
RepeatingView.
@param id
the id
@param model
the model
@return the RepeatingView
|
[
"Factory",
"method",
"for",
"creating",
"the",
"RepeatingView",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"version",
"of",
"a",
"RepeatingView",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/beaneditor/BeanEditorPanel.java#L118-L144
|
145,822
|
nohana/Amalgam
|
amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java
|
DialogFragmentUtils.supportFindDialogFragmentByTag
|
@SuppressWarnings("unchecked") // we know the dialog fragment is a child of fragment.
public static <F extends android.support.v4.app.DialogFragment> F supportFindDialogFragmentByTag(android.support.v4.app.FragmentManager manager, String tag) {
return (F) manager.findFragmentByTag(tag);
}
|
java
|
@SuppressWarnings("unchecked") // we know the dialog fragment is a child of fragment.
public static <F extends android.support.v4.app.DialogFragment> F supportFindDialogFragmentByTag(android.support.v4.app.FragmentManager manager, String tag) {
return (F) manager.findFragmentByTag(tag);
}
|
[
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// we know the dialog fragment is a child of fragment.",
"public",
"static",
"<",
"F",
"extends",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"DialogFragment",
">",
"F",
"supportFindDialogFragmentByTag",
"(",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"FragmentManager",
"manager",
",",
"String",
"tag",
")",
"{",
"return",
"(",
"F",
")",
"manager",
".",
"findFragmentByTag",
"(",
"tag",
")",
";",
"}"
] |
Find fragment registered on the manager.
@param manager the manager.
@param tag the tag string that is related to the {@link android.support.v4.app.DialogFragment}.
@param <F> the dialog fragment impl.
@return the {@link android.support.v4.app.DialogFragment}. {@code null} if the fragment not found.
|
[
"Find",
"fragment",
"registered",
"on",
"the",
"manager",
"."
] |
57809ddbfe7897e979cf507982ce0b3aa5e0ed8a
|
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L54-L57
|
145,823
|
geomajas/geomajas-project-client-gwt2
|
plugin/wfs/server-extension/src/main/java/org/geomajas/gwt2/plugin/wfs/server/command/WfsGetFeatureCommand.java
|
WfsGetFeatureCommand.createQuery
|
protected Query createQuery(String typeName, List<AttributeDescriptor> schema, Criterion criterion,
int maxFeatures, int startIndex, List<String> attributeNames, String crs) throws IOException {
CriterionToFilterConverter converter = criterionToFilterFactory.createConverter();
Filter filter = converter.convert(criterion, schema);
Query query = null;
if (attributeNames == null) {
query = new Query(typeName, filter, maxFeatures > 0 ? maxFeatures : Integer.MAX_VALUE, Query.ALL_NAMES,
null);
} else {
query = new Query(typeName, filter, maxFeatures > 0 ? maxFeatures : Integer.MAX_VALUE,
attributeNames.toArray(new String[attributeNames.size()]), null);
}
if (startIndex > 0) {
query.setStartIndex(startIndex);
}
if (null != crs) {
try {
// always use the urn version as otherwise servers disagree on axis order
if (crs.equalsIgnoreCase("EPSG:4326")) {
crs = "urn:x-ogc:def:crs:EPSG:4326";
}
query.setCoordinateSystem(CRS.decode(crs));
} catch (NoSuchAuthorityCodeException e) { // assume non-fatal
log.warn("Problem getting CRS for id " + crs + ": " + e.getMessage());
} catch (FactoryException e) {
// assume non-fatal
log.warn("Problem getting CRS for id " + crs + ": " + e.getMessage());
}
}
return query;
}
|
java
|
protected Query createQuery(String typeName, List<AttributeDescriptor> schema, Criterion criterion,
int maxFeatures, int startIndex, List<String> attributeNames, String crs) throws IOException {
CriterionToFilterConverter converter = criterionToFilterFactory.createConverter();
Filter filter = converter.convert(criterion, schema);
Query query = null;
if (attributeNames == null) {
query = new Query(typeName, filter, maxFeatures > 0 ? maxFeatures : Integer.MAX_VALUE, Query.ALL_NAMES,
null);
} else {
query = new Query(typeName, filter, maxFeatures > 0 ? maxFeatures : Integer.MAX_VALUE,
attributeNames.toArray(new String[attributeNames.size()]), null);
}
if (startIndex > 0) {
query.setStartIndex(startIndex);
}
if (null != crs) {
try {
// always use the urn version as otherwise servers disagree on axis order
if (crs.equalsIgnoreCase("EPSG:4326")) {
crs = "urn:x-ogc:def:crs:EPSG:4326";
}
query.setCoordinateSystem(CRS.decode(crs));
} catch (NoSuchAuthorityCodeException e) { // assume non-fatal
log.warn("Problem getting CRS for id " + crs + ": " + e.getMessage());
} catch (FactoryException e) {
// assume non-fatal
log.warn("Problem getting CRS for id " + crs + ": " + e.getMessage());
}
}
return query;
}
|
[
"protected",
"Query",
"createQuery",
"(",
"String",
"typeName",
",",
"List",
"<",
"AttributeDescriptor",
">",
"schema",
",",
"Criterion",
"criterion",
",",
"int",
"maxFeatures",
",",
"int",
"startIndex",
",",
"List",
"<",
"String",
">",
"attributeNames",
",",
"String",
"crs",
")",
"throws",
"IOException",
"{",
"CriterionToFilterConverter",
"converter",
"=",
"criterionToFilterFactory",
".",
"createConverter",
"(",
")",
";",
"Filter",
"filter",
"=",
"converter",
".",
"convert",
"(",
"criterion",
",",
"schema",
")",
";",
"Query",
"query",
"=",
"null",
";",
"if",
"(",
"attributeNames",
"==",
"null",
")",
"{",
"query",
"=",
"new",
"Query",
"(",
"typeName",
",",
"filter",
",",
"maxFeatures",
">",
"0",
"?",
"maxFeatures",
":",
"Integer",
".",
"MAX_VALUE",
",",
"Query",
".",
"ALL_NAMES",
",",
"null",
")",
";",
"}",
"else",
"{",
"query",
"=",
"new",
"Query",
"(",
"typeName",
",",
"filter",
",",
"maxFeatures",
">",
"0",
"?",
"maxFeatures",
":",
"Integer",
".",
"MAX_VALUE",
",",
"attributeNames",
".",
"toArray",
"(",
"new",
"String",
"[",
"attributeNames",
".",
"size",
"(",
")",
"]",
")",
",",
"null",
")",
";",
"}",
"if",
"(",
"startIndex",
">",
"0",
")",
"{",
"query",
".",
"setStartIndex",
"(",
"startIndex",
")",
";",
"}",
"if",
"(",
"null",
"!=",
"crs",
")",
"{",
"try",
"{",
"// always use the urn version as otherwise servers disagree on axis order",
"if",
"(",
"crs",
".",
"equalsIgnoreCase",
"(",
"\"EPSG:4326\"",
")",
")",
"{",
"crs",
"=",
"\"urn:x-ogc:def:crs:EPSG:4326\"",
";",
"}",
"query",
".",
"setCoordinateSystem",
"(",
"CRS",
".",
"decode",
"(",
"crs",
")",
")",
";",
"}",
"catch",
"(",
"NoSuchAuthorityCodeException",
"e",
")",
"{",
"// assume non-fatal",
"log",
".",
"warn",
"(",
"\"Problem getting CRS for id \"",
"+",
"crs",
"+",
"\": \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"catch",
"(",
"FactoryException",
"e",
")",
"{",
"// assume non-fatal",
"log",
".",
"warn",
"(",
"\"Problem getting CRS for id \"",
"+",
"crs",
"+",
"\": \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}",
"return",
"query",
";",
"}"
] |
Query a geotools source for features using the criterion as a filter.
@param source
@param criterion
@param attributeNames
@param crs
@return
@throws IOException
@throws GeomajasException
|
[
"Query",
"a",
"geotools",
"source",
"for",
"features",
"using",
"the",
"criterion",
"as",
"a",
"filter",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wfs/server-extension/src/main/java/org/geomajas/gwt2/plugin/wfs/server/command/WfsGetFeatureCommand.java#L173-L203
|
145,824
|
geomajas/geomajas-project-client-gwt2
|
plugin/wfs/server-extension/src/main/java/org/geomajas/gwt2/plugin/wfs/server/command/WfsGetFeatureCommand.java
|
WfsGetFeatureCommand.convertFeatures
|
protected List<Feature> convertFeatures(FeatureCollection<SimpleFeatureType, SimpleFeature> features,
int maxCoordinates, double startDistance) throws IOException, GeomajasException {
FeatureIterator<SimpleFeature> iterator = features.features();
List<Feature> dtoFeatures = new ArrayList<Feature>();
FeatureConverter converter = new FeatureConverter();
while (iterator.hasNext()) {
try {
SimpleFeature feature = iterator.next();
dtoFeatures.add(converter.toDto(feature, maxCoordinates));
} catch (Exception e) {
continue;
}
}
iterator.close();
return dtoFeatures;
}
|
java
|
protected List<Feature> convertFeatures(FeatureCollection<SimpleFeatureType, SimpleFeature> features,
int maxCoordinates, double startDistance) throws IOException, GeomajasException {
FeatureIterator<SimpleFeature> iterator = features.features();
List<Feature> dtoFeatures = new ArrayList<Feature>();
FeatureConverter converter = new FeatureConverter();
while (iterator.hasNext()) {
try {
SimpleFeature feature = iterator.next();
dtoFeatures.add(converter.toDto(feature, maxCoordinates));
} catch (Exception e) {
continue;
}
}
iterator.close();
return dtoFeatures;
}
|
[
"protected",
"List",
"<",
"Feature",
">",
"convertFeatures",
"(",
"FeatureCollection",
"<",
"SimpleFeatureType",
",",
"SimpleFeature",
">",
"features",
",",
"int",
"maxCoordinates",
",",
"double",
"startDistance",
")",
"throws",
"IOException",
",",
"GeomajasException",
"{",
"FeatureIterator",
"<",
"SimpleFeature",
">",
"iterator",
"=",
"features",
".",
"features",
"(",
")",
";",
"List",
"<",
"Feature",
">",
"dtoFeatures",
"=",
"new",
"ArrayList",
"<",
"Feature",
">",
"(",
")",
";",
"FeatureConverter",
"converter",
"=",
"new",
"FeatureConverter",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"try",
"{",
"SimpleFeature",
"feature",
"=",
"iterator",
".",
"next",
"(",
")",
";",
"dtoFeatures",
".",
"add",
"(",
"converter",
".",
"toDto",
"(",
"feature",
",",
"maxCoordinates",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"continue",
";",
"}",
"}",
"iterator",
".",
"close",
"(",
")",
";",
"return",
"dtoFeatures",
";",
"}"
] |
Convert a feature collection to its dto equivalent.
@param features
@return
@throws IOException
@throws GeomajasException
|
[
"Convert",
"a",
"feature",
"collection",
"to",
"its",
"dto",
"equivalent",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wfs/server-extension/src/main/java/org/geomajas/gwt2/plugin/wfs/server/command/WfsGetFeatureCommand.java#L231-L246
|
145,825
|
geomajas/geomajas-project-client-gwt2
|
plugin/wfs/server-extension/src/main/java/org/geomajas/gwt2/plugin/wfs/server/command/WfsGetFeatureCommand.java
|
WfsGetFeatureCommand.getTotalBounds
|
protected Bbox getTotalBounds(List<Feature> features) {
Bbox total = null;
for (Feature featureDto : features) {
org.geomajas.geometry.Geometry geom = featureDto.getGeometry();
if (geom != null) {
Bbox b = GeometryService.getBounds(geom);
if (total == null) {
total = b;
} else {
total = BboxService.union(total, b);
}
}
}
return total;
}
|
java
|
protected Bbox getTotalBounds(List<Feature> features) {
Bbox total = null;
for (Feature featureDto : features) {
org.geomajas.geometry.Geometry geom = featureDto.getGeometry();
if (geom != null) {
Bbox b = GeometryService.getBounds(geom);
if (total == null) {
total = b;
} else {
total = BboxService.union(total, b);
}
}
}
return total;
}
|
[
"protected",
"Bbox",
"getTotalBounds",
"(",
"List",
"<",
"Feature",
">",
"features",
")",
"{",
"Bbox",
"total",
"=",
"null",
";",
"for",
"(",
"Feature",
"featureDto",
":",
"features",
")",
"{",
"org",
".",
"geomajas",
".",
"geometry",
".",
"Geometry",
"geom",
"=",
"featureDto",
".",
"getGeometry",
"(",
")",
";",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"Bbox",
"b",
"=",
"GeometryService",
".",
"getBounds",
"(",
"geom",
")",
";",
"if",
"(",
"total",
"==",
"null",
")",
"{",
"total",
"=",
"b",
";",
"}",
"else",
"{",
"total",
"=",
"BboxService",
".",
"union",
"(",
"total",
",",
"b",
")",
";",
"}",
"}",
"}",
"return",
"total",
";",
"}"
] |
Get the total bounds of all features in the collection.
@param features
@return bounds or null if no features
|
[
"Get",
"the",
"total",
"bounds",
"of",
"all",
"features",
"in",
"the",
"collection",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wfs/server-extension/src/main/java/org/geomajas/gwt2/plugin/wfs/server/command/WfsGetFeatureCommand.java#L254-L268
|
145,826
|
ops4j/org.ops4j.pax.exam1
|
ops4j-quickbuild-core/src/main/java/org/ops4j/pax/exam/quickbuild/internal/DefaultQuickbuild.java
|
DefaultQuickbuild.pack
|
public void pack( Map<String, URI> agg, OutputStream out )
throws IOException
{
// calculate the final map
JarOutputStream jout = new JarOutputStream( out );
try
{
// first set manifest if available:
URI manifest = agg.get( "META-INF/MANIFEST.MF" );
if( manifest != null )
{
JarEntry entry = new JarEntry( "META-INF/MANIFEST.MF" );
jout.putNextEntry( entry );
StreamUtils.copyStream( manifest.toURL().openStream(), jout, false );
jout.closeEntry();
}
for( String name : agg.keySet() )
{
if( name.equals( "META-INF/MANIFEST.MF" ) )
{
continue;
}
JarEntry entry = new JarEntry( name );
jout.putNextEntry( entry );
StreamUtils.copyStream( agg.get( name ).toURL().openStream(), jout, false );
jout.closeEntry();
}
} finally
{
jout.close();
}
}
|
java
|
public void pack( Map<String, URI> agg, OutputStream out )
throws IOException
{
// calculate the final map
JarOutputStream jout = new JarOutputStream( out );
try
{
// first set manifest if available:
URI manifest = agg.get( "META-INF/MANIFEST.MF" );
if( manifest != null )
{
JarEntry entry = new JarEntry( "META-INF/MANIFEST.MF" );
jout.putNextEntry( entry );
StreamUtils.copyStream( manifest.toURL().openStream(), jout, false );
jout.closeEntry();
}
for( String name : agg.keySet() )
{
if( name.equals( "META-INF/MANIFEST.MF" ) )
{
continue;
}
JarEntry entry = new JarEntry( name );
jout.putNextEntry( entry );
StreamUtils.copyStream( agg.get( name ).toURL().openStream(), jout, false );
jout.closeEntry();
}
} finally
{
jout.close();
}
}
|
[
"public",
"void",
"pack",
"(",
"Map",
"<",
"String",
",",
"URI",
">",
"agg",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"// calculate the final map",
"JarOutputStream",
"jout",
"=",
"new",
"JarOutputStream",
"(",
"out",
")",
";",
"try",
"{",
"// first set manifest if available:",
"URI",
"manifest",
"=",
"agg",
".",
"get",
"(",
"\"META-INF/MANIFEST.MF\"",
")",
";",
"if",
"(",
"manifest",
"!=",
"null",
")",
"{",
"JarEntry",
"entry",
"=",
"new",
"JarEntry",
"(",
"\"META-INF/MANIFEST.MF\"",
")",
";",
"jout",
".",
"putNextEntry",
"(",
"entry",
")",
";",
"StreamUtils",
".",
"copyStream",
"(",
"manifest",
".",
"toURL",
"(",
")",
".",
"openStream",
"(",
")",
",",
"jout",
",",
"false",
")",
";",
"jout",
".",
"closeEntry",
"(",
")",
";",
"}",
"for",
"(",
"String",
"name",
":",
"agg",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"\"META-INF/MANIFEST.MF\"",
")",
")",
"{",
"continue",
";",
"}",
"JarEntry",
"entry",
"=",
"new",
"JarEntry",
"(",
"name",
")",
";",
"jout",
".",
"putNextEntry",
"(",
"entry",
")",
";",
"StreamUtils",
".",
"copyStream",
"(",
"agg",
".",
"get",
"(",
"name",
")",
".",
"toURL",
"(",
")",
".",
"openStream",
"(",
")",
",",
"jout",
",",
"false",
")",
";",
"jout",
".",
"closeEntry",
"(",
")",
";",
"}",
"}",
"finally",
"{",
"jout",
".",
"close",
"(",
")",
";",
"}",
"}"
] |
Just pack fully resolved resources into an outputstream.
@param agg
@param out
|
[
"Just",
"pack",
"fully",
"resolved",
"resources",
"into",
"an",
"outputstream",
"."
] |
7c8742208117ff91bd24bcd3a185d2d019f7000f
|
https://github.com/ops4j/org.ops4j.pax.exam1/blob/7c8742208117ff91bd24bcd3a185d2d019f7000f/ops4j-quickbuild-core/src/main/java/org/ops4j/pax/exam/quickbuild/internal/DefaultQuickbuild.java#L114-L148
|
145,827
|
geomajas/geomajas-project-client-gwt2
|
impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java
|
GeometryPath.addSubPath
|
public void addSubPath(Coordinate[] coordinates, boolean closed) {
subPaths.add(new SubPath(coordinates, closed));
updateCoordinates();
}
|
java
|
public void addSubPath(Coordinate[] coordinates, boolean closed) {
subPaths.add(new SubPath(coordinates, closed));
updateCoordinates();
}
|
[
"public",
"void",
"addSubPath",
"(",
"Coordinate",
"[",
"]",
"coordinates",
",",
"boolean",
"closed",
")",
"{",
"subPaths",
".",
"add",
"(",
"new",
"SubPath",
"(",
"coordinates",
",",
"closed",
")",
")",
";",
"updateCoordinates",
"(",
")",
";",
"}"
] |
Add a new sub-path to the path. A path can have multiple sub-paths. Sub-paths may be disconnected lines or rings
but, thanks to even-odd rule, holes can be added as well.
@param coordinates
@param closed
|
[
"Add",
"a",
"new",
"sub",
"-",
"path",
"to",
"the",
"path",
".",
"A",
"path",
"can",
"have",
"multiple",
"sub",
"-",
"paths",
".",
"Sub",
"-",
"paths",
"may",
"be",
"disconnected",
"lines",
"or",
"rings",
"but",
"thanks",
"to",
"even",
"-",
"odd",
"rule",
"holes",
"can",
"be",
"added",
"as",
"well",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java#L130-L134
|
145,828
|
geomajas/geomajas-project-client-gwt2
|
impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java
|
GeometryPath.addCoordinate
|
public void addCoordinate(Coordinate coordinate) {
Coordinate[] newCoords = new Coordinate[coordinates.length + 1];
System.arraycopy(coordinates, 0, newCoords, 0, coordinates.length);
newCoords[coordinates.length] = coordinate;
setCoordinates(newCoords);
}
|
java
|
public void addCoordinate(Coordinate coordinate) {
Coordinate[] newCoords = new Coordinate[coordinates.length + 1];
System.arraycopy(coordinates, 0, newCoords, 0, coordinates.length);
newCoords[coordinates.length] = coordinate;
setCoordinates(newCoords);
}
|
[
"public",
"void",
"addCoordinate",
"(",
"Coordinate",
"coordinate",
")",
"{",
"Coordinate",
"[",
"]",
"newCoords",
"=",
"new",
"Coordinate",
"[",
"coordinates",
".",
"length",
"+",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"coordinates",
",",
"0",
",",
"newCoords",
",",
"0",
",",
"coordinates",
".",
"length",
")",
";",
"newCoords",
"[",
"coordinates",
".",
"length",
"]",
"=",
"coordinate",
";",
"setCoordinates",
"(",
"newCoords",
")",
";",
"}"
] |
Add a coordinate to the path.
@param coordinate
|
[
"Add",
"a",
"coordinate",
"to",
"the",
"path",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java#L141-L146
|
145,829
|
geomajas/geomajas-project-client-gwt2
|
impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java
|
GeometryPath.moveCoordinate
|
public void moveCoordinate(Coordinate coordinate, int index) {
if (index < coordinates.length) {
coordinates[index] = (Coordinate) coordinate.clone();
}
setCoordinates(coordinates);
}
|
java
|
public void moveCoordinate(Coordinate coordinate, int index) {
if (index < coordinates.length) {
coordinates[index] = (Coordinate) coordinate.clone();
}
setCoordinates(coordinates);
}
|
[
"public",
"void",
"moveCoordinate",
"(",
"Coordinate",
"coordinate",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"coordinates",
".",
"length",
")",
"{",
"coordinates",
"[",
"index",
"]",
"=",
"(",
"Coordinate",
")",
"coordinate",
".",
"clone",
"(",
")",
";",
"}",
"setCoordinates",
"(",
"coordinates",
")",
";",
"}"
] |
Move the coordinate at the specified index.
@param coordinate the new coordinate
@param index
|
[
"Move",
"the",
"coordinate",
"at",
"the",
"specified",
"index",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/gfx/GeometryPath.java#L154-L159
|
145,830
|
OpenBEL/openbel-framework
|
org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/core/Cache.java
|
Cache.get
|
public T get(String key) {
SoftReference<T> ref = cacheMap.get(key);
if (ref != null) {
if (ref.get() == null) {
logger.debug("Cached item was cleared: " + key);
}
return ref.get(); //maybe still be null
}
return null;
}
|
java
|
public T get(String key) {
SoftReference<T> ref = cacheMap.get(key);
if (ref != null) {
if (ref.get() == null) {
logger.debug("Cached item was cleared: " + key);
}
return ref.get(); //maybe still be null
}
return null;
}
|
[
"public",
"T",
"get",
"(",
"String",
"key",
")",
"{",
"SoftReference",
"<",
"T",
">",
"ref",
"=",
"cacheMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"ref",
"!=",
"null",
")",
"{",
"if",
"(",
"ref",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Cached item was cleared: \"",
"+",
"key",
")",
";",
"}",
"return",
"ref",
".",
"get",
"(",
")",
";",
"//maybe still be null",
"}",
"return",
"null",
";",
"}"
] |
Retrieves an object from cache. If the object was cleared due to memory demand, null will
be returned.
@param key
@return value
|
[
"Retrieves",
"an",
"object",
"from",
"cache",
".",
"If",
"the",
"object",
"was",
"cleared",
"due",
"to",
"memory",
"demand",
"null",
"will",
"be",
"returned",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/core/Cache.java#L111-L121
|
145,831
|
astrapi69/jaulp-wicket
|
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/seo/DisableJSessionIDinUrlApplication.java
|
DisableJSessionIDinUrlApplication.newWebResponse
|
@Override
protected WebResponse newWebResponse(final WebRequest webRequest,
final HttpServletResponse httpServletResponse)
{
return new ServletWebResponse((ServletWebRequest)webRequest, httpServletResponse)
{
@Override
public String encodeRedirectURL(final CharSequence url)
{
return isRobot(webRequest) ? url.toString() : super.encodeRedirectURL(url);
}
@Override
public String encodeURL(final CharSequence url)
{
return isRobot(webRequest) ? url.toString() : super.encodeURL(url);
}
private boolean isRobot(final WebRequest request)
{
final String agent = webRequest.getHeader("User-Agent");
return BotAgentInspector.isAgent(agent);
}
};
}
|
java
|
@Override
protected WebResponse newWebResponse(final WebRequest webRequest,
final HttpServletResponse httpServletResponse)
{
return new ServletWebResponse((ServletWebRequest)webRequest, httpServletResponse)
{
@Override
public String encodeRedirectURL(final CharSequence url)
{
return isRobot(webRequest) ? url.toString() : super.encodeRedirectURL(url);
}
@Override
public String encodeURL(final CharSequence url)
{
return isRobot(webRequest) ? url.toString() : super.encodeURL(url);
}
private boolean isRobot(final WebRequest request)
{
final String agent = webRequest.getHeader("User-Agent");
return BotAgentInspector.isAgent(agent);
}
};
}
|
[
"@",
"Override",
"protected",
"WebResponse",
"newWebResponse",
"(",
"final",
"WebRequest",
"webRequest",
",",
"final",
"HttpServletResponse",
"httpServletResponse",
")",
"{",
"return",
"new",
"ServletWebResponse",
"(",
"(",
"ServletWebRequest",
")",
"webRequest",
",",
"httpServletResponse",
")",
"{",
"@",
"Override",
"public",
"String",
"encodeRedirectURL",
"(",
"final",
"CharSequence",
"url",
")",
"{",
"return",
"isRobot",
"(",
"webRequest",
")",
"?",
"url",
".",
"toString",
"(",
")",
":",
"super",
".",
"encodeRedirectURL",
"(",
"url",
")",
";",
"}",
"@",
"Override",
"public",
"String",
"encodeURL",
"(",
"final",
"CharSequence",
"url",
")",
"{",
"return",
"isRobot",
"(",
"webRequest",
")",
"?",
"url",
".",
"toString",
"(",
")",
":",
"super",
".",
"encodeURL",
"(",
"url",
")",
";",
"}",
"private",
"boolean",
"isRobot",
"(",
"final",
"WebRequest",
"request",
")",
"{",
"final",
"String",
"agent",
"=",
"webRequest",
".",
"getHeader",
"(",
"\"User-Agent\"",
")",
";",
"return",
"BotAgentInspector",
".",
"isAgent",
"(",
"agent",
")",
";",
"}",
"}",
";",
"}"
] |
Disable sessionId in the url if it comes from a robot.
@param webRequest
the web request
@param httpServletResponse
the http servlet response
@return the web response
|
[
"Disable",
"sessionId",
"in",
"the",
"url",
"if",
"it",
"comes",
"from",
"a",
"robot",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/seo/DisableJSessionIDinUrlApplication.java#L50-L75
|
145,832
|
astrapi69/jaulp-wicket
|
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/BaseWebApplication.java
|
BaseWebApplication.getUptime
|
public Duration getUptime()
{
final DateTime startup = getStartupDate();
if (null != startup)
{
return Duration.elapsed(Time.valueOf(startup.toDate()));
}
return Duration.NONE;
}
|
java
|
public Duration getUptime()
{
final DateTime startup = getStartupDate();
if (null != startup)
{
return Duration.elapsed(Time.valueOf(startup.toDate()));
}
return Duration.NONE;
}
|
[
"public",
"Duration",
"getUptime",
"(",
")",
"{",
"final",
"DateTime",
"startup",
"=",
"getStartupDate",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"startup",
")",
"{",
"return",
"Duration",
".",
"elapsed",
"(",
"Time",
".",
"valueOf",
"(",
"startup",
".",
"toDate",
"(",
")",
")",
")",
";",
"}",
"return",
"Duration",
".",
"NONE",
";",
"}"
] |
Gets the elapsed duration since this application was initialized.
@return the uptime
|
[
"Gets",
"the",
"elapsed",
"duration",
"since",
"this",
"application",
"was",
"initialized",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/BaseWebApplication.java#L112-L120
|
145,833
|
astrapi69/jaulp-wicket
|
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/BaseWebApplication.java
|
BaseWebApplication.newApplicationDataStore
|
protected IDataStore newApplicationDataStore()
{
final StoreSettings storeSettings = getStoreSettings();
final Bytes maxSizePerSession = storeSettings.getMaxSizePerSession();
final File fileStoreFolder = storeSettings.getFileStoreFolder();
return new DiskDataStore(this.getName(), fileStoreFolder, maxSizePerSession);
}
|
java
|
protected IDataStore newApplicationDataStore()
{
final StoreSettings storeSettings = getStoreSettings();
final Bytes maxSizePerSession = storeSettings.getMaxSizePerSession();
final File fileStoreFolder = storeSettings.getFileStoreFolder();
return new DiskDataStore(this.getName(), fileStoreFolder, maxSizePerSession);
}
|
[
"protected",
"IDataStore",
"newApplicationDataStore",
"(",
")",
"{",
"final",
"StoreSettings",
"storeSettings",
"=",
"getStoreSettings",
"(",
")",
";",
"final",
"Bytes",
"maxSizePerSession",
"=",
"storeSettings",
".",
"getMaxSizePerSession",
"(",
")",
";",
"final",
"File",
"fileStoreFolder",
"=",
"storeSettings",
".",
"getFileStoreFolder",
"(",
")",
";",
"return",
"new",
"DiskDataStore",
"(",
"this",
".",
"getName",
"(",
")",
",",
"fileStoreFolder",
",",
"maxSizePerSession",
")",
";",
"}"
] |
Factory method that can be overwritten to provide an application data store. Here the default
will be returned.
For instance:
<pre>
public void init() {
...
getStoreSettings().setInmemoryCacheSize(30);
setPageManagerProvider(new DefaultPageManagerProvider(this)
{
@Override
protected IDataStore newDataStore()
{
return newApplicationDataStore();
}
});
...
}
</pre>
@return the IDataStore.
|
[
"Factory",
"method",
"that",
"can",
"be",
"overwritten",
"to",
"provide",
"an",
"application",
"data",
"store",
".",
"Here",
"the",
"default",
"will",
"be",
"returned",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/BaseWebApplication.java#L190-L196
|
145,834
|
astrapi69/jaulp-wicket
|
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/BaseWebApplication.java
|
BaseWebApplication.onApplicationConfigurations
|
protected void onApplicationConfigurations()
{
// set configuration before the application configuration...
onBeforeApplicationConfigurations();
// set global configurations for both development and deployment mode...
onGlobalSettings();
// set configuration for development...
if (RuntimeConfigurationType.DEVELOPMENT.equals(this.getConfigurationType()))
{
onDevelopmentModeSettings();
}
// set configuration for deployment...
if (RuntimeConfigurationType.DEPLOYMENT.equals(this.getConfigurationType()))
{
onDeploymentModeSettings();
}
}
|
java
|
protected void onApplicationConfigurations()
{
// set configuration before the application configuration...
onBeforeApplicationConfigurations();
// set global configurations for both development and deployment mode...
onGlobalSettings();
// set configuration for development...
if (RuntimeConfigurationType.DEVELOPMENT.equals(this.getConfigurationType()))
{
onDevelopmentModeSettings();
}
// set configuration for deployment...
if (RuntimeConfigurationType.DEPLOYMENT.equals(this.getConfigurationType()))
{
onDeploymentModeSettings();
}
}
|
[
"protected",
"void",
"onApplicationConfigurations",
"(",
")",
"{",
"// set configuration before the application configuration...",
"onBeforeApplicationConfigurations",
"(",
")",
";",
"// set global configurations for both development and deployment mode...",
"onGlobalSettings",
"(",
")",
";",
"// set configuration for development...",
"if",
"(",
"RuntimeConfigurationType",
".",
"DEVELOPMENT",
".",
"equals",
"(",
"this",
".",
"getConfigurationType",
"(",
")",
")",
")",
"{",
"onDevelopmentModeSettings",
"(",
")",
";",
"}",
"// set configuration for deployment...",
"if",
"(",
"RuntimeConfigurationType",
".",
"DEPLOYMENT",
".",
"equals",
"(",
"this",
".",
"getConfigurationType",
"(",
")",
")",
")",
"{",
"onDeploymentModeSettings",
"(",
")",
";",
"}",
"}"
] |
Sets the application configurations.
|
[
"Sets",
"the",
"application",
"configurations",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/BaseWebApplication.java#L240-L256
|
145,835
|
geomajas/geomajas-project-client-gwt2
|
plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java
|
TileBasedLayerClient.createLayer
|
public TileBasedLayer createLayer(String id, TileConfiguration conf, final TileRenderer tileRenderer) {
return new AbstractTileBasedLayer(id, conf) {
@Override
public TileRenderer getTileRenderer() {
return tileRenderer;
}
};
}
|
java
|
public TileBasedLayer createLayer(String id, TileConfiguration conf, final TileRenderer tileRenderer) {
return new AbstractTileBasedLayer(id, conf) {
@Override
public TileRenderer getTileRenderer() {
return tileRenderer;
}
};
}
|
[
"public",
"TileBasedLayer",
"createLayer",
"(",
"String",
"id",
",",
"TileConfiguration",
"conf",
",",
"final",
"TileRenderer",
"tileRenderer",
")",
"{",
"return",
"new",
"AbstractTileBasedLayer",
"(",
"id",
",",
"conf",
")",
"{",
"@",
"Override",
"public",
"TileRenderer",
"getTileRenderer",
"(",
")",
"{",
"return",
"tileRenderer",
";",
"}",
"}",
";",
"}"
] |
Create a new tile based layer with an existing tile renderer.
@param id The unique ID of the layer.
@param conf The tile configuration.
@param tileRenderer The tile renderer to use.
@return A new tile based layer.
|
[
"Create",
"a",
"new",
"tile",
"based",
"layer",
"with",
"an",
"existing",
"tile",
"renderer",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java#L79-L86
|
145,836
|
geomajas/geomajas-project-client-gwt2
|
plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java
|
TileBasedLayerClient.createOsmMap
|
public MapConfiguration createOsmMap(int nrOfLevels) {
MapConfiguration configuration = new MapConfigurationImpl();
Bbox bounds = new Bbox(-OSM_HALF_WIDTH, -OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH);
configuration.setCrs(OSM_EPSG, CrsType.METRIC);
configuration.setHintValue(MapConfiguration.INITIAL_BOUNDS, bounds);
configuration.setMaxBounds(Bbox.ALL);
List<Double> resolutions = new ArrayList<Double>();
for (int i = 0; i < nrOfLevels; i++) {
resolutions.add(OSM_HALF_WIDTH / (OSM_TILE_SIZE * Math.pow(2, i - 1)));
}
configuration.setResolutions(resolutions);
return configuration;
}
|
java
|
public MapConfiguration createOsmMap(int nrOfLevels) {
MapConfiguration configuration = new MapConfigurationImpl();
Bbox bounds = new Bbox(-OSM_HALF_WIDTH, -OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH, 2 * OSM_HALF_WIDTH);
configuration.setCrs(OSM_EPSG, CrsType.METRIC);
configuration.setHintValue(MapConfiguration.INITIAL_BOUNDS, bounds);
configuration.setMaxBounds(Bbox.ALL);
List<Double> resolutions = new ArrayList<Double>();
for (int i = 0; i < nrOfLevels; i++) {
resolutions.add(OSM_HALF_WIDTH / (OSM_TILE_SIZE * Math.pow(2, i - 1)));
}
configuration.setResolutions(resolutions);
return configuration;
}
|
[
"public",
"MapConfiguration",
"createOsmMap",
"(",
"int",
"nrOfLevels",
")",
"{",
"MapConfiguration",
"configuration",
"=",
"new",
"MapConfigurationImpl",
"(",
")",
";",
"Bbox",
"bounds",
"=",
"new",
"Bbox",
"(",
"-",
"OSM_HALF_WIDTH",
",",
"-",
"OSM_HALF_WIDTH",
",",
"2",
"*",
"OSM_HALF_WIDTH",
",",
"2",
"*",
"OSM_HALF_WIDTH",
")",
";",
"configuration",
".",
"setCrs",
"(",
"OSM_EPSG",
",",
"CrsType",
".",
"METRIC",
")",
";",
"configuration",
".",
"setHintValue",
"(",
"MapConfiguration",
".",
"INITIAL_BOUNDS",
",",
"bounds",
")",
";",
"configuration",
".",
"setMaxBounds",
"(",
"Bbox",
".",
"ALL",
")",
";",
"List",
"<",
"Double",
">",
"resolutions",
"=",
"new",
"ArrayList",
"<",
"Double",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nrOfLevels",
";",
"i",
"++",
")",
"{",
"resolutions",
".",
"add",
"(",
"OSM_HALF_WIDTH",
"/",
"(",
"OSM_TILE_SIZE",
"*",
"Math",
".",
"pow",
"(",
"2",
",",
"i",
"-",
"1",
")",
")",
")",
";",
"}",
"configuration",
".",
"setResolutions",
"(",
"resolutions",
")",
";",
"return",
"configuration",
";",
"}"
] |
Create an OSM compliant map configuration with this number of zoom levels.
@param nrOfLevels
@return
|
[
"Create",
"an",
"OSM",
"compliant",
"map",
"configuration",
"with",
"this",
"number",
"of",
"zoom",
"levels",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java#L94-L106
|
145,837
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
|
CloudMe.getLongFromDom
|
private long getLongFromDom( Document dom, String tag )
{
return Long.parseLong( dom.getElementsByTagName( tag ).item( 0 ).getTextContent() );
}
|
java
|
private long getLongFromDom( Document dom, String tag )
{
return Long.parseLong( dom.getElementsByTagName( tag ).item( 0 ).getTextContent() );
}
|
[
"private",
"long",
"getLongFromDom",
"(",
"Document",
"dom",
",",
"String",
"tag",
")",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"dom",
".",
"getElementsByTagName",
"(",
"tag",
")",
".",
"item",
"(",
"0",
")",
".",
"getTextContent",
"(",
")",
")",
";",
"}"
] |
Retrieves a long value according to a Dom and a tag
@param dom
@param tag
@return long value
|
[
"Retrieves",
"a",
"long",
"value",
"according",
"to",
"a",
"Dom",
"and",
"a",
"tag"
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L181-L184
|
145,838
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
|
CloudMe.getBlobByName
|
private CMBlob getBlobByName( CMFolder cmFolder, String baseName )
throws ParseException
{
StringBuilder innerXml = new StringBuilder();
innerXml.append( "<folder id=" ).append( "'" ).append( cmFolder.getId() ).append( "'" ).append( "/>" )
.append( "<query>" )
.append( "\"" ).append( XmlUtils.escape( baseName ) ).append( "\"" )
.append( "</query>" )
.append( "<count>1</count>" );
HttpPost request = buildSoapRequest( "queryFolder", innerXml.toString() );
CResponse response = retryStrategy.invokeRetry( getApiRequestInvoker( request, cmFolder.getCPath() ) );
Document dom = response.asDom();
NodeList elementList = dom.getElementsByTagNameNS( "*", "entry" );
if ( elementList.getLength() == 0 ) {
return null;
}
CMBlob cmBlob = CMBlob.buildCMFile( cmFolder, ( Element ) elementList.item( 0 ) );
return cmBlob;
}
|
java
|
private CMBlob getBlobByName( CMFolder cmFolder, String baseName )
throws ParseException
{
StringBuilder innerXml = new StringBuilder();
innerXml.append( "<folder id=" ).append( "'" ).append( cmFolder.getId() ).append( "'" ).append( "/>" )
.append( "<query>" )
.append( "\"" ).append( XmlUtils.escape( baseName ) ).append( "\"" )
.append( "</query>" )
.append( "<count>1</count>" );
HttpPost request = buildSoapRequest( "queryFolder", innerXml.toString() );
CResponse response = retryStrategy.invokeRetry( getApiRequestInvoker( request, cmFolder.getCPath() ) );
Document dom = response.asDom();
NodeList elementList = dom.getElementsByTagNameNS( "*", "entry" );
if ( elementList.getLength() == 0 ) {
return null;
}
CMBlob cmBlob = CMBlob.buildCMFile( cmFolder, ( Element ) elementList.item( 0 ) );
return cmBlob;
}
|
[
"private",
"CMBlob",
"getBlobByName",
"(",
"CMFolder",
"cmFolder",
",",
"String",
"baseName",
")",
"throws",
"ParseException",
"{",
"StringBuilder",
"innerXml",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"innerXml",
".",
"append",
"(",
"\"<folder id=\"",
")",
".",
"append",
"(",
"\"'\"",
")",
".",
"append",
"(",
"cmFolder",
".",
"getId",
"(",
")",
")",
".",
"append",
"(",
"\"'\"",
")",
".",
"append",
"(",
"\"/>\"",
")",
".",
"append",
"(",
"\"<query>\"",
")",
".",
"append",
"(",
"\"\\\"\"",
")",
".",
"append",
"(",
"XmlUtils",
".",
"escape",
"(",
"baseName",
")",
")",
".",
"append",
"(",
"\"\\\"\"",
")",
".",
"append",
"(",
"\"</query>\"",
")",
".",
"append",
"(",
"\"<count>1</count>\"",
")",
";",
"HttpPost",
"request",
"=",
"buildSoapRequest",
"(",
"\"queryFolder\"",
",",
"innerXml",
".",
"toString",
"(",
")",
")",
";",
"CResponse",
"response",
"=",
"retryStrategy",
".",
"invokeRetry",
"(",
"getApiRequestInvoker",
"(",
"request",
",",
"cmFolder",
".",
"getCPath",
"(",
")",
")",
")",
";",
"Document",
"dom",
"=",
"response",
".",
"asDom",
"(",
")",
";",
"NodeList",
"elementList",
"=",
"dom",
".",
"getElementsByTagNameNS",
"(",
"\"*\"",
",",
"\"entry\"",
")",
";",
"if",
"(",
"elementList",
".",
"getLength",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"CMBlob",
"cmBlob",
"=",
"CMBlob",
".",
"buildCMFile",
"(",
"cmFolder",
",",
"(",
"Element",
")",
"elementList",
".",
"item",
"(",
"0",
")",
")",
";",
"return",
"cmBlob",
";",
"}"
] |
Gets a blob according to the parent folder id of the folder.
@param cmFolder parent folder
@param baseName base name of the file to find
@return the CloudMe blob, or null if not found
@throws ParseException
|
[
"Gets",
"a",
"blob",
"according",
"to",
"the",
"parent",
"folder",
"id",
"of",
"the",
"folder",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L219-L242
|
145,839
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
|
CloudMe.loadFoldersStructure
|
private CMFolder loadFoldersStructure()
{
CMFolder rootFolder = new CMFolder( getRootId(), "root" );
HttpPost request = buildSoapRequest( "getFolderXML", "<folder id='" + rootFolder.getId() + "'/>" );
CResponse response = retryStrategy.invokeRetry( getApiRequestInvoker( request, null ) );
Element rootElement = findRootFolderElement( response.asDom() );
scanFolderLevel( rootElement, rootFolder );
return rootFolder;
}
|
java
|
private CMFolder loadFoldersStructure()
{
CMFolder rootFolder = new CMFolder( getRootId(), "root" );
HttpPost request = buildSoapRequest( "getFolderXML", "<folder id='" + rootFolder.getId() + "'/>" );
CResponse response = retryStrategy.invokeRetry( getApiRequestInvoker( request, null ) );
Element rootElement = findRootFolderElement( response.asDom() );
scanFolderLevel( rootElement, rootFolder );
return rootFolder;
}
|
[
"private",
"CMFolder",
"loadFoldersStructure",
"(",
")",
"{",
"CMFolder",
"rootFolder",
"=",
"new",
"CMFolder",
"(",
"getRootId",
"(",
")",
",",
"\"root\"",
")",
";",
"HttpPost",
"request",
"=",
"buildSoapRequest",
"(",
"\"getFolderXML\"",
",",
"\"<folder id='\"",
"+",
"rootFolder",
".",
"getId",
"(",
")",
"+",
"\"'/>\"",
")",
";",
"CResponse",
"response",
"=",
"retryStrategy",
".",
"invokeRetry",
"(",
"getApiRequestInvoker",
"(",
"request",
",",
"null",
")",
")",
";",
"Element",
"rootElement",
"=",
"findRootFolderElement",
"(",
"response",
".",
"asDom",
"(",
")",
")",
";",
"scanFolderLevel",
"(",
"rootElement",
",",
"rootFolder",
")",
";",
"return",
"rootFolder",
";",
"}"
] |
Gets the folders tree structure beginning from the root folder.
@return the root folder
|
[
"Gets",
"the",
"folders",
"tree",
"structure",
"beginning",
"from",
"the",
"root",
"folder",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L249-L260
|
145,840
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
|
CloudMe.findRootFolderElement
|
private Element findRootFolderElement( Document dom )
{
NodeList list = dom.getElementsByTagNameNS( "*", "folder" );
final String localRootId = getRootId(); // cache it also in this method
for ( int i = 0; i < list.getLength(); i++ ) {
Element e = ( Element ) list.item( i );
if ( e.getAttribute( "id" ).equals( localRootId ) ) {
return e;
}
}
throw new CStorageException( "Could not find root folder with id=" + localRootId );
}
|
java
|
private Element findRootFolderElement( Document dom )
{
NodeList list = dom.getElementsByTagNameNS( "*", "folder" );
final String localRootId = getRootId(); // cache it also in this method
for ( int i = 0; i < list.getLength(); i++ ) {
Element e = ( Element ) list.item( i );
if ( e.getAttribute( "id" ).equals( localRootId ) ) {
return e;
}
}
throw new CStorageException( "Could not find root folder with id=" + localRootId );
}
|
[
"private",
"Element",
"findRootFolderElement",
"(",
"Document",
"dom",
")",
"{",
"NodeList",
"list",
"=",
"dom",
".",
"getElementsByTagNameNS",
"(",
"\"*\"",
",",
"\"folder\"",
")",
";",
"final",
"String",
"localRootId",
"=",
"getRootId",
"(",
")",
";",
"// cache it also in this method",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
".",
"getLength",
"(",
")",
";",
"i",
"++",
")",
"{",
"Element",
"e",
"=",
"(",
"Element",
")",
"list",
".",
"item",
"(",
"i",
")",
";",
"if",
"(",
"e",
".",
"getAttribute",
"(",
"\"id\"",
")",
".",
"equals",
"(",
"localRootId",
")",
")",
"{",
"return",
"e",
";",
"}",
"}",
"throw",
"new",
"CStorageException",
"(",
"\"Could not find root folder with id=\"",
"+",
"localRootId",
")",
";",
"}"
] |
Gets the element corresponding to the root folder in the DOM.
@param dom document where the root element is to be found
@return the element corresponding to the root folder
|
[
"Gets",
"the",
"element",
"corresponding",
"to",
"the",
"root",
"folder",
"in",
"the",
"DOM",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L268-L281
|
145,841
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
|
CloudMe.scanFolderLevel
|
private void scanFolderLevel( Element element, CMFolder cmFolder )
{
NodeList nodeList = element.getChildNodes();
for ( int i = 0; i < nodeList.getLength(); i++ ) {
Node currentNode = nodeList.item( i );
if ( currentNode.getNodeType() != Node.ELEMENT_NODE ) {
continue;
}
Element currentElement = ( Element ) currentNode;
if ( !currentElement.getLocalName().equals( "folder" ) ) {
continue;
}
//calls this method for all the children which is Element
CMFolder childFolder = cmFolder.addChild( currentElement.getAttribute( "id" ),
currentElement.getAttribute( "name" ) );
scanFolderLevel( currentElement, childFolder );
}
}
|
java
|
private void scanFolderLevel( Element element, CMFolder cmFolder )
{
NodeList nodeList = element.getChildNodes();
for ( int i = 0; i < nodeList.getLength(); i++ ) {
Node currentNode = nodeList.item( i );
if ( currentNode.getNodeType() != Node.ELEMENT_NODE ) {
continue;
}
Element currentElement = ( Element ) currentNode;
if ( !currentElement.getLocalName().equals( "folder" ) ) {
continue;
}
//calls this method for all the children which is Element
CMFolder childFolder = cmFolder.addChild( currentElement.getAttribute( "id" ),
currentElement.getAttribute( "name" ) );
scanFolderLevel( currentElement, childFolder );
}
}
|
[
"private",
"void",
"scanFolderLevel",
"(",
"Element",
"element",
",",
"CMFolder",
"cmFolder",
")",
"{",
"NodeList",
"nodeList",
"=",
"element",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nodeList",
".",
"getLength",
"(",
")",
";",
"i",
"++",
")",
"{",
"Node",
"currentNode",
"=",
"nodeList",
".",
"item",
"(",
"i",
")",
";",
"if",
"(",
"currentNode",
".",
"getNodeType",
"(",
")",
"!=",
"Node",
".",
"ELEMENT_NODE",
")",
"{",
"continue",
";",
"}",
"Element",
"currentElement",
"=",
"(",
"Element",
")",
"currentNode",
";",
"if",
"(",
"!",
"currentElement",
".",
"getLocalName",
"(",
")",
".",
"equals",
"(",
"\"folder\"",
")",
")",
"{",
"continue",
";",
"}",
"//calls this method for all the children which is Element",
"CMFolder",
"childFolder",
"=",
"cmFolder",
".",
"addChild",
"(",
"currentElement",
".",
"getAttribute",
"(",
"\"id\"",
")",
",",
"currentElement",
".",
"getAttribute",
"(",
"\"name\"",
")",
")",
";",
"scanFolderLevel",
"(",
"currentElement",
",",
"childFolder",
")",
";",
"}",
"}"
] |
Recursive method that parses folders XML and builds CMFolder structure.
@param element
@param cmFolder
|
[
"Recursive",
"method",
"that",
"parses",
"folders",
"XML",
"and",
"builds",
"CMFolder",
"structure",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L289-L312
|
145,842
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
|
CloudMe.createIntermediateFolders
|
private CMFolder createIntermediateFolders( CMFolder cmRoot, CPath cpath )
{
List<String> baseNames = cpath.split();
CMFolder currentFolder = cmRoot;
CMFolder childFolder = null;
boolean firstFolderCreation = true;
for ( String baseName : baseNames ) {
childFolder = currentFolder.getChildByName( baseName );
if ( childFolder == null ) {
// Intermediate folder does not exist : has to be created
if ( firstFolderCreation ) {
// This is the first intermediate folder to create:
// let's check that there is no blob with that name already existing
try {
CMBlob cmBlob = getBlobByName( currentFolder, baseName );
if ( cmBlob != null ) {
throw new CInvalidFileTypeException( cmBlob.getPath(), false );
}
} catch ( ParseException e ) {
throw new CStorageException( e.getMessage(), e );
}
firstFolderCreation = false;
}
childFolder = rawCreateFolder( currentFolder, baseName );
}
currentFolder = childFolder;
}
return childFolder;
}
|
java
|
private CMFolder createIntermediateFolders( CMFolder cmRoot, CPath cpath )
{
List<String> baseNames = cpath.split();
CMFolder currentFolder = cmRoot;
CMFolder childFolder = null;
boolean firstFolderCreation = true;
for ( String baseName : baseNames ) {
childFolder = currentFolder.getChildByName( baseName );
if ( childFolder == null ) {
// Intermediate folder does not exist : has to be created
if ( firstFolderCreation ) {
// This is the first intermediate folder to create:
// let's check that there is no blob with that name already existing
try {
CMBlob cmBlob = getBlobByName( currentFolder, baseName );
if ( cmBlob != null ) {
throw new CInvalidFileTypeException( cmBlob.getPath(), false );
}
} catch ( ParseException e ) {
throw new CStorageException( e.getMessage(), e );
}
firstFolderCreation = false;
}
childFolder = rawCreateFolder( currentFolder, baseName );
}
currentFolder = childFolder;
}
return childFolder;
}
|
[
"private",
"CMFolder",
"createIntermediateFolders",
"(",
"CMFolder",
"cmRoot",
",",
"CPath",
"cpath",
")",
"{",
"List",
"<",
"String",
">",
"baseNames",
"=",
"cpath",
".",
"split",
"(",
")",
";",
"CMFolder",
"currentFolder",
"=",
"cmRoot",
";",
"CMFolder",
"childFolder",
"=",
"null",
";",
"boolean",
"firstFolderCreation",
"=",
"true",
";",
"for",
"(",
"String",
"baseName",
":",
"baseNames",
")",
"{",
"childFolder",
"=",
"currentFolder",
".",
"getChildByName",
"(",
"baseName",
")",
";",
"if",
"(",
"childFolder",
"==",
"null",
")",
"{",
"// Intermediate folder does not exist : has to be created",
"if",
"(",
"firstFolderCreation",
")",
"{",
"// This is the first intermediate folder to create:",
"// let's check that there is no blob with that name already existing",
"try",
"{",
"CMBlob",
"cmBlob",
"=",
"getBlobByName",
"(",
"currentFolder",
",",
"baseName",
")",
";",
"if",
"(",
"cmBlob",
"!=",
"null",
")",
"{",
"throw",
"new",
"CInvalidFileTypeException",
"(",
"cmBlob",
".",
"getPath",
"(",
")",
",",
"false",
")",
";",
"}",
"}",
"catch",
"(",
"ParseException",
"e",
")",
"{",
"throw",
"new",
"CStorageException",
"(",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"firstFolderCreation",
"=",
"false",
";",
"}",
"childFolder",
"=",
"rawCreateFolder",
"(",
"currentFolder",
",",
"baseName",
")",
";",
"}",
"currentFolder",
"=",
"childFolder",
";",
"}",
"return",
"childFolder",
";",
"}"
] |
Creates folder with given path, with required intermediate folders.
@param cmRoot contains the whole folders structure
@param cpath path of folder to create
@return the createdfolder corresponding to targeted cpath
@throws CInvalidFileTypeException if a blob exists along that path
|
[
"Creates",
"folder",
"with",
"given",
"path",
"with",
"required",
"intermediate",
"folders",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L427-L465
|
145,843
|
geomajas/geomajas-project-client-gwt2
|
impl/src/main/java/org/geomajas/gwt2/client/service/DomService.java
|
DomService.setTop
|
public static void setTop(Element element, int top) {
if (Dom.isIE()) { // Limitation in IE8...
while (top > 1000000) {
top -= 1000000;
}
while (top < -1000000) {
top += 1000000;
}
}
Dom.setStyleAttribute(element, "top", top + "px");
}
|
java
|
public static void setTop(Element element, int top) {
if (Dom.isIE()) { // Limitation in IE8...
while (top > 1000000) {
top -= 1000000;
}
while (top < -1000000) {
top += 1000000;
}
}
Dom.setStyleAttribute(element, "top", top + "px");
}
|
[
"public",
"static",
"void",
"setTop",
"(",
"Element",
"element",
",",
"int",
"top",
")",
"{",
"if",
"(",
"Dom",
".",
"isIE",
"(",
")",
")",
"{",
"// Limitation in IE8...",
"while",
"(",
"top",
">",
"1000000",
")",
"{",
"top",
"-=",
"1000000",
";",
"}",
"while",
"(",
"top",
"<",
"-",
"1000000",
")",
"{",
"top",
"+=",
"1000000",
";",
"}",
"}",
"Dom",
".",
"setStyleAttribute",
"(",
"element",
",",
"\"top\"",
",",
"top",
"+",
"\"px\"",
")",
";",
"}"
] |
Apply the "top" style attribute on the given element.
@param element
The DOM element.
@param top
The top value.
|
[
"Apply",
"the",
"top",
"style",
"attribute",
"on",
"the",
"given",
"element",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/DomService.java#L48-L58
|
145,844
|
geomajas/geomajas-project-client-gwt2
|
impl/src/main/java/org/geomajas/gwt2/client/service/DomService.java
|
DomService.setLeft
|
public static void setLeft(Element element, int left) {
if (Dom.isIE()) { // Limitation in IE8...
while (left > 1000000) {
left -= 1000000;
}
while (left < -1000000) {
left += 1000000;
}
}
Dom.setStyleAttribute(element, "left", left + "px");
}
|
java
|
public static void setLeft(Element element, int left) {
if (Dom.isIE()) { // Limitation in IE8...
while (left > 1000000) {
left -= 1000000;
}
while (left < -1000000) {
left += 1000000;
}
}
Dom.setStyleAttribute(element, "left", left + "px");
}
|
[
"public",
"static",
"void",
"setLeft",
"(",
"Element",
"element",
",",
"int",
"left",
")",
"{",
"if",
"(",
"Dom",
".",
"isIE",
"(",
")",
")",
"{",
"// Limitation in IE8...",
"while",
"(",
"left",
">",
"1000000",
")",
"{",
"left",
"-=",
"1000000",
";",
"}",
"while",
"(",
"left",
"<",
"-",
"1000000",
")",
"{",
"left",
"+=",
"1000000",
";",
"}",
"}",
"Dom",
".",
"setStyleAttribute",
"(",
"element",
",",
"\"left\"",
",",
"left",
"+",
"\"px\"",
")",
";",
"}"
] |
Apply the "left" style attribute on the given element.
@param element
The DOM element.
@param left
The left value.
|
[
"Apply",
"the",
"left",
"style",
"attribute",
"on",
"the",
"given",
"element",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/DomService.java#L80-L90
|
145,845
|
astrapi69/jaulp-wicket
|
jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/AbstractModalWindow.java
|
AbstractModalWindow.init
|
private void init(final String title, final int initialWidth, final int initialHeight,
final Component component)
{
if (title != null)
{
setTitle(title);
}
setInitialWidth(initialWidth);
setInitialHeight(initialHeight);
setContent(component);
}
|
java
|
private void init(final String title, final int initialWidth, final int initialHeight,
final Component component)
{
if (title != null)
{
setTitle(title);
}
setInitialWidth(initialWidth);
setInitialHeight(initialHeight);
setContent(component);
}
|
[
"private",
"void",
"init",
"(",
"final",
"String",
"title",
",",
"final",
"int",
"initialWidth",
",",
"final",
"int",
"initialHeight",
",",
"final",
"Component",
"component",
")",
"{",
"if",
"(",
"title",
"!=",
"null",
")",
"{",
"setTitle",
"(",
"title",
")",
";",
"}",
"setInitialWidth",
"(",
"initialWidth",
")",
";",
"setInitialHeight",
"(",
"initialHeight",
")",
";",
"setContent",
"(",
"component",
")",
";",
"}"
] |
Initialize the given fields.
@param title
the title
@param initialWidth
the initial width
@param initialHeight
the initial height
@param component
the component
|
[
"Initialize",
"the",
"given",
"fields",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/AbstractModalWindow.java#L113-L123
|
145,846
|
OpenBEL/openbel-framework
|
org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/StatementGroup.java
|
StatementGroup.getAllAnnotations
|
public List<Annotation> getAllAnnotations() {
List<Annotation> ret = new ArrayList<Annotation>();
// Annotations within the annotation group
if (annotationGroup != null)
ret.addAll(annotationGroup.getAnnotations());
// Annotations within the statements
if (statements != null) {
for (final Statement stmt : statements) {
AnnotationGroup ag = stmt.getAnnotationGroup();
if (ag != null && hasItems(ag.getAnnotations())) {
ret.addAll(ag.getAnnotations());
}
}
}
// Annotations within nested statement groups
if (statementGroups != null) {
for (final StatementGroup sg : statementGroups)
ret.addAll(sg.getAllAnnotations());
}
return ret;
}
|
java
|
public List<Annotation> getAllAnnotations() {
List<Annotation> ret = new ArrayList<Annotation>();
// Annotations within the annotation group
if (annotationGroup != null)
ret.addAll(annotationGroup.getAnnotations());
// Annotations within the statements
if (statements != null) {
for (final Statement stmt : statements) {
AnnotationGroup ag = stmt.getAnnotationGroup();
if (ag != null && hasItems(ag.getAnnotations())) {
ret.addAll(ag.getAnnotations());
}
}
}
// Annotations within nested statement groups
if (statementGroups != null) {
for (final StatementGroup sg : statementGroups)
ret.addAll(sg.getAllAnnotations());
}
return ret;
}
|
[
"public",
"List",
"<",
"Annotation",
">",
"getAllAnnotations",
"(",
")",
"{",
"List",
"<",
"Annotation",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"Annotation",
">",
"(",
")",
";",
"// Annotations within the annotation group",
"if",
"(",
"annotationGroup",
"!=",
"null",
")",
"ret",
".",
"addAll",
"(",
"annotationGroup",
".",
"getAnnotations",
"(",
")",
")",
";",
"// Annotations within the statements",
"if",
"(",
"statements",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Statement",
"stmt",
":",
"statements",
")",
"{",
"AnnotationGroup",
"ag",
"=",
"stmt",
".",
"getAnnotationGroup",
"(",
")",
";",
"if",
"(",
"ag",
"!=",
"null",
"&&",
"hasItems",
"(",
"ag",
".",
"getAnnotations",
"(",
")",
")",
")",
"{",
"ret",
".",
"addAll",
"(",
"ag",
".",
"getAnnotations",
"(",
")",
")",
";",
"}",
"}",
"}",
"// Annotations within nested statement groups",
"if",
"(",
"statementGroups",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"StatementGroup",
"sg",
":",
"statementGroups",
")",
"ret",
".",
"addAll",
"(",
"sg",
".",
"getAllAnnotations",
"(",
")",
")",
";",
"}",
"return",
"ret",
";",
"}"
] |
Returns a list of all annotations contained by this statement group, its
statements, and nested statement groups.
@return List of annotations
|
[
"Returns",
"a",
"list",
"of",
"all",
"annotations",
"contained",
"by",
"this",
"statement",
"group",
"its",
"statements",
"and",
"nested",
"statement",
"groups",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/StatementGroup.java#L182-L206
|
145,847
|
OpenBEL/openbel-framework
|
org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/StatementGroup.java
|
StatementGroup.getAllParameters
|
public List<Parameter> getAllParameters() {
List<Parameter> ret = new ArrayList<Parameter>();
// Parameters within statements
if (statements != null) {
for (final Statement stmt : statements)
ret.addAll(stmt.getAllParameters());
}
// Parameters within nested statement groups
if (statementGroups != null) {
for (final StatementGroup sg : statementGroups)
ret.addAll(sg.getAllParameters());
}
return ret;
}
|
java
|
public List<Parameter> getAllParameters() {
List<Parameter> ret = new ArrayList<Parameter>();
// Parameters within statements
if (statements != null) {
for (final Statement stmt : statements)
ret.addAll(stmt.getAllParameters());
}
// Parameters within nested statement groups
if (statementGroups != null) {
for (final StatementGroup sg : statementGroups)
ret.addAll(sg.getAllParameters());
}
return ret;
}
|
[
"public",
"List",
"<",
"Parameter",
">",
"getAllParameters",
"(",
")",
"{",
"List",
"<",
"Parameter",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"Parameter",
">",
"(",
")",
";",
"// Parameters within statements",
"if",
"(",
"statements",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Statement",
"stmt",
":",
"statements",
")",
"ret",
".",
"addAll",
"(",
"stmt",
".",
"getAllParameters",
"(",
")",
")",
";",
"}",
"// Parameters within nested statement groups",
"if",
"(",
"statementGroups",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"StatementGroup",
"sg",
":",
"statementGroups",
")",
"ret",
".",
"addAll",
"(",
"sg",
".",
"getAllParameters",
"(",
")",
")",
";",
"}",
"return",
"ret",
";",
"}"
] |
Returns a list of all parameters contained by this statement group's
statements, and nested statement groups.
@return List of parameters
|
[
"Returns",
"a",
"list",
"of",
"all",
"parameters",
"contained",
"by",
"this",
"statement",
"group",
"s",
"statements",
"and",
"nested",
"statement",
"groups",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/StatementGroup.java#L214-L230
|
145,848
|
OpenBEL/openbel-framework
|
org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/StatementGroup.java
|
StatementGroup.getAllStatements
|
public List<Statement> getAllStatements() {
List<Statement> ret = new ArrayList<Statement>();
// Statements within this group
if (statements != null) {
ret.addAll(statements);
}
// Statements within nested statement groups
if (statementGroups != null) {
for (final StatementGroup sg : statementGroups)
ret.addAll(sg.getAllStatements());
}
return ret;
}
|
java
|
public List<Statement> getAllStatements() {
List<Statement> ret = new ArrayList<Statement>();
// Statements within this group
if (statements != null) {
ret.addAll(statements);
}
// Statements within nested statement groups
if (statementGroups != null) {
for (final StatementGroup sg : statementGroups)
ret.addAll(sg.getAllStatements());
}
return ret;
}
|
[
"public",
"List",
"<",
"Statement",
">",
"getAllStatements",
"(",
")",
"{",
"List",
"<",
"Statement",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"Statement",
">",
"(",
")",
";",
"// Statements within this group",
"if",
"(",
"statements",
"!=",
"null",
")",
"{",
"ret",
".",
"addAll",
"(",
"statements",
")",
";",
"}",
"// Statements within nested statement groups",
"if",
"(",
"statementGroups",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"StatementGroup",
"sg",
":",
"statementGroups",
")",
"ret",
".",
"addAll",
"(",
"sg",
".",
"getAllStatements",
"(",
")",
")",
";",
"}",
"return",
"ret",
";",
"}"
] |
Returns a list of all statements contained by this statement group's
statements, and nested statement groups.
@return List of statements
|
[
"Returns",
"a",
"list",
"of",
"all",
"statements",
"contained",
"by",
"this",
"statement",
"group",
"s",
"statements",
"and",
"nested",
"statement",
"groups",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/StatementGroup.java#L257-L272
|
145,849
|
geomajas/geomajas-project-client-gwt2
|
plugin/editing/server-extension/src/main/java/org/geomajas/plugin/editing/client/merge/GeometryMergeService.java
|
GeometryMergeService.removeGeometry
|
public void removeGeometry(Geometry geometry) throws GeometryMergeException {
if (!busy) {
throw new GeometryMergeException("Can't remove a geometry if no merging process is active.");
}
geometries.remove(geometry);
eventBus.fireEvent(new GeometryMergeRemovedEvent(geometry));
}
|
java
|
public void removeGeometry(Geometry geometry) throws GeometryMergeException {
if (!busy) {
throw new GeometryMergeException("Can't remove a geometry if no merging process is active.");
}
geometries.remove(geometry);
eventBus.fireEvent(new GeometryMergeRemovedEvent(geometry));
}
|
[
"public",
"void",
"removeGeometry",
"(",
"Geometry",
"geometry",
")",
"throws",
"GeometryMergeException",
"{",
"if",
"(",
"!",
"busy",
")",
"{",
"throw",
"new",
"GeometryMergeException",
"(",
"\"Can't remove a geometry if no merging process is active.\"",
")",
";",
"}",
"geometries",
".",
"remove",
"(",
"geometry",
")",
";",
"eventBus",
".",
"fireEvent",
"(",
"new",
"GeometryMergeRemovedEvent",
"(",
"geometry",
")",
")",
";",
"}"
] |
Remove a geometry from the merging list again.
@param geometry The geometry to remove.
@throws GeometryMergeException In case the merging process has not been started.
|
[
"Remove",
"a",
"geometry",
"from",
"the",
"merging",
"list",
"again",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/server-extension/src/main/java/org/geomajas/plugin/editing/client/merge/GeometryMergeService.java#L150-L156
|
145,850
|
geomajas/geomajas-project-client-gwt2
|
plugin/editing/server-extension/src/main/java/org/geomajas/plugin/editing/client/merge/GeometryMergeService.java
|
GeometryMergeService.clearGeometries
|
public void clearGeometries() throws GeometryMergeException {
if (!busy) {
throw new GeometryMergeException("Can't clear geometry list if no merging process is active.");
}
for (Geometry geometry : geometries) {
eventBus.fireEvent(new GeometryMergeRemovedEvent(geometry));
}
geometries.clear();
}
|
java
|
public void clearGeometries() throws GeometryMergeException {
if (!busy) {
throw new GeometryMergeException("Can't clear geometry list if no merging process is active.");
}
for (Geometry geometry : geometries) {
eventBus.fireEvent(new GeometryMergeRemovedEvent(geometry));
}
geometries.clear();
}
|
[
"public",
"void",
"clearGeometries",
"(",
")",
"throws",
"GeometryMergeException",
"{",
"if",
"(",
"!",
"busy",
")",
"{",
"throw",
"new",
"GeometryMergeException",
"(",
"\"Can't clear geometry list if no merging process is active.\"",
")",
";",
"}",
"for",
"(",
"Geometry",
"geometry",
":",
"geometries",
")",
"{",
"eventBus",
".",
"fireEvent",
"(",
"new",
"GeometryMergeRemovedEvent",
"(",
"geometry",
")",
")",
";",
"}",
"geometries",
".",
"clear",
"(",
")",
";",
"}"
] |
Clear the entire list of geometries for merging, basically resetting the process.
@throws GeometryMergeException In case the merging process has not been started.
|
[
"Clear",
"the",
"entire",
"list",
"of",
"geometries",
"for",
"merging",
"basically",
"resetting",
"the",
"process",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/server-extension/src/main/java/org/geomajas/plugin/editing/client/merge/GeometryMergeService.java#L163-L171
|
145,851
|
geomajas/geomajas-project-client-gwt2
|
plugin/editing/server-extension/src/main/java/org/geomajas/plugin/editing/client/merge/GeometryMergeService.java
|
GeometryMergeService.stop
|
public void stop(final GeometryFunction callback) throws GeometryMergeException {
if (!busy) {
throw new GeometryMergeException("Can't stop the merging process since it is not activated.");
}
if (callback == null) {
cancel();
return;
}
merge(new GeometryFunction() {
public void execute(Geometry geometry) {
callback.execute(geometry);
try {
clearGeometries();
} catch (GeometryMergeException e) {
}
busy = false;
eventBus.fireEvent(new GeometryMergeStopEvent(geometry));
}
});
}
|
java
|
public void stop(final GeometryFunction callback) throws GeometryMergeException {
if (!busy) {
throw new GeometryMergeException("Can't stop the merging process since it is not activated.");
}
if (callback == null) {
cancel();
return;
}
merge(new GeometryFunction() {
public void execute(Geometry geometry) {
callback.execute(geometry);
try {
clearGeometries();
} catch (GeometryMergeException e) {
}
busy = false;
eventBus.fireEvent(new GeometryMergeStopEvent(geometry));
}
});
}
|
[
"public",
"void",
"stop",
"(",
"final",
"GeometryFunction",
"callback",
")",
"throws",
"GeometryMergeException",
"{",
"if",
"(",
"!",
"busy",
")",
"{",
"throw",
"new",
"GeometryMergeException",
"(",
"\"Can't stop the merging process since it is not activated.\"",
")",
";",
"}",
"if",
"(",
"callback",
"==",
"null",
")",
"{",
"cancel",
"(",
")",
";",
"return",
";",
"}",
"merge",
"(",
"new",
"GeometryFunction",
"(",
")",
"{",
"public",
"void",
"execute",
"(",
"Geometry",
"geometry",
")",
"{",
"callback",
".",
"execute",
"(",
"geometry",
")",
";",
"try",
"{",
"clearGeometries",
"(",
")",
";",
"}",
"catch",
"(",
"GeometryMergeException",
"e",
")",
"{",
"}",
"busy",
"=",
"false",
";",
"eventBus",
".",
"fireEvent",
"(",
"new",
"GeometryMergeStopEvent",
"(",
"geometry",
")",
")",
";",
"}",
"}",
")",
";",
"}"
] |
End the merging process by effectively executing the merge operation and returning the result through a
call-back.
@param callback The call-back function that will receive the merged geometry.
@throws GeometryMergeException Thrown in case the merging process has not been started or some other merging
error.
|
[
"End",
"the",
"merging",
"process",
"by",
"effectively",
"executing",
"the",
"merge",
"operation",
"and",
"returning",
"the",
"result",
"through",
"a",
"call",
"-",
"back",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/server-extension/src/main/java/org/geomajas/plugin/editing/client/merge/GeometryMergeService.java#L181-L201
|
145,852
|
OpenBEL/openbel-framework
|
org.openbel.framework.common/src/main/java/org/openbel/framework/common/belscript/BELScriptExporter.java
|
BELScriptExporter.getEffectiveAnnotationMap
|
protected Map<String, List<String>> getEffectiveAnnotationMap(
Map<String, List<String>> inheritedAnnotationMap,
Map<String, List<String>> immediateAnnotationMap) {
//resolve effective annotations
Map<String, List<String>> effectiveAnnotationMap =
new HashMap<String, List<String>>();
//take all inherited annotation
effectiveAnnotationMap.putAll(inheritedAnnotationMap);
//add or override with annotations from the immediate entity
effectiveAnnotationMap.putAll(immediateAnnotationMap);
return effectiveAnnotationMap;
}
|
java
|
protected Map<String, List<String>> getEffectiveAnnotationMap(
Map<String, List<String>> inheritedAnnotationMap,
Map<String, List<String>> immediateAnnotationMap) {
//resolve effective annotations
Map<String, List<String>> effectiveAnnotationMap =
new HashMap<String, List<String>>();
//take all inherited annotation
effectiveAnnotationMap.putAll(inheritedAnnotationMap);
//add or override with annotations from the immediate entity
effectiveAnnotationMap.putAll(immediateAnnotationMap);
return effectiveAnnotationMap;
}
|
[
"protected",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getEffectiveAnnotationMap",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"inheritedAnnotationMap",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"immediateAnnotationMap",
")",
"{",
"//resolve effective annotations",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"effectiveAnnotationMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"(",
")",
";",
"//take all inherited annotation",
"effectiveAnnotationMap",
".",
"putAll",
"(",
"inheritedAnnotationMap",
")",
";",
"//add or override with annotations from the immediate entity",
"effectiveAnnotationMap",
".",
"putAll",
"(",
"immediateAnnotationMap",
")",
";",
"return",
"effectiveAnnotationMap",
";",
"}"
] |
Resolves the effective set of annotation by combining the inherited annotations with the immediate annotations associated
with the statement or statement group. If an annotation existing in both the inherited map and the immediate map, the immediate
annotation overrides the inherited.
@param inheritedAnnotationMap
@param immediateAnnotationMap
@return
|
[
"Resolves",
"the",
"effective",
"set",
"of",
"annotation",
"by",
"combining",
"the",
"inherited",
"annotations",
"with",
"the",
"immediate",
"annotations",
"associated",
"with",
"the",
"statement",
"or",
"statement",
"group",
".",
"If",
"an",
"annotation",
"existing",
"in",
"both",
"the",
"inherited",
"map",
"and",
"the",
"immediate",
"map",
"the",
"immediate",
"annotation",
"overrides",
"the",
"inherited",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/belscript/BELScriptExporter.java#L412-L423
|
145,853
|
OpenBEL/openbel-framework
|
org.openbel.framework.common/src/main/java/org/openbel/framework/common/belscript/BELScriptExporter.java
|
BELScriptExporter.writeAnnotations
|
protected void writeAnnotations(
Map<String, List<String>> effectiveAnnotationMap,
Map<String, List<String>> currentAnnotationMap, Writer writer)
throws IOException, BELRuntimeException {
List<Map.Entry<String, List<String>>> entriesToSet =
new ArrayList<Map.Entry<String, List<String>>>();
for (Map.Entry<String, List<String>> effEntry : effectiveAnnotationMap
.entrySet()) {
if (!currentAnnotationMap.containsKey(effEntry.getKey())) {
//set annotation that are unique to the effective map
entriesToSet.add(effEntry);
} else {
List<String> currentValues =
currentAnnotationMap.get(effEntry.getKey());
List<String> effectiveValues = effEntry.getValue();
if (currentValues == null || effectiveValues == null) {
throw new BELRuntimeException("Invalid annotation value",
ExitCode.PARSE_ERROR);
}
//set annotation that exist in both map, but values are different in effective map
//this will override the annotation
if (!currentValues.equals(effectiveValues)) {
entriesToSet.add(effEntry);
}
}
}
//remove annotations that are no longer in the effective set
currentAnnotationMap.keySet()
.removeAll(effectiveAnnotationMap.keySet());
if (!currentAnnotationMap.keySet().isEmpty() || !entriesToSet.isEmpty()) {
writer.write("\n");
//unset
for (String name : currentAnnotationMap.keySet()) {
unsetAnnotation(name, writer);
}
//set
for (Map.Entry<String, List<String>> entry : entriesToSet) {
setAnnotation(entry.getKey(), entry.getValue(), writer);
}
writer.write("\n");
}
//current annotation map now reflects the effective annotations
currentAnnotationMap.clear();
currentAnnotationMap.putAll(effectiveAnnotationMap);
}
|
java
|
protected void writeAnnotations(
Map<String, List<String>> effectiveAnnotationMap,
Map<String, List<String>> currentAnnotationMap, Writer writer)
throws IOException, BELRuntimeException {
List<Map.Entry<String, List<String>>> entriesToSet =
new ArrayList<Map.Entry<String, List<String>>>();
for (Map.Entry<String, List<String>> effEntry : effectiveAnnotationMap
.entrySet()) {
if (!currentAnnotationMap.containsKey(effEntry.getKey())) {
//set annotation that are unique to the effective map
entriesToSet.add(effEntry);
} else {
List<String> currentValues =
currentAnnotationMap.get(effEntry.getKey());
List<String> effectiveValues = effEntry.getValue();
if (currentValues == null || effectiveValues == null) {
throw new BELRuntimeException("Invalid annotation value",
ExitCode.PARSE_ERROR);
}
//set annotation that exist in both map, but values are different in effective map
//this will override the annotation
if (!currentValues.equals(effectiveValues)) {
entriesToSet.add(effEntry);
}
}
}
//remove annotations that are no longer in the effective set
currentAnnotationMap.keySet()
.removeAll(effectiveAnnotationMap.keySet());
if (!currentAnnotationMap.keySet().isEmpty() || !entriesToSet.isEmpty()) {
writer.write("\n");
//unset
for (String name : currentAnnotationMap.keySet()) {
unsetAnnotation(name, writer);
}
//set
for (Map.Entry<String, List<String>> entry : entriesToSet) {
setAnnotation(entry.getKey(), entry.getValue(), writer);
}
writer.write("\n");
}
//current annotation map now reflects the effective annotations
currentAnnotationMap.clear();
currentAnnotationMap.putAll(effectiveAnnotationMap);
}
|
[
"protected",
"void",
"writeAnnotations",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"effectiveAnnotationMap",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"currentAnnotationMap",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
",",
"BELRuntimeException",
"{",
"List",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
">",
"entriesToSet",
"=",
"new",
"ArrayList",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
">",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"effEntry",
":",
"effectiveAnnotationMap",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"!",
"currentAnnotationMap",
".",
"containsKey",
"(",
"effEntry",
".",
"getKey",
"(",
")",
")",
")",
"{",
"//set annotation that are unique to the effective map",
"entriesToSet",
".",
"add",
"(",
"effEntry",
")",
";",
"}",
"else",
"{",
"List",
"<",
"String",
">",
"currentValues",
"=",
"currentAnnotationMap",
".",
"get",
"(",
"effEntry",
".",
"getKey",
"(",
")",
")",
";",
"List",
"<",
"String",
">",
"effectiveValues",
"=",
"effEntry",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"currentValues",
"==",
"null",
"||",
"effectiveValues",
"==",
"null",
")",
"{",
"throw",
"new",
"BELRuntimeException",
"(",
"\"Invalid annotation value\"",
",",
"ExitCode",
".",
"PARSE_ERROR",
")",
";",
"}",
"//set annotation that exist in both map, but values are different in effective map",
"//this will override the annotation",
"if",
"(",
"!",
"currentValues",
".",
"equals",
"(",
"effectiveValues",
")",
")",
"{",
"entriesToSet",
".",
"add",
"(",
"effEntry",
")",
";",
"}",
"}",
"}",
"//remove annotations that are no longer in the effective set",
"currentAnnotationMap",
".",
"keySet",
"(",
")",
".",
"removeAll",
"(",
"effectiveAnnotationMap",
".",
"keySet",
"(",
")",
")",
";",
"if",
"(",
"!",
"currentAnnotationMap",
".",
"keySet",
"(",
")",
".",
"isEmpty",
"(",
")",
"||",
"!",
"entriesToSet",
".",
"isEmpty",
"(",
")",
")",
"{",
"writer",
".",
"write",
"(",
"\"\\n\"",
")",
";",
"//unset",
"for",
"(",
"String",
"name",
":",
"currentAnnotationMap",
".",
"keySet",
"(",
")",
")",
"{",
"unsetAnnotation",
"(",
"name",
",",
"writer",
")",
";",
"}",
"//set",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"entry",
":",
"entriesToSet",
")",
"{",
"setAnnotation",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
",",
"writer",
")",
";",
"}",
"writer",
".",
"write",
"(",
"\"\\n\"",
")",
";",
"}",
"//current annotation map now reflects the effective annotations",
"currentAnnotationMap",
".",
"clear",
"(",
")",
";",
"currentAnnotationMap",
".",
"putAll",
"(",
"effectiveAnnotationMap",
")",
";",
"}"
] |
Writes a series of BEL script control statements via the writer to match current annotations to the effective
annotations. At the end of this function, the content of currentAnnotationMap will be equivalent to the
content of effectiveAnnotationMap.
@param effectiveAnnotationMap
@param currentAnnotationMap
@param writer
@throws IOException
|
[
"Writes",
"a",
"series",
"of",
"BEL",
"script",
"control",
"statements",
"via",
"the",
"writer",
"to",
"match",
"current",
"annotations",
"to",
"the",
"effective",
"annotations",
".",
"At",
"the",
"end",
"of",
"this",
"function",
"the",
"content",
"of",
"currentAnnotationMap",
"will",
"be",
"equivalent",
"to",
"the",
"content",
"of",
"effectiveAnnotationMap",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/belscript/BELScriptExporter.java#L435-L482
|
145,854
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/resources/SequenceModelResource.java
|
SequenceModelResource.seqToSpans
|
public Span[] seqToSpans(final String[] tokens) {
final Span[] origSpans = this.sequenceLabeler.tag(tokens);
final Span[] seqSpans = SequenceLabelerME.dropOverlappingSpans(origSpans);
return seqSpans;
}
|
java
|
public Span[] seqToSpans(final String[] tokens) {
final Span[] origSpans = this.sequenceLabeler.tag(tokens);
final Span[] seqSpans = SequenceLabelerME.dropOverlappingSpans(origSpans);
return seqSpans;
}
|
[
"public",
"Span",
"[",
"]",
"seqToSpans",
"(",
"final",
"String",
"[",
"]",
"tokens",
")",
"{",
"final",
"Span",
"[",
"]",
"origSpans",
"=",
"this",
".",
"sequenceLabeler",
".",
"tag",
"(",
"tokens",
")",
";",
"final",
"Span",
"[",
"]",
"seqSpans",
"=",
"SequenceLabelerME",
".",
"dropOverlappingSpans",
"(",
"origSpans",
")",
";",
"return",
"seqSpans",
";",
"}"
] |
Tag the current sentence.
@param tokens
the current sentence
@return the array of span sequences
|
[
"Tag",
"the",
"current",
"sentence",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/resources/SequenceModelResource.java#L90-L94
|
145,855
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/resources/SequenceModelResource.java
|
SequenceModelResource.lemmatize
|
public String[] lemmatize(final String[] tokens) {
final Span[] origSpans = this.sequenceLabeler.tag(tokens);
final Span[] seqSpans = SequenceLabelerME.dropOverlappingSpans(origSpans);
// TODO work with Spans only
final String[] decodedLemmas = StringUtils.decodeLemmas(tokens, seqSpans);
return decodedLemmas;
}
|
java
|
public String[] lemmatize(final String[] tokens) {
final Span[] origSpans = this.sequenceLabeler.tag(tokens);
final Span[] seqSpans = SequenceLabelerME.dropOverlappingSpans(origSpans);
// TODO work with Spans only
final String[] decodedLemmas = StringUtils.decodeLemmas(tokens, seqSpans);
return decodedLemmas;
}
|
[
"public",
"String",
"[",
"]",
"lemmatize",
"(",
"final",
"String",
"[",
"]",
"tokens",
")",
"{",
"final",
"Span",
"[",
"]",
"origSpans",
"=",
"this",
".",
"sequenceLabeler",
".",
"tag",
"(",
"tokens",
")",
";",
"final",
"Span",
"[",
"]",
"seqSpans",
"=",
"SequenceLabelerME",
".",
"dropOverlappingSpans",
"(",
"origSpans",
")",
";",
"// TODO work with Spans only",
"final",
"String",
"[",
"]",
"decodedLemmas",
"=",
"StringUtils",
".",
"decodeLemmas",
"(",
"tokens",
",",
"seqSpans",
")",
";",
"return",
"decodedLemmas",
";",
"}"
] |
Lemmatize the current sentence.
@param tokens
the current sentence
@return the array of span sequences
|
[
"Lemmatize",
"the",
"current",
"sentence",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/resources/SequenceModelResource.java#L103-L109
|
145,856
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/resources/SequenceModelResource.java
|
SequenceModelResource.serialize
|
public void serialize(final OutputStream out) throws IOException {
final Writer writer = new BufferedWriter(new OutputStreamWriter(out));
this.seqModel.serialize(out);
writer.flush();
}
|
java
|
public void serialize(final OutputStream out) throws IOException {
final Writer writer = new BufferedWriter(new OutputStreamWriter(out));
this.seqModel.serialize(out);
writer.flush();
}
|
[
"public",
"void",
"serialize",
"(",
"final",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"final",
"Writer",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"out",
")",
")",
";",
"this",
".",
"seqModel",
".",
"serialize",
"(",
"out",
")",
";",
"writer",
".",
"flush",
"(",
")",
";",
"}"
] |
Serialize this model into the overall Sequence model.
@param out
the output stream
@throws IOException
io exception
|
[
"Serialize",
"this",
"model",
"into",
"the",
"overall",
"Sequence",
"model",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/resources/SequenceModelResource.java#L119-L123
|
145,857
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logWarn
|
public static void logWarn(String message) {
GWT.log("WARNING: " + message);
LOG.warning(message);
logServer(LEVEL_WARN, message, null);
}
|
java
|
public static void logWarn(String message) {
GWT.log("WARNING: " + message);
LOG.warning(message);
logServer(LEVEL_WARN, message, null);
}
|
[
"public",
"static",
"void",
"logWarn",
"(",
"String",
"message",
")",
"{",
"GWT",
".",
"log",
"(",
"\"WARNING: \"",
"+",
"message",
")",
";",
"LOG",
".",
"warning",
"(",
"message",
")",
";",
"logServer",
"(",
"LEVEL_WARN",
",",
"message",
",",
"null",
")",
";",
"}"
] |
Log a warning.
@param message message
|
[
"Log",
"a",
"warning",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L76-L80
|
145,858
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logError
|
public static void logError(String message) {
GWT.log("ERROR: " + message);
LOG.severe(message);
logServer(LEVEL_ERROR, message, null);
}
|
java
|
public static void logError(String message) {
GWT.log("ERROR: " + message);
LOG.severe(message);
logServer(LEVEL_ERROR, message, null);
}
|
[
"public",
"static",
"void",
"logError",
"(",
"String",
"message",
")",
"{",
"GWT",
".",
"log",
"(",
"\"ERROR: \"",
"+",
"message",
")",
";",
"LOG",
".",
"severe",
"(",
"message",
")",
";",
"logServer",
"(",
"LEVEL_ERROR",
",",
"message",
",",
"null",
")",
";",
"}"
] |
Log an error.
@param message message
|
[
"Log",
"an",
"error",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L87-L91
|
145,859
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logDebug
|
public static void logDebug(String message, Throwable t) {
logDebug(message + SEP + getMessage(t));
}
|
java
|
public static void logDebug(String message, Throwable t) {
logDebug(message + SEP + getMessage(t));
}
|
[
"public",
"static",
"void",
"logDebug",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"logDebug",
"(",
"message",
"+",
"SEP",
"+",
"getMessage",
"(",
"t",
")",
")",
";",
"}"
] |
Debug logging with cause.
@param message message
@param t cause
|
[
"Debug",
"logging",
"with",
"cause",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L99-L101
|
145,860
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logInfo
|
public static void logInfo(String message, Throwable t) {
logInfo(message + SEP + getMessage(t));
}
|
java
|
public static void logInfo(String message, Throwable t) {
logInfo(message + SEP + getMessage(t));
}
|
[
"public",
"static",
"void",
"logInfo",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"logInfo",
"(",
"message",
"+",
"SEP",
"+",
"getMessage",
"(",
"t",
")",
")",
";",
"}"
] |
Info logging with cause.
@param message message
@param t cause
|
[
"Info",
"logging",
"with",
"cause",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L109-L111
|
145,861
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logWarn
|
public static void logWarn(String message, Throwable t) {
logWarn(message + SEP + getMessage(t));
}
|
java
|
public static void logWarn(String message, Throwable t) {
logWarn(message + SEP + getMessage(t));
}
|
[
"public",
"static",
"void",
"logWarn",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"logWarn",
"(",
"message",
"+",
"SEP",
"+",
"getMessage",
"(",
"t",
")",
")",
";",
"}"
] |
Warning logging with cause.
@param message message
@param t cause
|
[
"Warning",
"logging",
"with",
"cause",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L119-L121
|
145,862
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logError
|
public static void logError(String message, Throwable t) {
logError(message + SEP + getMessage(t));
}
|
java
|
public static void logError(String message, Throwable t) {
logError(message + SEP + getMessage(t));
}
|
[
"public",
"static",
"void",
"logError",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"logError",
"(",
"message",
"+",
"SEP",
"+",
"getMessage",
"(",
"t",
")",
")",
";",
"}"
] |
Error logging with cause.
@param message message
@param t cause
|
[
"Error",
"logging",
"with",
"cause",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L129-L131
|
145,863
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
|
Log.logServer
|
public static void logServer(int logLevel, String message, Throwable throwable) {
String logMessage = message;
if (null == logMessage) {
logMessage = "";
}
if (null != throwable) {
logMessage += "\n" + getMessage(throwable);
}
LogRequest logRequest = new LogRequest();
logRequest.setLevel(logLevel);
logRequest.setStatement(logMessage);
GwtCommand command = new GwtCommand(LogRequest.COMMAND);
command.setCommandRequest(logRequest);
Deferred deferred = new Deferred();
deferred.setLogCommunicationExceptions(false);
GwtCommandDispatcher.getInstance().execute(command, deferred);
}
|
java
|
public static void logServer(int logLevel, String message, Throwable throwable) {
String logMessage = message;
if (null == logMessage) {
logMessage = "";
}
if (null != throwable) {
logMessage += "\n" + getMessage(throwable);
}
LogRequest logRequest = new LogRequest();
logRequest.setLevel(logLevel);
logRequest.setStatement(logMessage);
GwtCommand command = new GwtCommand(LogRequest.COMMAND);
command.setCommandRequest(logRequest);
Deferred deferred = new Deferred();
deferred.setLogCommunicationExceptions(false);
GwtCommandDispatcher.getInstance().execute(command, deferred);
}
|
[
"public",
"static",
"void",
"logServer",
"(",
"int",
"logLevel",
",",
"String",
"message",
",",
"Throwable",
"throwable",
")",
"{",
"String",
"logMessage",
"=",
"message",
";",
"if",
"(",
"null",
"==",
"logMessage",
")",
"{",
"logMessage",
"=",
"\"\"",
";",
"}",
"if",
"(",
"null",
"!=",
"throwable",
")",
"{",
"logMessage",
"+=",
"\"\\n\"",
"+",
"getMessage",
"(",
"throwable",
")",
";",
"}",
"LogRequest",
"logRequest",
"=",
"new",
"LogRequest",
"(",
")",
";",
"logRequest",
".",
"setLevel",
"(",
"logLevel",
")",
";",
"logRequest",
".",
"setStatement",
"(",
"logMessage",
")",
";",
"GwtCommand",
"command",
"=",
"new",
"GwtCommand",
"(",
"LogRequest",
".",
"COMMAND",
")",
";",
"command",
".",
"setCommandRequest",
"(",
"logRequest",
")",
";",
"Deferred",
"deferred",
"=",
"new",
"Deferred",
"(",
")",
";",
"deferred",
".",
"setLogCommunicationExceptions",
"(",
"false",
")",
";",
"GwtCommandDispatcher",
".",
"getInstance",
"(",
")",
".",
"execute",
"(",
"command",
",",
"deferred",
")",
";",
"}"
] |
Log a message in the server log.
@param logLevel log level
@param message message to log
@param throwable exception to include in message
|
[
"Log",
"a",
"message",
"in",
"the",
"server",
"log",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L179-L195
|
145,864
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/controller/AbstractController.java
|
AbstractController.onMapTouchStart
|
@Override
public void onMapTouchStart(TouchEvent<?> event) {
onDown(event);
event.stopPropagation();
event.preventDefault();
}
|
java
|
@Override
public void onMapTouchStart(TouchEvent<?> event) {
onDown(event);
event.stopPropagation();
event.preventDefault();
}
|
[
"@",
"Override",
"public",
"void",
"onMapTouchStart",
"(",
"TouchEvent",
"<",
"?",
">",
"event",
")",
"{",
"onDown",
"(",
"event",
")",
";",
"event",
".",
"stopPropagation",
"(",
")",
";",
"event",
".",
"preventDefault",
"(",
")",
";",
"}"
] |
Forward as mouse down and stop the event.
@since 2.4.0
|
[
"Forward",
"as",
"mouse",
"down",
"and",
"stop",
"the",
"event",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/controller/AbstractController.java#L151-L156
|
145,865
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/controller/AbstractController.java
|
AbstractController.onMapTouchMove
|
@Override
public void onMapTouchMove(TouchEvent<?> event) {
onDrag(event);
event.stopPropagation();
event.preventDefault();
}
|
java
|
@Override
public void onMapTouchMove(TouchEvent<?> event) {
onDrag(event);
event.stopPropagation();
event.preventDefault();
}
|
[
"@",
"Override",
"public",
"void",
"onMapTouchMove",
"(",
"TouchEvent",
"<",
"?",
">",
"event",
")",
"{",
"onDrag",
"(",
"event",
")",
";",
"event",
".",
"stopPropagation",
"(",
")",
";",
"event",
".",
"preventDefault",
"(",
")",
";",
"}"
] |
Forward as mouse move and stop the event.
@since 2.4.0
|
[
"Forward",
"as",
"mouse",
"move",
"and",
"stop",
"the",
"event",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/controller/AbstractController.java#L162-L167
|
145,866
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/request/CResponse.java
|
CResponse.asString
|
public String asString()
{
try {
return EntityUtils.toString( entity, PcsUtils.UTF8.name() );
} catch ( IOException e ) {
throw new CStorageException( "Can't get string from HTTP entity", e );
}
}
|
java
|
public String asString()
{
try {
return EntityUtils.toString( entity, PcsUtils.UTF8.name() );
} catch ( IOException e ) {
throw new CStorageException( "Can't get string from HTTP entity", e );
}
}
|
[
"public",
"String",
"asString",
"(",
")",
"{",
"try",
"{",
"return",
"EntityUtils",
".",
"toString",
"(",
"entity",
",",
"PcsUtils",
".",
"UTF8",
".",
"name",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"CStorageException",
"(",
"\"Can't get string from HTTP entity\"",
",",
"e",
")",
";",
"}",
"}"
] |
Extracts string from input stream
@return Get the response as a String
|
[
"Extracts",
"string",
"from",
"input",
"stream"
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/CResponse.java#L112-L119
|
145,867
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/request/CResponse.java
|
CResponse.asJSONObject
|
public JSONObject asJSONObject()
{
if ( entity == null ) {
return null;
}
String str = asString();
try {
return new JSONObject( str );
} catch ( JSONException ex ) {
throw new CStorageException( "Error parsing the JSON response: " + str, ex );
}
}
|
java
|
public JSONObject asJSONObject()
{
if ( entity == null ) {
return null;
}
String str = asString();
try {
return new JSONObject( str );
} catch ( JSONException ex ) {
throw new CStorageException( "Error parsing the JSON response: " + str, ex );
}
}
|
[
"public",
"JSONObject",
"asJSONObject",
"(",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"str",
"=",
"asString",
"(",
")",
";",
"try",
"{",
"return",
"new",
"JSONObject",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"JSONException",
"ex",
")",
"{",
"throw",
"new",
"CStorageException",
"(",
"\"Error parsing the JSON response: \"",
"+",
"str",
",",
"ex",
")",
";",
"}",
"}"
] |
Get the response as a json object
@return The json value
|
[
"Get",
"the",
"response",
"as",
"a",
"json",
"object"
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/CResponse.java#L126-L137
|
145,868
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/request/CResponse.java
|
CResponse.asJSONArray
|
public JSONArray asJSONArray()
{
if ( entity == null ) {
return null;
}
String str = asString();
try {
return new JSONArray( str );
} catch ( JSONException ex ) {
throw new CStorageException( "Error parsing the JSON response: " + str, ex );
}
}
|
java
|
public JSONArray asJSONArray()
{
if ( entity == null ) {
return null;
}
String str = asString();
try {
return new JSONArray( str );
} catch ( JSONException ex ) {
throw new CStorageException( "Error parsing the JSON response: " + str, ex );
}
}
|
[
"public",
"JSONArray",
"asJSONArray",
"(",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"str",
"=",
"asString",
"(",
")",
";",
"try",
"{",
"return",
"new",
"JSONArray",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"JSONException",
"ex",
")",
"{",
"throw",
"new",
"CStorageException",
"(",
"\"Error parsing the JSON response: \"",
"+",
"str",
",",
"ex",
")",
";",
"}",
"}"
] |
Get the response as a json array
@return The json value
|
[
"Get",
"the",
"response",
"as",
"a",
"json",
"array"
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/CResponse.java#L158-L169
|
145,869
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/request/CResponse.java
|
CResponse.openStream
|
public InputStream openStream()
{
if ( entity == null ) {
return null;
}
try {
return entity.getContent();
} catch ( IOException ex ) {
throw new CStorageException( "Can't open stream", ex );
}
}
|
java
|
public InputStream openStream()
{
if ( entity == null ) {
return null;
}
try {
return entity.getContent();
} catch ( IOException ex ) {
throw new CStorageException( "Can't open stream", ex );
}
}
|
[
"public",
"InputStream",
"openStream",
"(",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"entity",
".",
"getContent",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"throw",
"new",
"CStorageException",
"(",
"\"Can't open stream\"",
",",
"ex",
")",
";",
"}",
"}"
] |
Open a raw stream on the response body.
@return The stream
|
[
"Open",
"a",
"raw",
"stream",
"on",
"the",
"response",
"body",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/CResponse.java#L198-L209
|
145,870
|
geomajas/geomajas-project-client-gwt2
|
plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/layer/WmsLayerConfiguration.java
|
WmsLayerConfiguration.setStyles
|
public void setStyles(String styles) {
this.styles = styles;
if (eventBus != null && parentLayer != null) {
eventBus.fireEvent(new LayerStyleChangedEvent(parentLayer));
}
}
|
java
|
public void setStyles(String styles) {
this.styles = styles;
if (eventBus != null && parentLayer != null) {
eventBus.fireEvent(new LayerStyleChangedEvent(parentLayer));
}
}
|
[
"public",
"void",
"setStyles",
"(",
"String",
"styles",
")",
"{",
"this",
".",
"styles",
"=",
"styles",
";",
"if",
"(",
"eventBus",
"!=",
"null",
"&&",
"parentLayer",
"!=",
"null",
")",
"{",
"eventBus",
".",
"fireEvent",
"(",
"new",
"LayerStyleChangedEvent",
"(",
"parentLayer",
")",
")",
";",
"}",
"}"
] |
Set the styles parameter to be used in the GetMap requests.
@param styles The styles parameter to be used in the GetMap requests.
|
[
"Set",
"the",
"styles",
"parameter",
"to",
"be",
"used",
"in",
"the",
"GetMap",
"requests",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/layer/WmsLayerConfiguration.java#L140-L145
|
145,871
|
astrapi69/jaulp-wicket
|
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/radio/AjaxRadio.java
|
AjaxRadio.newAjaxEventBehavior
|
protected AjaxEventBehavior newAjaxEventBehavior(final String event)
{
return new AjaxEventBehavior(event)
{
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(final AjaxRequestTarget target)
{
final RadioGroup<T> radioGroup = getGroup();
radioGroup.processInput();
onClick(target);
}
@Override
protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
{
super.updateAjaxAttributes(attributes);
AjaxRadio.this.updateAjaxAttributes(attributes);
}
};
}
|
java
|
protected AjaxEventBehavior newAjaxEventBehavior(final String event)
{
return new AjaxEventBehavior(event)
{
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(final AjaxRequestTarget target)
{
final RadioGroup<T> radioGroup = getGroup();
radioGroup.processInput();
onClick(target);
}
@Override
protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
{
super.updateAjaxAttributes(attributes);
AjaxRadio.this.updateAjaxAttributes(attributes);
}
};
}
|
[
"protected",
"AjaxEventBehavior",
"newAjaxEventBehavior",
"(",
"final",
"String",
"event",
")",
"{",
"return",
"new",
"AjaxEventBehavior",
"(",
"event",
")",
"{",
"private",
"static",
"final",
"long",
"serialVersionUID",
"=",
"1L",
";",
"@",
"Override",
"protected",
"void",
"onEvent",
"(",
"final",
"AjaxRequestTarget",
"target",
")",
"{",
"final",
"RadioGroup",
"<",
"T",
">",
"radioGroup",
"=",
"getGroup",
"(",
")",
";",
"radioGroup",
".",
"processInput",
"(",
")",
";",
"onClick",
"(",
"target",
")",
";",
"}",
"@",
"Override",
"protected",
"void",
"updateAjaxAttributes",
"(",
"final",
"AjaxRequestAttributes",
"attributes",
")",
"{",
"super",
".",
"updateAjaxAttributes",
"(",
"attributes",
")",
";",
"AjaxRadio",
".",
"this",
".",
"updateAjaxAttributes",
"(",
"attributes",
")",
";",
"}",
"}",
";",
"}"
] |
New ajax event behavior.
@param event
the name of the default event on which this link will listen to
@return the ajax behavior which will be executed when the user clicks the link
|
[
"New",
"ajax",
"event",
"behavior",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/radio/AjaxRadio.java#L110-L131
|
145,872
|
OpenBEL/openbel-framework
|
org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/utils/Converter.java
|
Converter.convert
|
public static org.openbel.framework.common.model.Namespace convert(
final Namespace ws) {
return new org.openbel.framework.common.model.Namespace(
ws.getPrefix(), ws.getResourceLocation());
}
|
java
|
public static org.openbel.framework.common.model.Namespace convert(
final Namespace ws) {
return new org.openbel.framework.common.model.Namespace(
ws.getPrefix(), ws.getResourceLocation());
}
|
[
"public",
"static",
"org",
".",
"openbel",
".",
"framework",
".",
"common",
".",
"model",
".",
"Namespace",
"convert",
"(",
"final",
"Namespace",
"ws",
")",
"{",
"return",
"new",
"org",
".",
"openbel",
".",
"framework",
".",
"common",
".",
"model",
".",
"Namespace",
"(",
"ws",
".",
"getPrefix",
"(",
")",
",",
"ws",
".",
"getResourceLocation",
"(",
")",
")",
";",
"}"
] |
Convert a WS namespace to a common namespace
@param ns
@return
|
[
"Convert",
"a",
"WS",
"namespace",
"to",
"a",
"common",
"namespace"
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/utils/Converter.java#L907-L911
|
145,873
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
|
GwtCommandDispatcher.afterLogin
|
private void afterLogin(GwtCommand command, Deferred deferred) {
String token = notNull(command.getUserToken());
if (!afterLoginCommands.containsKey(token)) {
afterLoginCommands.put(token, new ArrayList<RetryCommand>());
}
afterLoginCommands.get(token).add(new RetryCommand(command, deferred));
}
|
java
|
private void afterLogin(GwtCommand command, Deferred deferred) {
String token = notNull(command.getUserToken());
if (!afterLoginCommands.containsKey(token)) {
afterLoginCommands.put(token, new ArrayList<RetryCommand>());
}
afterLoginCommands.get(token).add(new RetryCommand(command, deferred));
}
|
[
"private",
"void",
"afterLogin",
"(",
"GwtCommand",
"command",
",",
"Deferred",
"deferred",
")",
"{",
"String",
"token",
"=",
"notNull",
"(",
"command",
".",
"getUserToken",
"(",
")",
")",
";",
"if",
"(",
"!",
"afterLoginCommands",
".",
"containsKey",
"(",
"token",
")",
")",
"{",
"afterLoginCommands",
".",
"put",
"(",
"token",
",",
"new",
"ArrayList",
"<",
"RetryCommand",
">",
"(",
")",
")",
";",
"}",
"afterLoginCommands",
".",
"get",
"(",
"token",
")",
".",
"add",
"(",
"new",
"RetryCommand",
"(",
"command",
",",
"deferred",
")",
")",
";",
"}"
] |
Add a command and it's callbacks to the list of commands to retry after login.
@param command
command to retry
@param deferred
callbacks for the command
|
[
"Add",
"a",
"command",
"and",
"it",
"s",
"callbacks",
"to",
"the",
"list",
"of",
"commands",
"to",
"retry",
"after",
"login",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L297-L303
|
145,874
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
|
GwtCommandDispatcher.setServiceEndPointUrl
|
public void setServiceEndPointUrl(String url) {
ServiceDefTarget endpoint = (ServiceDefTarget) service;
endpoint.setServiceEntryPoint(url);
}
|
java
|
public void setServiceEndPointUrl(String url) {
ServiceDefTarget endpoint = (ServiceDefTarget) service;
endpoint.setServiceEntryPoint(url);
}
|
[
"public",
"void",
"setServiceEndPointUrl",
"(",
"String",
"url",
")",
"{",
"ServiceDefTarget",
"endpoint",
"=",
"(",
"ServiceDefTarget",
")",
"service",
";",
"endpoint",
".",
"setServiceEntryPoint",
"(",
"url",
")",
";",
"}"
] |
Set the service end point URL to a different value. If pointing to a different context, make sure the
GeomajasController of that context supports this.
@see org.geomajas.gwt.server.mvc.GeomajasController
@param url
the new URL
|
[
"Set",
"the",
"service",
"end",
"point",
"URL",
"to",
"a",
"different",
"value",
".",
"If",
"pointing",
"to",
"a",
"different",
"context",
"make",
"sure",
"the",
"GeomajasController",
"of",
"that",
"context",
"supports",
"this",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L391-L394
|
145,875
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
|
GwtCommandDispatcher.login
|
private void login(final String oldToken) {
tokenRequestHandler.login(new TokenChangedHandler() {
public void onTokenChanged(TokenChangedEvent event) {
setToken(event.getToken(), event.getUserDetail(), false);
List<RetryCommand> retryCommands = afterLoginCommands.remove(oldToken);
if (null != retryCommands) {
for (RetryCommand retryCommand : retryCommands) {
execute(retryCommand.getCommand(), retryCommand.getDeferred());
}
}
}
});
}
|
java
|
private void login(final String oldToken) {
tokenRequestHandler.login(new TokenChangedHandler() {
public void onTokenChanged(TokenChangedEvent event) {
setToken(event.getToken(), event.getUserDetail(), false);
List<RetryCommand> retryCommands = afterLoginCommands.remove(oldToken);
if (null != retryCommands) {
for (RetryCommand retryCommand : retryCommands) {
execute(retryCommand.getCommand(), retryCommand.getDeferred());
}
}
}
});
}
|
[
"private",
"void",
"login",
"(",
"final",
"String",
"oldToken",
")",
"{",
"tokenRequestHandler",
".",
"login",
"(",
"new",
"TokenChangedHandler",
"(",
")",
"{",
"public",
"void",
"onTokenChanged",
"(",
"TokenChangedEvent",
"event",
")",
"{",
"setToken",
"(",
"event",
".",
"getToken",
"(",
")",
",",
"event",
".",
"getUserDetail",
"(",
")",
",",
"false",
")",
";",
"List",
"<",
"RetryCommand",
">",
"retryCommands",
"=",
"afterLoginCommands",
".",
"remove",
"(",
"oldToken",
")",
";",
"if",
"(",
"null",
"!=",
"retryCommands",
")",
"{",
"for",
"(",
"RetryCommand",
"retryCommand",
":",
"retryCommands",
")",
"{",
"execute",
"(",
"retryCommand",
".",
"getCommand",
"(",
")",
",",
"retryCommand",
".",
"getDeferred",
"(",
")",
")",
";",
"}",
"}",
"}",
"}",
")",
";",
"}"
] |
Force request a new login, the dangling commands for the previous token are retried when logged in.
@param oldToken
previous token
|
[
"Force",
"request",
"a",
"new",
"login",
"the",
"dangling",
"commands",
"for",
"the",
"previous",
"token",
"are",
"retried",
"when",
"logged",
"in",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L410-L423
|
145,876
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
|
GwtCommandDispatcher.setToken
|
private void setToken(String userToken, UserDetail userDetail, boolean loginPending) {
boolean changed = !isEqual(this.userToken, userToken);
this.userToken = userToken;
if (null == userDetail) {
userDetail = new UserDetail();
}
this.userDetail = userDetail;
if (changed) {
TokenChangedEvent event = new TokenChangedEvent(userToken, userDetail, loginPending);
manager.fireEvent(event);
}
}
|
java
|
private void setToken(String userToken, UserDetail userDetail, boolean loginPending) {
boolean changed = !isEqual(this.userToken, userToken);
this.userToken = userToken;
if (null == userDetail) {
userDetail = new UserDetail();
}
this.userDetail = userDetail;
if (changed) {
TokenChangedEvent event = new TokenChangedEvent(userToken, userDetail, loginPending);
manager.fireEvent(event);
}
}
|
[
"private",
"void",
"setToken",
"(",
"String",
"userToken",
",",
"UserDetail",
"userDetail",
",",
"boolean",
"loginPending",
")",
"{",
"boolean",
"changed",
"=",
"!",
"isEqual",
"(",
"this",
".",
"userToken",
",",
"userToken",
")",
";",
"this",
".",
"userToken",
"=",
"userToken",
";",
"if",
"(",
"null",
"==",
"userDetail",
")",
"{",
"userDetail",
"=",
"new",
"UserDetail",
"(",
")",
";",
"}",
"this",
".",
"userDetail",
"=",
"userDetail",
";",
"if",
"(",
"changed",
")",
"{",
"TokenChangedEvent",
"event",
"=",
"new",
"TokenChangedEvent",
"(",
"userToken",
",",
"userDetail",
",",
"loginPending",
")",
";",
"manager",
".",
"fireEvent",
"(",
"event",
")",
";",
"}",
"}"
] |
Set the user token, so it can be sent in every command. This is the internal version, used by the token changed
handler.
@param userToken
user token
@param userDetail
user details
@param loginPending
true if this will be followed by a fresh token change
|
[
"Set",
"the",
"user",
"token",
"so",
"it",
"can",
"be",
"sent",
"in",
"every",
"command",
".",
"This",
"is",
"the",
"internal",
"version",
"used",
"by",
"the",
"token",
"changed",
"handler",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L455-L466
|
145,877
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
|
GwtCommandDispatcher.setUseLazyLoading
|
public void setUseLazyLoading(boolean useLazyLoading) {
if (useLazyLoading != this.useLazyLoading) {
if (useLazyLoading) {
lazyFeatureIncludesDefault = GeomajasConstant.FEATURE_INCLUDE_STYLE
+ GeomajasConstant.FEATURE_INCLUDE_LABEL;
lazyFeatureIncludesSelect = GeomajasConstant.FEATURE_INCLUDE_ALL;
lazyFeatureIncludesAll = GeomajasConstant.FEATURE_INCLUDE_ALL;
} else {
lazyFeatureIncludesDefault = GeomajasConstant.FEATURE_INCLUDE_ALL;
lazyFeatureIncludesSelect = GeomajasConstant.FEATURE_INCLUDE_ALL;
lazyFeatureIncludesAll = GeomajasConstant.FEATURE_INCLUDE_ALL;
}
}
this.useLazyLoading = useLazyLoading;
}
|
java
|
public void setUseLazyLoading(boolean useLazyLoading) {
if (useLazyLoading != this.useLazyLoading) {
if (useLazyLoading) {
lazyFeatureIncludesDefault = GeomajasConstant.FEATURE_INCLUDE_STYLE
+ GeomajasConstant.FEATURE_INCLUDE_LABEL;
lazyFeatureIncludesSelect = GeomajasConstant.FEATURE_INCLUDE_ALL;
lazyFeatureIncludesAll = GeomajasConstant.FEATURE_INCLUDE_ALL;
} else {
lazyFeatureIncludesDefault = GeomajasConstant.FEATURE_INCLUDE_ALL;
lazyFeatureIncludesSelect = GeomajasConstant.FEATURE_INCLUDE_ALL;
lazyFeatureIncludesAll = GeomajasConstant.FEATURE_INCLUDE_ALL;
}
}
this.useLazyLoading = useLazyLoading;
}
|
[
"public",
"void",
"setUseLazyLoading",
"(",
"boolean",
"useLazyLoading",
")",
"{",
"if",
"(",
"useLazyLoading",
"!=",
"this",
".",
"useLazyLoading",
")",
"{",
"if",
"(",
"useLazyLoading",
")",
"{",
"lazyFeatureIncludesDefault",
"=",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_STYLE",
"+",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_LABEL",
";",
"lazyFeatureIncludesSelect",
"=",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_ALL",
";",
"lazyFeatureIncludesAll",
"=",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_ALL",
";",
"}",
"else",
"{",
"lazyFeatureIncludesDefault",
"=",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_ALL",
";",
"lazyFeatureIncludesSelect",
"=",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_ALL",
";",
"lazyFeatureIncludesAll",
"=",
"GeomajasConstant",
".",
"FEATURE_INCLUDE_ALL",
";",
"}",
"}",
"this",
".",
"useLazyLoading",
"=",
"useLazyLoading",
";",
"}"
] |
Set lazy feature loading status.
@param useLazyLoading
lazy feature loading status
|
[
"Set",
"lazy",
"feature",
"loading",
"status",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L553-L567
|
145,878
|
geomajas/geomajas-project-client-gwt2
|
common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
|
GwtCommandDispatcher.isEqual
|
private boolean isEqual(Object o1, Object o2) {
return o1 == null ? o2 == null : o1.equals(o2);
}
|
java
|
private boolean isEqual(Object o1, Object o2) {
return o1 == null ? o2 == null : o1.equals(o2);
}
|
[
"private",
"boolean",
"isEqual",
"(",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"return",
"o1",
"==",
"null",
"?",
"o2",
"==",
"null",
":",
"o1",
".",
"equals",
"(",
"o2",
")",
";",
"}"
] |
Checks whether 2 objects are equal. Null-safe, 2 null objects are considered equal.
@param o1
first object to compare
@param o2
second object to compare
@return true if object are equal, false otherwise
|
[
"Checks",
"whether",
"2",
"objects",
"are",
"equal",
".",
"Null",
"-",
"safe",
"2",
"null",
"objects",
"are",
"considered",
"equal",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L686-L688
|
145,879
|
astrapi69/jaulp-wicket
|
jaulp-wicket-behaviors/src/main/java/de/alpharogroup/wicket/behaviors/ComponentDecoratorBehavior.java
|
ComponentDecoratorBehavior.onAfterRender
|
protected void onAfterRender(final Component component) {
final Response response = component.getResponse();
response.write(onWriteAfterRender());
}
|
java
|
protected void onAfterRender(final Component component) {
final Response response = component.getResponse();
response.write(onWriteAfterRender());
}
|
[
"protected",
"void",
"onAfterRender",
"(",
"final",
"Component",
"component",
")",
"{",
"final",
"Response",
"response",
"=",
"component",
".",
"getResponse",
"(",
")",
";",
"response",
".",
"write",
"(",
"onWriteAfterRender",
"(",
")",
")",
";",
"}"
] |
Factory callback method to hook after render.
@param component
the component
|
[
"Factory",
"callback",
"method",
"to",
"hook",
"after",
"render",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-behaviors/src/main/java/de/alpharogroup/wicket/behaviors/ComponentDecoratorBehavior.java#L64-L67
|
145,880
|
astrapi69/jaulp-wicket
|
jaulp-wicket-behaviors/src/main/java/de/alpharogroup/wicket/behaviors/ComponentDecoratorBehavior.java
|
ComponentDecoratorBehavior.onBeforeRender
|
protected void onBeforeRender(final Component component) {
final Response response = component.getResponse();
response.write(onWriteBeforeRender());
}
|
java
|
protected void onBeforeRender(final Component component) {
final Response response = component.getResponse();
response.write(onWriteBeforeRender());
}
|
[
"protected",
"void",
"onBeforeRender",
"(",
"final",
"Component",
"component",
")",
"{",
"final",
"Response",
"response",
"=",
"component",
".",
"getResponse",
"(",
")",
";",
"response",
".",
"write",
"(",
"onWriteBeforeRender",
"(",
")",
")",
";",
"}"
] |
Factory callback method to hook before render.
@param component
the component
|
[
"Factory",
"callback",
"method",
"to",
"hook",
"before",
"render",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-behaviors/src/main/java/de/alpharogroup/wicket/behaviors/ComponentDecoratorBehavior.java#L75-L78
|
145,881
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/features/POSBaselineContextGenerator.java
|
POSBaselineContextGenerator.getSuffixes
|
private String[] getSuffixes(final String lex) {
final Integer start = Integer.parseInt(this.attributes.get("sufBegin"));
final Integer end = Integer.parseInt(this.attributes.get("sufEnd"));
final String[] suffs = new String[end];
for (int li = start, ll = end; li < ll; li++) {
suffs[li] = lex.substring(Math.max(lex.length() - li - 1, 0));
}
return suffs;
}
|
java
|
private String[] getSuffixes(final String lex) {
final Integer start = Integer.parseInt(this.attributes.get("sufBegin"));
final Integer end = Integer.parseInt(this.attributes.get("sufEnd"));
final String[] suffs = new String[end];
for (int li = start, ll = end; li < ll; li++) {
suffs[li] = lex.substring(Math.max(lex.length() - li - 1, 0));
}
return suffs;
}
|
[
"private",
"String",
"[",
"]",
"getSuffixes",
"(",
"final",
"String",
"lex",
")",
"{",
"final",
"Integer",
"start",
"=",
"Integer",
".",
"parseInt",
"(",
"this",
".",
"attributes",
".",
"get",
"(",
"\"sufBegin\"",
")",
")",
";",
"final",
"Integer",
"end",
"=",
"Integer",
".",
"parseInt",
"(",
"this",
".",
"attributes",
".",
"get",
"(",
"\"sufEnd\"",
")",
")",
";",
"final",
"String",
"[",
"]",
"suffs",
"=",
"new",
"String",
"[",
"end",
"]",
";",
"for",
"(",
"int",
"li",
"=",
"start",
",",
"ll",
"=",
"end",
";",
"li",
"<",
"ll",
";",
"li",
"++",
")",
"{",
"suffs",
"[",
"li",
"]",
"=",
"lex",
".",
"substring",
"(",
"Math",
".",
"max",
"(",
"lex",
".",
"length",
"(",
")",
"-",
"li",
"-",
"1",
",",
"0",
")",
")",
";",
"}",
"return",
"suffs",
";",
"}"
] |
Obtain suffixes for each token.
@param lex
the word
@return the suffixes
|
[
"Obtain",
"suffixes",
"for",
"each",
"token",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/features/POSBaselineContextGenerator.java#L73-L81
|
145,882
|
Danny02/JOpenCTM
|
src/main/java/darwin/jopenctm/compression/MG1Encoder.java
|
MG1Encoder.rearrangeTriangles
|
public void rearrangeTriangles(int[] indices) {
assert indices.length % 3 == 0;
// Step 1: Make sure that the first index of each triangle is the smallest
// one (rotate triangle nodes if necessary)
for (int off = 0; off < indices.length; off += 3) {
if ((indices[off + 1] < indices[off]) && (indices[off + 1] < indices[off + 2])) {
int tmp = indices[off];
indices[off] = indices[off + 1];
indices[off + 1] = indices[off + 2];
indices[off + 2] = tmp;
} else if ((indices[off + 2] < indices[off]) && (indices[off + 2] < indices[off + 1])) {
int tmp = indices[off];
indices[off] = indices[off + 2];
indices[off + 2] = indices[off + 1];
indices[off + 1] = tmp;
}
}
// Step 2: Sort the triangles based on the first triangle index
Triangle[] tris = new Triangle[indices.length / 3];
for (int i = 0; i < tris.length; i++) {
int off = i * 3;
tris[i] = new Triangle(indices, off);
}
Arrays.sort(tris);
for (int i = 0; i < tris.length; i++) {
int off = i * 3;
tris[i].copyBack(indices, off);
}
}
|
java
|
public void rearrangeTriangles(int[] indices) {
assert indices.length % 3 == 0;
// Step 1: Make sure that the first index of each triangle is the smallest
// one (rotate triangle nodes if necessary)
for (int off = 0; off < indices.length; off += 3) {
if ((indices[off + 1] < indices[off]) && (indices[off + 1] < indices[off + 2])) {
int tmp = indices[off];
indices[off] = indices[off + 1];
indices[off + 1] = indices[off + 2];
indices[off + 2] = tmp;
} else if ((indices[off + 2] < indices[off]) && (indices[off + 2] < indices[off + 1])) {
int tmp = indices[off];
indices[off] = indices[off + 2];
indices[off + 2] = indices[off + 1];
indices[off + 1] = tmp;
}
}
// Step 2: Sort the triangles based on the first triangle index
Triangle[] tris = new Triangle[indices.length / 3];
for (int i = 0; i < tris.length; i++) {
int off = i * 3;
tris[i] = new Triangle(indices, off);
}
Arrays.sort(tris);
for (int i = 0; i < tris.length; i++) {
int off = i * 3;
tris[i].copyBack(indices, off);
}
}
|
[
"public",
"void",
"rearrangeTriangles",
"(",
"int",
"[",
"]",
"indices",
")",
"{",
"assert",
"indices",
".",
"length",
"%",
"3",
"==",
"0",
";",
"// Step 1: Make sure that the first index of each triangle is the smallest",
"// one (rotate triangle nodes if necessary)",
"for",
"(",
"int",
"off",
"=",
"0",
";",
"off",
"<",
"indices",
".",
"length",
";",
"off",
"+=",
"3",
")",
"{",
"if",
"(",
"(",
"indices",
"[",
"off",
"+",
"1",
"]",
"<",
"indices",
"[",
"off",
"]",
")",
"&&",
"(",
"indices",
"[",
"off",
"+",
"1",
"]",
"<",
"indices",
"[",
"off",
"+",
"2",
"]",
")",
")",
"{",
"int",
"tmp",
"=",
"indices",
"[",
"off",
"]",
";",
"indices",
"[",
"off",
"]",
"=",
"indices",
"[",
"off",
"+",
"1",
"]",
";",
"indices",
"[",
"off",
"+",
"1",
"]",
"=",
"indices",
"[",
"off",
"+",
"2",
"]",
";",
"indices",
"[",
"off",
"+",
"2",
"]",
"=",
"tmp",
";",
"}",
"else",
"if",
"(",
"(",
"indices",
"[",
"off",
"+",
"2",
"]",
"<",
"indices",
"[",
"off",
"]",
")",
"&&",
"(",
"indices",
"[",
"off",
"+",
"2",
"]",
"<",
"indices",
"[",
"off",
"+",
"1",
"]",
")",
")",
"{",
"int",
"tmp",
"=",
"indices",
"[",
"off",
"]",
";",
"indices",
"[",
"off",
"]",
"=",
"indices",
"[",
"off",
"+",
"2",
"]",
";",
"indices",
"[",
"off",
"+",
"2",
"]",
"=",
"indices",
"[",
"off",
"+",
"1",
"]",
";",
"indices",
"[",
"off",
"+",
"1",
"]",
"=",
"tmp",
";",
"}",
"}",
"// Step 2: Sort the triangles based on the first triangle index",
"Triangle",
"[",
"]",
"tris",
"=",
"new",
"Triangle",
"[",
"indices",
".",
"length",
"/",
"3",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tris",
".",
"length",
";",
"i",
"++",
")",
"{",
"int",
"off",
"=",
"i",
"*",
"3",
";",
"tris",
"[",
"i",
"]",
"=",
"new",
"Triangle",
"(",
"indices",
",",
"off",
")",
";",
"}",
"Arrays",
".",
"sort",
"(",
"tris",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tris",
".",
"length",
";",
"i",
"++",
")",
"{",
"int",
"off",
"=",
"i",
"*",
"3",
";",
"tris",
"[",
"i",
"]",
".",
"copyBack",
"(",
"indices",
",",
"off",
")",
";",
"}",
"}"
] |
Re-arrange all triangles for optimal compression.
@param indices index data to reorder in place
|
[
"Re",
"-",
"arrange",
"all",
"triangles",
"for",
"optimal",
"compression",
"."
] |
c55a2a2d166a55979190f1bb08214fc84c93008f
|
https://github.com/Danny02/JOpenCTM/blob/c55a2a2d166a55979190f1bb08214fc84c93008f/src/main/java/darwin/jopenctm/compression/MG1Encoder.java#L60-L91
|
145,883
|
astrapi69/jaulp-wicket
|
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/properties/ComponentPropertiesKeysListResolver.java
|
ComponentPropertiesKeysListResolver.getDisplayValue
|
@Override
public String getDisplayValue(final ResourceBundleKey resourceBundleKey)
{
return ResourceModelFactory
.newResourceModel(getPropertiesKey(resourceBundleKey.getKey()),
resourceBundleKey.getParameters(), component, resourceBundleKey.getDefaultValue())
.getObject();
}
|
java
|
@Override
public String getDisplayValue(final ResourceBundleKey resourceBundleKey)
{
return ResourceModelFactory
.newResourceModel(getPropertiesKey(resourceBundleKey.getKey()),
resourceBundleKey.getParameters(), component, resourceBundleKey.getDefaultValue())
.getObject();
}
|
[
"@",
"Override",
"public",
"String",
"getDisplayValue",
"(",
"final",
"ResourceBundleKey",
"resourceBundleKey",
")",
"{",
"return",
"ResourceModelFactory",
".",
"newResourceModel",
"(",
"getPropertiesKey",
"(",
"resourceBundleKey",
".",
"getKey",
"(",
")",
")",
",",
"resourceBundleKey",
".",
"getParameters",
"(",
")",
",",
"component",
",",
"resourceBundleKey",
".",
"getDefaultValue",
"(",
")",
")",
".",
"getObject",
"(",
")",
";",
"}"
] |
Gets the display value.
@param resourceBundleKey
the {@link ResourceBundleKey} object
@return the display value
|
[
"Gets",
"the",
"display",
"value",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/properties/ComponentPropertiesKeysListResolver.java#L88-L95
|
145,884
|
astrapi69/jaulp-wicket
|
jaulp-wicket-behaviors/src/main/java/de/alpharogroup/wicket/behaviors/JavascriptResourceReferenceAppenderBehavior.java
|
JavascriptResourceReferenceAppenderBehavior.getResourceReference
|
private ResourceReference getResourceReference()
{
final Map<String, Object> map = new HashMap<>();
map.put("url", WicketUrlExtensions.getUrlAsString(pageClass));
final ResourceReference resourceReference = new TextTemplateResourceReference(pageClass,
this.filename, "text/javascript", Model.ofMap(map));
return resourceReference;
}
|
java
|
private ResourceReference getResourceReference()
{
final Map<String, Object> map = new HashMap<>();
map.put("url", WicketUrlExtensions.getUrlAsString(pageClass));
final ResourceReference resourceReference = new TextTemplateResourceReference(pageClass,
this.filename, "text/javascript", Model.ofMap(map));
return resourceReference;
}
|
[
"private",
"ResourceReference",
"getResourceReference",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"url\"",
",",
"WicketUrlExtensions",
".",
"getUrlAsString",
"(",
"pageClass",
")",
")",
";",
"final",
"ResourceReference",
"resourceReference",
"=",
"new",
"TextTemplateResourceReference",
"(",
"pageClass",
",",
"this",
".",
"filename",
",",
"\"text/javascript\"",
",",
"Model",
".",
"ofMap",
"(",
"map",
")",
")",
";",
"return",
"resourceReference",
";",
"}"
] |
Gets the resource reference.
@return the resource reference
|
[
"Gets",
"the",
"resource",
"reference",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-behaviors/src/main/java/de/alpharogroup/wicket/behaviors/JavascriptResourceReferenceAppenderBehavior.java#L85-L92
|
145,885
|
astrapi69/jaulp-wicket
|
jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java
|
PackageResourceReferences.addCssFiles
|
public static void addCssFiles(final IHeaderResponse response, final Class<?> scope,
final String... cssFilenames)
{
for (final String cssFilename : cssFilenames)
{
final HeaderItem item = CssHeaderItem
.forReference(new PackageResourceReference(scope, cssFilename));
response.render(item);
}
}
|
java
|
public static void addCssFiles(final IHeaderResponse response, final Class<?> scope,
final String... cssFilenames)
{
for (final String cssFilename : cssFilenames)
{
final HeaderItem item = CssHeaderItem
.forReference(new PackageResourceReference(scope, cssFilename));
response.render(item);
}
}
|
[
"public",
"static",
"void",
"addCssFiles",
"(",
"final",
"IHeaderResponse",
"response",
",",
"final",
"Class",
"<",
"?",
">",
"scope",
",",
"final",
"String",
"...",
"cssFilenames",
")",
"{",
"for",
"(",
"final",
"String",
"cssFilename",
":",
"cssFilenames",
")",
"{",
"final",
"HeaderItem",
"item",
"=",
"CssHeaderItem",
".",
"forReference",
"(",
"new",
"PackageResourceReference",
"(",
"scope",
",",
"cssFilename",
")",
")",
";",
"response",
".",
"render",
"(",
"item",
")",
";",
"}",
"}"
] |
Adds the given css files to the given response object in the given scope.
@param response
the {@link org.apache.wicket.markup.head.IHeaderResponse}
@param scope
The scope of the css files.
@param cssFilenames
The css file names.
|
[
"Adds",
"the",
"given",
"css",
"files",
"to",
"the",
"given",
"response",
"object",
"in",
"the",
"given",
"scope",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L59-L68
|
145,886
|
astrapi69/jaulp-wicket
|
jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java
|
PackageResourceReferences.addJsFiles
|
public static void addJsFiles(final IHeaderResponse response, final Class<?> scope,
final String... jsFilenames)
{
for (final String jsFilename : jsFilenames)
{
final HeaderItem item = JavaScriptHeaderItem
.forReference(new PackageResourceReference(scope, jsFilename));
response.render(item);
}
}
|
java
|
public static void addJsFiles(final IHeaderResponse response, final Class<?> scope,
final String... jsFilenames)
{
for (final String jsFilename : jsFilenames)
{
final HeaderItem item = JavaScriptHeaderItem
.forReference(new PackageResourceReference(scope, jsFilename));
response.render(item);
}
}
|
[
"public",
"static",
"void",
"addJsFiles",
"(",
"final",
"IHeaderResponse",
"response",
",",
"final",
"Class",
"<",
"?",
">",
"scope",
",",
"final",
"String",
"...",
"jsFilenames",
")",
"{",
"for",
"(",
"final",
"String",
"jsFilename",
":",
"jsFilenames",
")",
"{",
"final",
"HeaderItem",
"item",
"=",
"JavaScriptHeaderItem",
".",
"forReference",
"(",
"new",
"PackageResourceReference",
"(",
"scope",
",",
"jsFilename",
")",
")",
";",
"response",
".",
"render",
"(",
"item",
")",
";",
"}",
"}"
] |
Adds the given javascript files to the given response object in the given scope.
@param response
the {@link org.apache.wicket.markup.head.IHeaderResponse}
@param scope
The scope of the javascript files.
@param jsFilenames
The javascript file names.
|
[
"Adds",
"the",
"given",
"javascript",
"files",
"to",
"the",
"given",
"response",
"object",
"in",
"the",
"given",
"scope",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L80-L89
|
145,887
|
astrapi69/jaulp-wicket
|
jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java
|
PackageResourceReferences.addFoundPackageResourceReferences
|
private Set<PackageResourceReferenceWrapper> addFoundPackageResourceReferences(
Set<PackageResourceReferenceWrapper> packageResourceReferences, final Class<?> iface)
{
final Set<PackageResourceReferenceWrapper> prr = PackageResourceReferences.getInstance()
.getPackageResourceReferenceMap().get(iface);
if ((packageResourceReferences != null) && !packageResourceReferences.isEmpty())
{
if ((prr != null) && !prr.isEmpty())
{
packageResourceReferences.addAll(prr);
}
else
{
}
}
else
{
if ((prr != null) && !prr.isEmpty())
{
packageResourceReferences = prr;
}
}
return packageResourceReferences;
}
|
java
|
private Set<PackageResourceReferenceWrapper> addFoundPackageResourceReferences(
Set<PackageResourceReferenceWrapper> packageResourceReferences, final Class<?> iface)
{
final Set<PackageResourceReferenceWrapper> prr = PackageResourceReferences.getInstance()
.getPackageResourceReferenceMap().get(iface);
if ((packageResourceReferences != null) && !packageResourceReferences.isEmpty())
{
if ((prr != null) && !prr.isEmpty())
{
packageResourceReferences.addAll(prr);
}
else
{
}
}
else
{
if ((prr != null) && !prr.isEmpty())
{
packageResourceReferences = prr;
}
}
return packageResourceReferences;
}
|
[
"private",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"addFoundPackageResourceReferences",
"(",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"packageResourceReferences",
",",
"final",
"Class",
"<",
"?",
">",
"iface",
")",
"{",
"final",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"prr",
"=",
"PackageResourceReferences",
".",
"getInstance",
"(",
")",
".",
"getPackageResourceReferenceMap",
"(",
")",
".",
"get",
"(",
"iface",
")",
";",
"if",
"(",
"(",
"packageResourceReferences",
"!=",
"null",
")",
"&&",
"!",
"packageResourceReferences",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"(",
"prr",
"!=",
"null",
")",
"&&",
"!",
"prr",
".",
"isEmpty",
"(",
")",
")",
"{",
"packageResourceReferences",
".",
"addAll",
"(",
"prr",
")",
";",
"}",
"else",
"{",
"}",
"}",
"else",
"{",
"if",
"(",
"(",
"prr",
"!=",
"null",
")",
"&&",
"!",
"prr",
".",
"isEmpty",
"(",
")",
")",
"{",
"packageResourceReferences",
"=",
"prr",
";",
"}",
"}",
"return",
"packageResourceReferences",
";",
"}"
] |
Adds the found package resource references.
@param packageResourceReferences
the package resource references
@param iface
the iface
@return the sets the
|
[
"Adds",
"the",
"found",
"package",
"resource",
"references",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L113-L137
|
145,888
|
astrapi69/jaulp-wicket
|
jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java
|
PackageResourceReferences.addPackageResourceReferenceFromInterfaces
|
private Set<PackageResourceReferenceWrapper> addPackageResourceReferenceFromInterfaces(
Set<PackageResourceReferenceWrapper> packageResourceReferences, final Class<?> searchClass)
{
final Class<?>[] interfaces = searchClass.getInterfaces();
for (final Class<?> iface : interfaces)
{
packageResourceReferences = addFoundPackageResourceReferences(packageResourceReferences,
iface);
}
return packageResourceReferences;
}
|
java
|
private Set<PackageResourceReferenceWrapper> addPackageResourceReferenceFromInterfaces(
Set<PackageResourceReferenceWrapper> packageResourceReferences, final Class<?> searchClass)
{
final Class<?>[] interfaces = searchClass.getInterfaces();
for (final Class<?> iface : interfaces)
{
packageResourceReferences = addFoundPackageResourceReferences(packageResourceReferences,
iface);
}
return packageResourceReferences;
}
|
[
"private",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"addPackageResourceReferenceFromInterfaces",
"(",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"packageResourceReferences",
",",
"final",
"Class",
"<",
"?",
">",
"searchClass",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"interfaces",
"=",
"searchClass",
".",
"getInterfaces",
"(",
")",
";",
"for",
"(",
"final",
"Class",
"<",
"?",
">",
"iface",
":",
"interfaces",
")",
"{",
"packageResourceReferences",
"=",
"addFoundPackageResourceReferences",
"(",
"packageResourceReferences",
",",
"iface",
")",
";",
"}",
"return",
"packageResourceReferences",
";",
"}"
] |
Adds the package resource reference from interfaces.
@param packageResourceReferences
the package resource references
@param searchClass
the search class
@return 's a set with the founded interfaces from the given search class.
|
[
"Adds",
"the",
"package",
"resource",
"reference",
"from",
"interfaces",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L148-L158
|
145,889
|
astrapi69/jaulp-wicket
|
jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java
|
PackageResourceReferences.getPackageResourceReference
|
public Set<PackageResourceReferenceWrapper> getPackageResourceReference(
final Class<?> componentClass)
{
Set<PackageResourceReferenceWrapper> packageResourceReference = PackageResourceReferences
.getInstance().getPackageResourceReferenceMap().get(componentClass);
packageResourceReference = addPackageResourceReferenceFromInterfaces(
packageResourceReference, componentClass);
return packageResourceReference;
}
|
java
|
public Set<PackageResourceReferenceWrapper> getPackageResourceReference(
final Class<?> componentClass)
{
Set<PackageResourceReferenceWrapper> packageResourceReference = PackageResourceReferences
.getInstance().getPackageResourceReferenceMap().get(componentClass);
packageResourceReference = addPackageResourceReferenceFromInterfaces(
packageResourceReference, componentClass);
return packageResourceReference;
}
|
[
"public",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"getPackageResourceReference",
"(",
"final",
"Class",
"<",
"?",
">",
"componentClass",
")",
"{",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"packageResourceReference",
"=",
"PackageResourceReferences",
".",
"getInstance",
"(",
")",
".",
"getPackageResourceReferenceMap",
"(",
")",
".",
"get",
"(",
"componentClass",
")",
";",
"packageResourceReference",
"=",
"addPackageResourceReferenceFromInterfaces",
"(",
"packageResourceReference",
",",
"componentClass",
")",
";",
"return",
"packageResourceReference",
";",
"}"
] |
Gets the package resource reference.
@param componentClass
the component class
@return the package resource reference
|
[
"Gets",
"the",
"package",
"resource",
"reference",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L167-L175
|
145,890
|
astrapi69/jaulp-wicket
|
jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java
|
PackageResourceReferences.initializeResources
|
public void initializeResources(final String packageName)
throws ClassNotFoundException, IOException, URISyntaxException
{
final Map<Class<?>, ImportResource[]> resourcesMap = ImportResourcesExtensions
.getImportResources(packageName);
for (final Entry<Class<?>, ImportResource[]> entry : resourcesMap.entrySet())
{
final Class<?> key = entry.getKey();
final ImportResource[] value = entry.getValue();
final Set<PackageResourceReferenceWrapper> packageResourceReferences = new LinkedHashSet<>();
for (final ImportResource importResource : value)
{
if (importResource.resourceType().equalsIgnoreCase("js"))
{
final PackageResourceReference t = new PackageResourceReference(key,
importResource.resourceName());
packageResourceReferences
.add(new PackageResourceReferenceWrapper(t, ResourceReferenceType.JS));
}
else if (importResource.resourceType().equalsIgnoreCase("css"))
{
final PackageResourceReference t = new PackageResourceReference(key,
importResource.resourceName());
packageResourceReferences
.add(new PackageResourceReferenceWrapper(t, ResourceReferenceType.CSS));
}
}
PackageResourceReferences.getInstance().getPackageResourceReferenceMap().put(key,
packageResourceReferences);
}
}
|
java
|
public void initializeResources(final String packageName)
throws ClassNotFoundException, IOException, URISyntaxException
{
final Map<Class<?>, ImportResource[]> resourcesMap = ImportResourcesExtensions
.getImportResources(packageName);
for (final Entry<Class<?>, ImportResource[]> entry : resourcesMap.entrySet())
{
final Class<?> key = entry.getKey();
final ImportResource[] value = entry.getValue();
final Set<PackageResourceReferenceWrapper> packageResourceReferences = new LinkedHashSet<>();
for (final ImportResource importResource : value)
{
if (importResource.resourceType().equalsIgnoreCase("js"))
{
final PackageResourceReference t = new PackageResourceReference(key,
importResource.resourceName());
packageResourceReferences
.add(new PackageResourceReferenceWrapper(t, ResourceReferenceType.JS));
}
else if (importResource.resourceType().equalsIgnoreCase("css"))
{
final PackageResourceReference t = new PackageResourceReference(key,
importResource.resourceName());
packageResourceReferences
.add(new PackageResourceReferenceWrapper(t, ResourceReferenceType.CSS));
}
}
PackageResourceReferences.getInstance().getPackageResourceReferenceMap().put(key,
packageResourceReferences);
}
}
|
[
"public",
"void",
"initializeResources",
"(",
"final",
"String",
"packageName",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
",",
"URISyntaxException",
"{",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"ImportResource",
"[",
"]",
">",
"resourcesMap",
"=",
"ImportResourcesExtensions",
".",
"getImportResources",
"(",
"packageName",
")",
";",
"for",
"(",
"final",
"Entry",
"<",
"Class",
"<",
"?",
">",
",",
"ImportResource",
"[",
"]",
">",
"entry",
":",
"resourcesMap",
".",
"entrySet",
"(",
")",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"key",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"final",
"ImportResource",
"[",
"]",
"value",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"final",
"Set",
"<",
"PackageResourceReferenceWrapper",
">",
"packageResourceReferences",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"ImportResource",
"importResource",
":",
"value",
")",
"{",
"if",
"(",
"importResource",
".",
"resourceType",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"\"js\"",
")",
")",
"{",
"final",
"PackageResourceReference",
"t",
"=",
"new",
"PackageResourceReference",
"(",
"key",
",",
"importResource",
".",
"resourceName",
"(",
")",
")",
";",
"packageResourceReferences",
".",
"add",
"(",
"new",
"PackageResourceReferenceWrapper",
"(",
"t",
",",
"ResourceReferenceType",
".",
"JS",
")",
")",
";",
"}",
"else",
"if",
"(",
"importResource",
".",
"resourceType",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"\"css\"",
")",
")",
"{",
"final",
"PackageResourceReference",
"t",
"=",
"new",
"PackageResourceReference",
"(",
"key",
",",
"importResource",
".",
"resourceName",
"(",
")",
")",
";",
"packageResourceReferences",
".",
"add",
"(",
"new",
"PackageResourceReferenceWrapper",
"(",
"t",
",",
"ResourceReferenceType",
".",
"CSS",
")",
")",
";",
"}",
"}",
"PackageResourceReferences",
".",
"getInstance",
"(",
")",
".",
"getPackageResourceReferenceMap",
"(",
")",
".",
"put",
"(",
"key",
",",
"packageResourceReferences",
")",
";",
"}",
"}"
] |
Initialize resources from the given package.
@param packageName
the package name
@throws ClassNotFoundException
occurs if a given class cannot be located by the specified class loader
@throws IOException
Signals that an I/O exception has occurred.
@throws URISyntaxException
is thrown if a string could not be parsed as a URI reference.
|
[
"Initialize",
"resources",
"from",
"the",
"given",
"package",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-annotated-header-contributors/src/main/java/de/alpharogroup/wicket/PackageResourceReferences.java#L220-L252
|
145,891
|
OpenBEL/openbel-framework
|
org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java
|
DefaultNamespaceService.doCompile
|
private String doCompile(String resourceLocation) throws IndexingFailure,
ResourceDownloadError {
final ResolvedResource resolved =
resourceCache.resolveResource(NAMESPACES, resourceLocation);
final File resourceCopy = resolved.getCacheResourceCopy();
namespaceIndexerService.indexNamespace(
resourceLocation, resolved.getCacheResourceCopy());
final String indexPath = asPath(resourceCopy.getParent(),
NAMESPACE_ROOT_DIRECTORY_NAME, NS_INDEX_FILE_NAME);
return indexPath;
}
|
java
|
private String doCompile(String resourceLocation) throws IndexingFailure,
ResourceDownloadError {
final ResolvedResource resolved =
resourceCache.resolveResource(NAMESPACES, resourceLocation);
final File resourceCopy = resolved.getCacheResourceCopy();
namespaceIndexerService.indexNamespace(
resourceLocation, resolved.getCacheResourceCopy());
final String indexPath = asPath(resourceCopy.getParent(),
NAMESPACE_ROOT_DIRECTORY_NAME, NS_INDEX_FILE_NAME);
return indexPath;
}
|
[
"private",
"String",
"doCompile",
"(",
"String",
"resourceLocation",
")",
"throws",
"IndexingFailure",
",",
"ResourceDownloadError",
"{",
"final",
"ResolvedResource",
"resolved",
"=",
"resourceCache",
".",
"resolveResource",
"(",
"NAMESPACES",
",",
"resourceLocation",
")",
";",
"final",
"File",
"resourceCopy",
"=",
"resolved",
".",
"getCacheResourceCopy",
"(",
")",
";",
"namespaceIndexerService",
".",
"indexNamespace",
"(",
"resourceLocation",
",",
"resolved",
".",
"getCacheResourceCopy",
"(",
")",
")",
";",
"final",
"String",
"indexPath",
"=",
"asPath",
"(",
"resourceCopy",
".",
"getParent",
"(",
")",
",",
"NAMESPACE_ROOT_DIRECTORY_NAME",
",",
"NS_INDEX_FILE_NAME",
")",
";",
"return",
"indexPath",
";",
"}"
] |
Do compilation of the namespace resource.
@param resourceLocation {@link String}, the resource location to compile
@throws IndexingFailure Thrown if an error occurred while indexing
@throws ResourceDownloadError Thrown if an error occurred downloading
resource
|
[
"Do",
"compilation",
"of",
"the",
"namespace",
"resource",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java#L362-L373
|
145,892
|
OpenBEL/openbel-framework
|
org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java
|
DefaultNamespaceService.doSearch
|
private Set<String> doSearch(String resourceLocation, Pattern pattern) {
// get opened namespace
JDBMNamespaceLookup il = openNamespaces.get(resourceLocation);
Set<String> results = new HashSet<String>();
for (String value : il.getKeySet()) {
if (pattern.matcher(value).matches()) {
results.add(value);
}
}
return results;
}
|
java
|
private Set<String> doSearch(String resourceLocation, Pattern pattern) {
// get opened namespace
JDBMNamespaceLookup il = openNamespaces.get(resourceLocation);
Set<String> results = new HashSet<String>();
for (String value : il.getKeySet()) {
if (pattern.matcher(value).matches()) {
results.add(value);
}
}
return results;
}
|
[
"private",
"Set",
"<",
"String",
">",
"doSearch",
"(",
"String",
"resourceLocation",
",",
"Pattern",
"pattern",
")",
"{",
"// get opened namespace",
"JDBMNamespaceLookup",
"il",
"=",
"openNamespaces",
".",
"get",
"(",
"resourceLocation",
")",
";",
"Set",
"<",
"String",
">",
"results",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"value",
":",
"il",
".",
"getKeySet",
"(",
")",
")",
"{",
"if",
"(",
"pattern",
".",
"matcher",
"(",
"value",
")",
".",
"matches",
"(",
")",
")",
"{",
"results",
".",
"add",
"(",
"value",
")",
";",
"}",
"}",
"return",
"results",
";",
"}"
] |
Do a search on the values in namespace specified by the resource location
@param resourceLocation resource location, e.g.,
"http://resource.belframework.org/belframework/1.0/ns/chebi-ids.belns" ,
can not be null
@param pattern {@link Pattern}, can not be null
@return {@link Set} of {@link String}s containing values that match
|
[
"Do",
"a",
"search",
"on",
"the",
"values",
"in",
"namespace",
"specified",
"by",
"the",
"resource",
"location"
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java#L384-L396
|
145,893
|
OpenBEL/openbel-framework
|
org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java
|
DefaultNamespaceService.doVerify
|
private void doVerify(Parameter p) throws NamespaceSyntaxWarning {
if (p.getValue() == null) {
throw new InvalidArgument("parameter value is null");
}
Namespace ns = p.getNamespace();
String resourceLocation = ns.getResourceLocation();
if (resourceLocation == null) {
throw new InvalidArgument("resourceLocation", resourceLocation);
}
// get opened namespace and lookup namespace parameter encoding
JDBMNamespaceLookup il = openNamespaces.get(ns.getResourceLocation());
if (il == null) {
throw new IllegalStateException("namespace index is not open.");
}
String encoding = il.lookup(p.getValue());
if (encoding == null) {
throw new NamespaceSyntaxWarning(ns.getResourceLocation(),
ns.getPrefix(),
p.getValue());
}
}
|
java
|
private void doVerify(Parameter p) throws NamespaceSyntaxWarning {
if (p.getValue() == null) {
throw new InvalidArgument("parameter value is null");
}
Namespace ns = p.getNamespace();
String resourceLocation = ns.getResourceLocation();
if (resourceLocation == null) {
throw new InvalidArgument("resourceLocation", resourceLocation);
}
// get opened namespace and lookup namespace parameter encoding
JDBMNamespaceLookup il = openNamespaces.get(ns.getResourceLocation());
if (il == null) {
throw new IllegalStateException("namespace index is not open.");
}
String encoding = il.lookup(p.getValue());
if (encoding == null) {
throw new NamespaceSyntaxWarning(ns.getResourceLocation(),
ns.getPrefix(),
p.getValue());
}
}
|
[
"private",
"void",
"doVerify",
"(",
"Parameter",
"p",
")",
"throws",
"NamespaceSyntaxWarning",
"{",
"if",
"(",
"p",
".",
"getValue",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgument",
"(",
"\"parameter value is null\"",
")",
";",
"}",
"Namespace",
"ns",
"=",
"p",
".",
"getNamespace",
"(",
")",
";",
"String",
"resourceLocation",
"=",
"ns",
".",
"getResourceLocation",
"(",
")",
";",
"if",
"(",
"resourceLocation",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgument",
"(",
"\"resourceLocation\"",
",",
"resourceLocation",
")",
";",
"}",
"// get opened namespace and lookup namespace parameter encoding",
"JDBMNamespaceLookup",
"il",
"=",
"openNamespaces",
".",
"get",
"(",
"ns",
".",
"getResourceLocation",
"(",
")",
")",
";",
"if",
"(",
"il",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"namespace index is not open.\"",
")",
";",
"}",
"String",
"encoding",
"=",
"il",
".",
"lookup",
"(",
"p",
".",
"getValue",
"(",
")",
")",
";",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"throw",
"new",
"NamespaceSyntaxWarning",
"(",
"ns",
".",
"getResourceLocation",
"(",
")",
",",
"ns",
".",
"getPrefix",
"(",
")",
",",
"p",
".",
"getValue",
"(",
")",
")",
";",
"}",
"}"
] |
Do namespace value verification against a resource location. This
implementation assumes the namespace has been open prior to execution.
@param p {@link Parameter}, the parameter to verify namespace value for
which cannot be null and must have a non-null namespace and value
@throws NamespaceSyntaxWarning Thrown if parameter's {@link Namespace} is
not null and it does not contain the parameter's value
@throws InvalidArgument Thrown if <tt>p</tt> argument is null, its value
is null, or if its namespace's resource location is null
|
[
"Do",
"namespace",
"value",
"verification",
"against",
"a",
"resource",
"location",
".",
"This",
"implementation",
"assumes",
"the",
"namespace",
"has",
"been",
"open",
"prior",
"to",
"execution",
"."
] |
149f80b1d6eabb15ab15815b6f745b0afa9fd2d3
|
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java#L409-L433
|
145,894
|
geomajas/geomajas-project-client-gwt2
|
plugin/print/impl/src/main/java/org/geomajas/gwt2/plugin/print/client/util/PrintUtilImpl.java
|
PrintUtilImpl.copyProviderDataToBuilder
|
public void copyProviderDataToBuilder(TemplateBuilder builder,
TemplateBuilderDataProvider templateBuilderDataProvider) {
PageSize size = templateBuilderDataProvider.getPageSize();
if (templateBuilderDataProvider.isLandscape()) {
builder.setPageHeight(size.getWidth());
builder.setPageWidth(size.getHeight());
} else {
builder.setPageHeight(size.getHeight());
builder.setPageWidth(size.getWidth());
}
builder.setTitleText(templateBuilderDataProvider.getTitle());
builder.setWithArrow(templateBuilderDataProvider.isWithArrow());
builder.setWithScaleBar(templateBuilderDataProvider.isWithScaleBar());
builder.setRasterDpi(templateBuilderDataProvider.getRasterDpi());
builder.setDpi(templateBuilderDataProvider.getDpi());
}
|
java
|
public void copyProviderDataToBuilder(TemplateBuilder builder,
TemplateBuilderDataProvider templateBuilderDataProvider) {
PageSize size = templateBuilderDataProvider.getPageSize();
if (templateBuilderDataProvider.isLandscape()) {
builder.setPageHeight(size.getWidth());
builder.setPageWidth(size.getHeight());
} else {
builder.setPageHeight(size.getHeight());
builder.setPageWidth(size.getWidth());
}
builder.setTitleText(templateBuilderDataProvider.getTitle());
builder.setWithArrow(templateBuilderDataProvider.isWithArrow());
builder.setWithScaleBar(templateBuilderDataProvider.isWithScaleBar());
builder.setRasterDpi(templateBuilderDataProvider.getRasterDpi());
builder.setDpi(templateBuilderDataProvider.getDpi());
}
|
[
"public",
"void",
"copyProviderDataToBuilder",
"(",
"TemplateBuilder",
"builder",
",",
"TemplateBuilderDataProvider",
"templateBuilderDataProvider",
")",
"{",
"PageSize",
"size",
"=",
"templateBuilderDataProvider",
".",
"getPageSize",
"(",
")",
";",
"if",
"(",
"templateBuilderDataProvider",
".",
"isLandscape",
"(",
")",
")",
"{",
"builder",
".",
"setPageHeight",
"(",
"size",
".",
"getWidth",
"(",
")",
")",
";",
"builder",
".",
"setPageWidth",
"(",
"size",
".",
"getHeight",
"(",
")",
")",
";",
"}",
"else",
"{",
"builder",
".",
"setPageHeight",
"(",
"size",
".",
"getHeight",
"(",
")",
")",
";",
"builder",
".",
"setPageWidth",
"(",
"size",
".",
"getWidth",
"(",
")",
")",
";",
"}",
"builder",
".",
"setTitleText",
"(",
"templateBuilderDataProvider",
".",
"getTitle",
"(",
")",
")",
";",
"builder",
".",
"setWithArrow",
"(",
"templateBuilderDataProvider",
".",
"isWithArrow",
"(",
")",
")",
";",
"builder",
".",
"setWithScaleBar",
"(",
"templateBuilderDataProvider",
".",
"isWithScaleBar",
"(",
")",
")",
";",
"builder",
".",
"setRasterDpi",
"(",
"templateBuilderDataProvider",
".",
"getRasterDpi",
"(",
")",
")",
";",
"builder",
".",
"setDpi",
"(",
"templateBuilderDataProvider",
".",
"getDpi",
"(",
")",
")",
";",
"}"
] |
Fill the builder with information from the data provider.
UTIL method.
@param builder
@param templateBuilderDataProvider provides data for the builder
@return
|
[
"Fill",
"the",
"builder",
"with",
"information",
"from",
"the",
"data",
"provider",
".",
"UTIL",
"method",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/print/impl/src/main/java/org/geomajas/gwt2/plugin/print/client/util/PrintUtilImpl.java#L39-L54
|
145,895
|
astrapi69/jaulp-wicket
|
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/password/forgotten/AbstractPasswordForgottenPanel.java
|
AbstractPasswordForgottenPanel.newEmailLabel
|
protected Label newEmailLabel(final String id, final String forId, final String resourceKey,
final String defaultValue, final Component component)
{
return ComponentFactory.newLabel(id, forId,
ResourceModelFactory.newResourceModel(resourceKey, component, defaultValue));
}
|
java
|
protected Label newEmailLabel(final String id, final String forId, final String resourceKey,
final String defaultValue, final Component component)
{
return ComponentFactory.newLabel(id, forId,
ResourceModelFactory.newResourceModel(resourceKey, component, defaultValue));
}
|
[
"protected",
"Label",
"newEmailLabel",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"forId",
",",
"final",
"String",
"resourceKey",
",",
"final",
"String",
"defaultValue",
",",
"final",
"Component",
"component",
")",
"{",
"return",
"ComponentFactory",
".",
"newLabel",
"(",
"id",
",",
"forId",
",",
"ResourceModelFactory",
".",
"newResourceModel",
"(",
"resourceKey",
",",
"component",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Factory method for creating the Label. This method is invoked in the constructor from the
derived classes and can be overridden so users can provide their own version of a Label.
@param id
the id
@param forId
the for id
@param resourceKey
the resource key
@param defaultValue
the default value
@param component
the component
@return the label
|
[
"Factory",
"method",
"for",
"creating",
"the",
"Label",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"version",
"of",
"a",
"Label",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/password/forgotten/AbstractPasswordForgottenPanel.java#L175-L180
|
145,896
|
astrapi69/jaulp-wicket
|
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/password/forgotten/AbstractPasswordForgottenPanel.java
|
AbstractPasswordForgottenPanel.newEmailTextField
|
protected Component newEmailTextField(final String id,
final IModel<PasswordForgottenModelBean> model)
{
final IModel<String> labelModel = ResourceModelFactory.newResourceModel(
"password.forgotten.content.label", this, "Give email in the Textfield");
final IModel<String> placeholderModel = ResourceModelFactory
.newResourceModel("global.enter.your.email.label", this, "Enter your email here");
final LabeledEmailTextFieldPanel<String, PasswordForgottenModelBean> emailTextField = new LabeledEmailTextFieldPanel<String, PasswordForgottenModelBean>(
id, model, labelModel)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected EmailTextField newEmailTextField(final String id,
final IModel<PasswordForgottenModelBean> model)
{
final EmailTextField emailTextField = new EmailTextField(id,
new PropertyModel<>(model, "email"));
emailTextField.setOutputMarkupId(true);
emailTextField.setRequired(true);
if (placeholderModel != null)
{
emailTextField.add(new AttributeAppender("placeholder", placeholderModel));
}
return emailTextField;
}
};
return emailTextField;
}
|
java
|
protected Component newEmailTextField(final String id,
final IModel<PasswordForgottenModelBean> model)
{
final IModel<String> labelModel = ResourceModelFactory.newResourceModel(
"password.forgotten.content.label", this, "Give email in the Textfield");
final IModel<String> placeholderModel = ResourceModelFactory
.newResourceModel("global.enter.your.email.label", this, "Enter your email here");
final LabeledEmailTextFieldPanel<String, PasswordForgottenModelBean> emailTextField = new LabeledEmailTextFieldPanel<String, PasswordForgottenModelBean>(
id, model, labelModel)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected EmailTextField newEmailTextField(final String id,
final IModel<PasswordForgottenModelBean> model)
{
final EmailTextField emailTextField = new EmailTextField(id,
new PropertyModel<>(model, "email"));
emailTextField.setOutputMarkupId(true);
emailTextField.setRequired(true);
if (placeholderModel != null)
{
emailTextField.add(new AttributeAppender("placeholder", placeholderModel));
}
return emailTextField;
}
};
return emailTextField;
}
|
[
"protected",
"Component",
"newEmailTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"PasswordForgottenModelBean",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"String",
">",
"labelModel",
"=",
"ResourceModelFactory",
".",
"newResourceModel",
"(",
"\"password.forgotten.content.label\"",
",",
"this",
",",
"\"Give email in the Textfield\"",
")",
";",
"final",
"IModel",
"<",
"String",
">",
"placeholderModel",
"=",
"ResourceModelFactory",
".",
"newResourceModel",
"(",
"\"global.enter.your.email.label\"",
",",
"this",
",",
"\"Enter your email here\"",
")",
";",
"final",
"LabeledEmailTextFieldPanel",
"<",
"String",
",",
"PasswordForgottenModelBean",
">",
"emailTextField",
"=",
"new",
"LabeledEmailTextFieldPanel",
"<",
"String",
",",
"PasswordForgottenModelBean",
">",
"(",
"id",
",",
"model",
",",
"labelModel",
")",
"{",
"/**\n\t\t\t * The serialVersionUID.\n\t\t\t */",
"private",
"static",
"final",
"long",
"serialVersionUID",
"=",
"1L",
";",
"/**\n\t\t\t * {@inheritDoc}\n\t\t\t */",
"@",
"Override",
"protected",
"EmailTextField",
"newEmailTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"PasswordForgottenModelBean",
">",
"model",
")",
"{",
"final",
"EmailTextField",
"emailTextField",
"=",
"new",
"EmailTextField",
"(",
"id",
",",
"new",
"PropertyModel",
"<>",
"(",
"model",
",",
"\"email\"",
")",
")",
";",
"emailTextField",
".",
"setOutputMarkupId",
"(",
"true",
")",
";",
"emailTextField",
".",
"setRequired",
"(",
"true",
")",
";",
"if",
"(",
"placeholderModel",
"!=",
"null",
")",
"{",
"emailTextField",
".",
"add",
"(",
"new",
"AttributeAppender",
"(",
"\"placeholder\"",
",",
"placeholderModel",
")",
")",
";",
"}",
"return",
"emailTextField",
";",
"}",
"}",
";",
"return",
"emailTextField",
";",
"}"
] |
Factory method for creating the EmailTextField for the email. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a EmailTextField for the email.
@param id
the id
@param model
the model
@return the text field
|
[
"Factory",
"method",
"for",
"creating",
"the",
"EmailTextField",
"for",
"the",
"email",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"version",
"of",
"a",
"EmailTextField",
"for",
"the",
"email",
"."
] |
85d74368d00abd9bb97659b5794e38c0f8a013d4
|
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/password/forgotten/AbstractPasswordForgottenPanel.java#L193-L228
|
145,897
|
ixa-ehu/ixa-pipe-ml
|
src/main/java/eus/ixa/ixa/pipe/ml/parse/ParserEventStream.java
|
ParserEventStream.addParseEvents
|
private void addParseEvents(final List<Event> parseEvents, Parse[] chunks) {
int ci = 0;
while (ci < chunks.length) {
// System.err.println("parserEventStream.addParseEvents: chunks=" +
// Arrays.asList(chunks));
final Parse c = chunks[ci];
final Parse parent = c.getParent();
if (parent != null) {
final String type = parent.getType();
String outcome;
if (firstChild(c, parent)) {
outcome = type + "-" + BioCodec.START;
} else {
outcome = type + "-" + BioCodec.CONTINUE;
}
// System.err.println("parserEventStream.addParseEvents:
// chunks["+ci+"]="+c+" label=" +outcome + " bcg=" + bcg);
c.setLabel(outcome);
if (this.etype == ParserEventTypeEnum.BUILD) {
parseEvents.add(new Event(outcome, this.bcg.getContext(chunks, ci)));
}
int start = ci - 1;
while (start >= 0 && chunks[start].getParent() == parent) {
start--;
}
if (lastChild(c, parent)) {
if (this.etype == ParserEventTypeEnum.CHECK) {
parseEvents.add(new Event(ShiftReduceParser.COMPLETE,
this.kcg.getContext(chunks, type, start + 1, ci)));
}
// perform reduce
int reduceStart = ci;
while (reduceStart >= 0
&& chunks[reduceStart].getParent() == parent) {
reduceStart--;
}
reduceStart++;
chunks = reduceChunks(chunks, ci, parent);
ci = reduceStart - 1; // ci will be incremented at end of loop
} else {
if (this.etype == ParserEventTypeEnum.CHECK) {
parseEvents.add(new Event(ShiftReduceParser.INCOMPLETE,
this.kcg.getContext(chunks, type, start + 1, ci)));
}
}
}
ci++;
}
}
|
java
|
private void addParseEvents(final List<Event> parseEvents, Parse[] chunks) {
int ci = 0;
while (ci < chunks.length) {
// System.err.println("parserEventStream.addParseEvents: chunks=" +
// Arrays.asList(chunks));
final Parse c = chunks[ci];
final Parse parent = c.getParent();
if (parent != null) {
final String type = parent.getType();
String outcome;
if (firstChild(c, parent)) {
outcome = type + "-" + BioCodec.START;
} else {
outcome = type + "-" + BioCodec.CONTINUE;
}
// System.err.println("parserEventStream.addParseEvents:
// chunks["+ci+"]="+c+" label=" +outcome + " bcg=" + bcg);
c.setLabel(outcome);
if (this.etype == ParserEventTypeEnum.BUILD) {
parseEvents.add(new Event(outcome, this.bcg.getContext(chunks, ci)));
}
int start = ci - 1;
while (start >= 0 && chunks[start].getParent() == parent) {
start--;
}
if (lastChild(c, parent)) {
if (this.etype == ParserEventTypeEnum.CHECK) {
parseEvents.add(new Event(ShiftReduceParser.COMPLETE,
this.kcg.getContext(chunks, type, start + 1, ci)));
}
// perform reduce
int reduceStart = ci;
while (reduceStart >= 0
&& chunks[reduceStart].getParent() == parent) {
reduceStart--;
}
reduceStart++;
chunks = reduceChunks(chunks, ci, parent);
ci = reduceStart - 1; // ci will be incremented at end of loop
} else {
if (this.etype == ParserEventTypeEnum.CHECK) {
parseEvents.add(new Event(ShiftReduceParser.INCOMPLETE,
this.kcg.getContext(chunks, type, start + 1, ci)));
}
}
}
ci++;
}
}
|
[
"private",
"void",
"addParseEvents",
"(",
"final",
"List",
"<",
"Event",
">",
"parseEvents",
",",
"Parse",
"[",
"]",
"chunks",
")",
"{",
"int",
"ci",
"=",
"0",
";",
"while",
"(",
"ci",
"<",
"chunks",
".",
"length",
")",
"{",
"// System.err.println(\"parserEventStream.addParseEvents: chunks=\" +",
"// Arrays.asList(chunks));",
"final",
"Parse",
"c",
"=",
"chunks",
"[",
"ci",
"]",
";",
"final",
"Parse",
"parent",
"=",
"c",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"final",
"String",
"type",
"=",
"parent",
".",
"getType",
"(",
")",
";",
"String",
"outcome",
";",
"if",
"(",
"firstChild",
"(",
"c",
",",
"parent",
")",
")",
"{",
"outcome",
"=",
"type",
"+",
"\"-\"",
"+",
"BioCodec",
".",
"START",
";",
"}",
"else",
"{",
"outcome",
"=",
"type",
"+",
"\"-\"",
"+",
"BioCodec",
".",
"CONTINUE",
";",
"}",
"// System.err.println(\"parserEventStream.addParseEvents:",
"// chunks[\"+ci+\"]=\"+c+\" label=\" +outcome + \" bcg=\" + bcg);",
"c",
".",
"setLabel",
"(",
"outcome",
")",
";",
"if",
"(",
"this",
".",
"etype",
"==",
"ParserEventTypeEnum",
".",
"BUILD",
")",
"{",
"parseEvents",
".",
"add",
"(",
"new",
"Event",
"(",
"outcome",
",",
"this",
".",
"bcg",
".",
"getContext",
"(",
"chunks",
",",
"ci",
")",
")",
")",
";",
"}",
"int",
"start",
"=",
"ci",
"-",
"1",
";",
"while",
"(",
"start",
">=",
"0",
"&&",
"chunks",
"[",
"start",
"]",
".",
"getParent",
"(",
")",
"==",
"parent",
")",
"{",
"start",
"--",
";",
"}",
"if",
"(",
"lastChild",
"(",
"c",
",",
"parent",
")",
")",
"{",
"if",
"(",
"this",
".",
"etype",
"==",
"ParserEventTypeEnum",
".",
"CHECK",
")",
"{",
"parseEvents",
".",
"add",
"(",
"new",
"Event",
"(",
"ShiftReduceParser",
".",
"COMPLETE",
",",
"this",
".",
"kcg",
".",
"getContext",
"(",
"chunks",
",",
"type",
",",
"start",
"+",
"1",
",",
"ci",
")",
")",
")",
";",
"}",
"// perform reduce",
"int",
"reduceStart",
"=",
"ci",
";",
"while",
"(",
"reduceStart",
">=",
"0",
"&&",
"chunks",
"[",
"reduceStart",
"]",
".",
"getParent",
"(",
")",
"==",
"parent",
")",
"{",
"reduceStart",
"--",
";",
"}",
"reduceStart",
"++",
";",
"chunks",
"=",
"reduceChunks",
"(",
"chunks",
",",
"ci",
",",
"parent",
")",
";",
"ci",
"=",
"reduceStart",
"-",
"1",
";",
"// ci will be incremented at end of loop",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"etype",
"==",
"ParserEventTypeEnum",
".",
"CHECK",
")",
"{",
"parseEvents",
".",
"add",
"(",
"new",
"Event",
"(",
"ShiftReduceParser",
".",
"INCOMPLETE",
",",
"this",
".",
"kcg",
".",
"getContext",
"(",
"chunks",
",",
"type",
",",
"start",
"+",
"1",
",",
"ci",
")",
")",
")",
";",
"}",
"}",
"}",
"ci",
"++",
";",
"}",
"}"
] |
Adds events for parsing (post tagging and chunking to the specified list of
events for the specified parse chunks.
@param parseEvents
The events for the specified chunks.
@param chunks
The incomplete parses to be parsed.
|
[
"Adds",
"events",
"for",
"parsing",
"(",
"post",
"tagging",
"and",
"chunking",
"to",
"the",
"specified",
"list",
"of",
"events",
"for",
"the",
"specified",
"parse",
"chunks",
"."
] |
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
|
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/parse/ParserEventStream.java#L96-L144
|
145,898
|
geomajas/geomajas-project-client-gwt2
|
server-extension/src/main/java/org/geomajas/gwt2/client/widget/exception/ExceptionCallbackImpl.java
|
ExceptionCallbackImpl.showDialog
|
private void showDialog(String msg, String stack) {
ExceptionDialog warning = new ExceptionDialog(msg, stack);
warning.show();
}
|
java
|
private void showDialog(String msg, String stack) {
ExceptionDialog warning = new ExceptionDialog(msg, stack);
warning.show();
}
|
[
"private",
"void",
"showDialog",
"(",
"String",
"msg",
",",
"String",
"stack",
")",
"{",
"ExceptionDialog",
"warning",
"=",
"new",
"ExceptionDialog",
"(",
"msg",
",",
"stack",
")",
";",
"warning",
".",
"show",
"(",
")",
";",
"}"
] |
Makes a dialog box to show exception message and stack trace.
@param msg
error message
@param stack
stack trace
|
[
"Makes",
"a",
"dialog",
"box",
"to",
"show",
"exception",
"message",
"and",
"stack",
"trace",
"."
] |
bd8d7904e861fa80522eed7b83c4ea99844180c7
|
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/server-extension/src/main/java/org/geomajas/gwt2/client/widget/exception/ExceptionCallbackImpl.java#L115-L118
|
145,899
|
netheosgithub/pcs_api
|
java/src/main/java/net/netheos/pcsapi/providers/googledrive/GoogleDrive.java
|
GoogleDrive.rawCreateFolder
|
private String rawCreateFolder( CPath path, String parentId )
{
JSONObject body = new JSONObject();
body.put( "title", path.getBaseName() );
body.put( "mimeType", MIME_TYPE_DIRECTORY );
JSONArray ids = new JSONArray();
JSONObject idObj = new JSONObject();
idObj.put( "id", parentId );
ids.put( idObj );
body.put( "parents", ids );
HttpPost request = new HttpPost( FILES_ENDPOINT + "?fields=id" );
request.setEntity( new JSONEntity( body ) );
RequestInvoker<CResponse> ri = getApiRequestInvoker( request, path );
JSONObject jresp = retryStrategy.invokeRetry( ri ).asJSONObject();
return jresp.getString( "id" );
}
|
java
|
private String rawCreateFolder( CPath path, String parentId )
{
JSONObject body = new JSONObject();
body.put( "title", path.getBaseName() );
body.put( "mimeType", MIME_TYPE_DIRECTORY );
JSONArray ids = new JSONArray();
JSONObject idObj = new JSONObject();
idObj.put( "id", parentId );
ids.put( idObj );
body.put( "parents", ids );
HttpPost request = new HttpPost( FILES_ENDPOINT + "?fields=id" );
request.setEntity( new JSONEntity( body ) );
RequestInvoker<CResponse> ri = getApiRequestInvoker( request, path );
JSONObject jresp = retryStrategy.invokeRetry( ri ).asJSONObject();
return jresp.getString( "id" );
}
|
[
"private",
"String",
"rawCreateFolder",
"(",
"CPath",
"path",
",",
"String",
"parentId",
")",
"{",
"JSONObject",
"body",
"=",
"new",
"JSONObject",
"(",
")",
";",
"body",
".",
"put",
"(",
"\"title\"",
",",
"path",
".",
"getBaseName",
"(",
")",
")",
";",
"body",
".",
"put",
"(",
"\"mimeType\"",
",",
"MIME_TYPE_DIRECTORY",
")",
";",
"JSONArray",
"ids",
"=",
"new",
"JSONArray",
"(",
")",
";",
"JSONObject",
"idObj",
"=",
"new",
"JSONObject",
"(",
")",
";",
"idObj",
".",
"put",
"(",
"\"id\"",
",",
"parentId",
")",
";",
"ids",
".",
"put",
"(",
"idObj",
")",
";",
"body",
".",
"put",
"(",
"\"parents\"",
",",
"ids",
")",
";",
"HttpPost",
"request",
"=",
"new",
"HttpPost",
"(",
"FILES_ENDPOINT",
"+",
"\"?fields=id\"",
")",
";",
"request",
".",
"setEntity",
"(",
"new",
"JSONEntity",
"(",
"body",
")",
")",
";",
"RequestInvoker",
"<",
"CResponse",
">",
"ri",
"=",
"getApiRequestInvoker",
"(",
"request",
",",
"path",
")",
";",
"JSONObject",
"jresp",
"=",
"retryStrategy",
".",
"invokeRetry",
"(",
"ri",
")",
".",
"asJSONObject",
"(",
")",
";",
"return",
"jresp",
".",
"getString",
"(",
"\"id\"",
")",
";",
"}"
] |
Create a folder without creating any higher level intermediate folders, and returned id of created folder.
@param path
@param parentId
@return id of created folder
|
[
"Create",
"a",
"folder",
"without",
"creating",
"any",
"higher",
"level",
"intermediate",
"folders",
"and",
"returned",
"id",
"of",
"created",
"folder",
"."
] |
20691e52e144014f99ca75cb7dedc7ba0c18586c
|
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/googledrive/GoogleDrive.java#L374-L391
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.