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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
asciidoctor/asciidoclet | src/main/java/org/asciidoctor/asciidoclet/DocletIterator.java | DocletIterator.renderClass | private void renderClass(ClassDoc doc, DocletRenderer renderer) {
//handle the various parts of the Class doc
renderer.renderDoc(doc);
for (MemberDoc member : doc.fields()) {
renderer.renderDoc(member);
}
for (MemberDoc member : doc.constructors()) {
rende... | java | private void renderClass(ClassDoc doc, DocletRenderer renderer) {
//handle the various parts of the Class doc
renderer.renderDoc(doc);
for (MemberDoc member : doc.fields()) {
renderer.renderDoc(member);
}
for (MemberDoc member : doc.constructors()) {
rende... | [
"private",
"void",
"renderClass",
"(",
"ClassDoc",
"doc",
",",
"DocletRenderer",
"renderer",
")",
"{",
"//handle the various parts of the Class doc",
"renderer",
".",
"renderDoc",
"(",
"doc",
")",
";",
"for",
"(",
"MemberDoc",
"member",
":",
"doc",
".",
"fields",
... | Renders an individual class.
@param doc input | [
"Renders",
"an",
"individual",
"class",
"."
] | 6c43ce214e48797d2b5e8d59c31b65304279717b | https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/asciidoclet/DocletIterator.java#L69-L89 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java | SignedJarBuilder.close | public void close() throws IOException, GeneralSecurityException {
if (mManifest != null) {
// write the manifest to the jar file
mOutputJar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME));
mManifest.write(mOutputJar);
// CERT.SF
Signature signature... | java | public void close() throws IOException, GeneralSecurityException {
if (mManifest != null) {
// write the manifest to the jar file
mOutputJar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME));
mManifest.write(mOutputJar);
// CERT.SF
Signature signature... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"if",
"(",
"mManifest",
"!=",
"null",
")",
"{",
"// write the manifest to the jar file",
"mOutputJar",
".",
"putNextEntry",
"(",
"new",
"JarEntry",
"(",
"JarFile",
... | Closes the Jar archive by creating the manifest, and signing the archive.
@throws IOException
@throws GeneralSecurityException | [
"Closes",
"the",
"Jar",
"archive",
"by",
"creating",
"the",
"manifest",
"and",
"signing",
"the",
"archive",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java#L242-L267 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java | SignedJarBuilder.writeSignatureBlock | private void writeSignatureBlock(Signature signature, X509Certificate publicKey,
PrivateKey privateKey)
throws IOException, GeneralSecurityException {
SignerInfo signerInfo = new SignerInfo(
new X500Name(publicKey.getIssuerX500Principal().getName()),
publi... | java | private void writeSignatureBlock(Signature signature, X509Certificate publicKey,
PrivateKey privateKey)
throws IOException, GeneralSecurityException {
SignerInfo signerInfo = new SignerInfo(
new X500Name(publicKey.getIssuerX500Principal().getName()),
publi... | [
"private",
"void",
"writeSignatureBlock",
"(",
"Signature",
"signature",
",",
"X509Certificate",
"publicKey",
",",
"PrivateKey",
"privateKey",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"SignerInfo",
"signerInfo",
"=",
"new",
"SignerInfo",
"(",
... | Write the certificate file with a digital signature. | [
"Write",
"the",
"certificate",
"file",
"with",
"a",
"digital",
"signature",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java#L365-L382 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/AndroidExtension.java | AndroidExtension.validate | public void validate() {
// check if android build tool version is at least minimal required version
Revision revBuildToolsVersion = Revision.parseRevision(buildToolsVersion);
if (minimalBuildToolsVersion.compareTo(revBuildToolsVersion) > 0) {
throw new GradleException("Android build... | java | public void validate() {
// check if android build tool version is at least minimal required version
Revision revBuildToolsVersion = Revision.parseRevision(buildToolsVersion);
if (minimalBuildToolsVersion.compareTo(revBuildToolsVersion) > 0) {
throw new GradleException("Android build... | [
"public",
"void",
"validate",
"(",
")",
"{",
"// check if android build tool version is at least minimal required version",
"Revision",
"revBuildToolsVersion",
"=",
"Revision",
".",
"parseRevision",
"(",
"buildToolsVersion",
")",
";",
"if",
"(",
"minimalBuildToolsVersion",
".... | Checks whether the properties on the android extension are valid after
everything was configured. | [
"Checks",
"whether",
"the",
"properties",
"on",
"the",
"android",
"extension",
"are",
"valid",
"after",
"everything",
"was",
"configured",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/AndroidExtension.java#L404-L426 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.getDebugKey | public static SigningInfo getDebugKey(String storeOsPath, final PrintStream verboseStream)
throws ApkCreationException {
try {
if (storeOsPath != null) {
File storeFile = new File(storeOsPath);
try {
checkInputFile(storeFile);
... | java | public static SigningInfo getDebugKey(String storeOsPath, final PrintStream verboseStream)
throws ApkCreationException {
try {
if (storeOsPath != null) {
File storeFile = new File(storeOsPath);
try {
checkInputFile(storeFile);
... | [
"public",
"static",
"SigningInfo",
"getDebugKey",
"(",
"String",
"storeOsPath",
",",
"final",
"PrintStream",
"verboseStream",
")",
"throws",
"ApkCreationException",
"{",
"try",
"{",
"if",
"(",
"storeOsPath",
"!=",
"null",
")",
"{",
"File",
"storeFile",
"=",
"new... | Returns the key and certificate from a given debug store.
It is expected that the store password is 'android' and the key alias and password are
'androiddebugkey' and 'android' respectively.
@param storeOsPath the OS path to the debug store.
@param verboseStream an option {@link PrintStream} to display verbose inform... | [
"Returns",
"the",
"key",
"and",
"certificate",
"from",
"a",
"given",
"debug",
"store",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L288-L357 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.init | private void init(File apkFile, File resFile, File dexFile, PrivateKey key,
X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException {
try {
checkOutputFile(mApkFile = apkFile);
checkInputFile(mResFile = resFile);
if (dexFile != null) {... | java | private void init(File apkFile, File resFile, File dexFile, PrivateKey key,
X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException {
try {
checkOutputFile(mApkFile = apkFile);
checkInputFile(mResFile = resFile);
if (dexFile != null) {... | [
"private",
"void",
"init",
"(",
"File",
"apkFile",
",",
"File",
"resFile",
",",
"File",
"dexFile",
",",
"PrivateKey",
"key",
",",
"X509Certificate",
"certificate",
",",
"PrintStream",
"verboseStream",
")",
"throws",
"ApkCreationException",
"{",
"try",
"{",
"chec... | Constructor init method.
@see #ApkBuilder(File, File, File, String, PackagingOptions, PrintStream)
@see #ApkBuilder(String, String, String, String, PackagingOptions, PrintStream)
@see #ApkBuilder(File, File, File, PrivateKey, X509Certificate, PackagingOptions, PrintStream) | [
"Constructor",
"init",
"method",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L486-L524 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.addFile | @Override
public void addFile(File file, String archivePath) throws ApkCreationException,
SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
doAddFile(file, archivePath);
} ... | java | @Override
public void addFile(File file, String archivePath) throws ApkCreationException,
SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
doAddFile(file, archivePath);
} ... | [
"@",
"Override",
"public",
"void",
"addFile",
"(",
"File",
"file",
",",
"String",
"archivePath",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
",",
"DuplicateFileException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkExcep... | Adds a file to the APK at a given path
@param file the file to add
@param archivePath the path of the file inside the APK archive.
@throws ApkCreationException if an error occurred
@throws SealedApkException if the APK is already sealed.
@throws DuplicateFileException if a file conflicts with another already added to t... | [
"Adds",
"a",
"file",
"to",
"the",
"APK",
"at",
"a",
"given",
"path"
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L552-L568 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.addZipFile | public void addZipFile(File zipFile) throws ApkCreationException, SealedApkException,
DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
verbosePrintln("%s:", zipFile);
// reset the filter wit... | java | public void addZipFile(File zipFile) throws ApkCreationException, SealedApkException,
DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
verbosePrintln("%s:", zipFile);
// reset the filter wit... | [
"public",
"void",
"addZipFile",
"(",
"File",
"zipFile",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
",",
"DuplicateFileException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkException",
"(",
"\"APK is already sealed\"",
")",... | Adds the content from a zip file.
All file keep the same path inside the archive.
@param zipFile the zip File.
@throws ApkCreationException if an error occurred
@throws SealedApkException if the APK is already sealed.
@throws DuplicateFileException if a file conflicts with another already added to the APK
at the same l... | [
"Adds",
"the",
"content",
"from",
"a",
"zip",
"file",
".",
"All",
"file",
"keep",
"the",
"same",
"path",
"inside",
"the",
"archive",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L579-L602 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.addResourcesFromJar | public JarStatus addResourcesFromJar(File jarFile) throws ApkCreationException,
SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
verbosePrintln("%s:", jarFile);
// reset ... | java | public JarStatus addResourcesFromJar(File jarFile) throws ApkCreationException,
SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
verbosePrintln("%s:", jarFile);
// reset ... | [
"public",
"JarStatus",
"addResourcesFromJar",
"(",
"File",
"jarFile",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
",",
"DuplicateFileException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkException",
"(",
"\"APK is already sea... | Adds the resources from a jar file.
@param jarFile the jar File.
@return a {@link JarStatus} object indicating if native libraries where found in
the jar file.
@throws ApkCreationException if an error occurred
@throws SealedApkException if the APK is already sealed.
@throws DuplicateFileException if a file conflicts wi... | [
"Adds",
"the",
"resources",
"from",
"a",
"jar",
"file",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L614-L642 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.addSourceFolder | public void addSourceFolder(File sourceFolder) throws ApkCreationException, SealedApkException,
DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
addSourceFolder(this, sourceFolder);
} | java | public void addSourceFolder(File sourceFolder) throws ApkCreationException, SealedApkException,
DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
addSourceFolder(this, sourceFolder);
} | [
"public",
"void",
"addSourceFolder",
"(",
"File",
"sourceFolder",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
",",
"DuplicateFileException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkException",
"(",
"\"APK is already sealed\... | Adds the resources from a source folder.
@param sourceFolder the source folder.
@throws ApkCreationException if an error occurred
@throws SealedApkException if the APK is already sealed.
@throws DuplicateFileException if a file conflicts with another already added to the APK
at the same location inside the APK archive. | [
"Adds",
"the",
"resources",
"from",
"a",
"source",
"folder",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L652-L659 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.addNativeLibraries | public void addNativeLibraries(File nativeFolder)
throws ApkCreationException, SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
if (!nativeFolder.isDirectory()) {
// not a directory? check ... | java | public void addNativeLibraries(File nativeFolder)
throws ApkCreationException, SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
if (!nativeFolder.isDirectory()) {
// not a directory? check ... | [
"public",
"void",
"addNativeLibraries",
"(",
"File",
"nativeFolder",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
",",
"DuplicateFileException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkException",
"(",
"\"APK is already seal... | Adds the native libraries from the top native folder.
The content of this folder must be the various ABI folders.
This may or may not copy gdbserver into the apk based on whether the debug mode is set.
@param nativeFolder the native folder.
@throws ApkCreationException if an error occurred
@throws SealedApkException... | [
"Adds",
"the",
"native",
"libraries",
"from",
"the",
"top",
"native",
"folder",
".",
"The",
"content",
"of",
"this",
"folder",
"must",
"be",
"the",
"various",
"ABI",
"folders",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L709-L759 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.sealApk | public void sealApk() throws ApkCreationException, SealedApkException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
// close and sign the application package.
try {
mBuilder.close();
mIsSealed = true;
} catch (Exc... | java | public void sealApk() throws ApkCreationException, SealedApkException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
// close and sign the application package.
try {
mBuilder.close();
mIsSealed = true;
} catch (Exc... | [
"public",
"void",
"sealApk",
"(",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkException",
"(",
"\"APK is already sealed\"",
")",
";",
"}",
"// close and sign the application package."... | Seals the APK, and signs it if necessary.
@throws ApkCreationException
@throws ApkCreationException if an error occurred
@throws SealedApkException if the APK is already sealed. | [
"Seals",
"the",
"APK",
"and",
"signs",
"it",
"if",
"necessary",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L841-L855 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.verbosePrintln | private void verbosePrintln(String format, Object... args) {
if (mVerboseStream != null) {
mVerboseStream.println(String.format(format, args));
}
} | java | private void verbosePrintln(String format, Object... args) {
if (mVerboseStream != null) {
mVerboseStream.println(String.format(format, args));
}
} | [
"private",
"void",
"verbosePrintln",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"mVerboseStream",
"!=",
"null",
")",
"{",
"mVerboseStream",
".",
"println",
"(",
"String",
".",
"format",
"(",
"format",
",",
"args",
")",
")... | Output a given message if the verbose mode is enabled.
@param format the format string for {@link String#format(String, Object...)}
@param args the string arguments | [
"Output",
"a",
"given",
"message",
"if",
"the",
"verbose",
"mode",
"is",
"enabled",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L862-L866 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.checkFolderForPackaging | public static boolean checkFolderForPackaging(String folderName) {
return !folderName.equalsIgnoreCase("CVS") &&
!folderName.equalsIgnoreCase(".svn") &&
!folderName.equalsIgnoreCase("SCCS") &&
!folderName.startsWith("_");
} | java | public static boolean checkFolderForPackaging(String folderName) {
return !folderName.equalsIgnoreCase("CVS") &&
!folderName.equalsIgnoreCase(".svn") &&
!folderName.equalsIgnoreCase("SCCS") &&
!folderName.startsWith("_");
} | [
"public",
"static",
"boolean",
"checkFolderForPackaging",
"(",
"String",
"folderName",
")",
"{",
"return",
"!",
"folderName",
".",
"equalsIgnoreCase",
"(",
"\"CVS\"",
")",
"&&",
"!",
"folderName",
".",
"equalsIgnoreCase",
"(",
"\".svn\"",
")",
"&&",
"!",
"folder... | Checks whether a folder and its content is valid for packaging into the .apk as
standard Java resource.
@param folderName the name of the folder. | [
"Checks",
"whether",
"a",
"folder",
"and",
"its",
"content",
"is",
"valid",
"for",
"packaging",
"into",
"the",
".",
"apk",
"as",
"standard",
"Java",
"resource",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L1008-L1013 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/DownConfiguration.java | DownConfiguration.applyConfiguration | public void applyConfiguration(Configuration configuration) {
if (plugins != null) {
plugins.stream()
.filter(pluginDefinition -> pluginDefinition.isConfigurationSupported(configuration))
.forEach(pluginDefinition -> project.getDependencies().add(configuration... | java | public void applyConfiguration(Configuration configuration) {
if (plugins != null) {
plugins.stream()
.filter(pluginDefinition -> pluginDefinition.isConfigurationSupported(configuration))
.forEach(pluginDefinition -> project.getDependencies().add(configuration... | [
"public",
"void",
"applyConfiguration",
"(",
"Configuration",
"configuration",
")",
"{",
"if",
"(",
"plugins",
"!=",
"null",
")",
"{",
"plugins",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"pluginDefinition",
"->",
"pluginDefinition",
".",
"isConfigurationSupp... | Add dependencies to the specified configuration. Only dependencies to plugins that support the provided
configuration will be included.
@param configuration the configuration where the plugin dependencies are added to | [
"Add",
"dependencies",
"to",
"the",
"specified",
"configuration",
".",
"Only",
"dependencies",
"to",
"plugins",
"that",
"support",
"the",
"provided",
"configuration",
"will",
"be",
"included",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/DownConfiguration.java#L108-L114 | train |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/MergeResources.java | MergeResources.computeResourceSetList | List<ResourceSet> computeResourceSetList() {
List<ResourceSet> sourceFolderSets = resSetSupplier.get();
int size = sourceFolderSets.size() + 4;
if (libraries != null) {
size += libraries.getArtifacts().size();
}
List<ResourceSet> resourceSetList = Lists.newArrayListW... | java | List<ResourceSet> computeResourceSetList() {
List<ResourceSet> sourceFolderSets = resSetSupplier.get();
int size = sourceFolderSets.size() + 4;
if (libraries != null) {
size += libraries.getArtifacts().size();
}
List<ResourceSet> resourceSetList = Lists.newArrayListW... | [
"List",
"<",
"ResourceSet",
">",
"computeResourceSetList",
"(",
")",
"{",
"List",
"<",
"ResourceSet",
">",
"sourceFolderSets",
"=",
"resSetSupplier",
".",
"get",
"(",
")",
";",
"int",
"size",
"=",
"sourceFolderSets",
".",
"size",
"(",
")",
"+",
"4",
";",
... | Compute the list of resource set to be used during execution based all the inputs. | [
"Compute",
"the",
"list",
"of",
"resource",
"set",
"to",
"be",
"used",
"during",
"execution",
"based",
"all",
"the",
"inputs",
"."
] | a9bef513b7e1bfa85f9a668226e6943c6d9f847f | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/MergeResources.java#L536-L581 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java | AbstractUserAgentStringParser.examineAsBrowser | private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) {
Matcher matcher;
VersionNumber version = VersionNumber.UNKNOWN;
for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) {
matcher = entry.getKey().getPattern().matcher(builder.getUserAge... | java | private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) {
Matcher matcher;
VersionNumber version = VersionNumber.UNKNOWN;
for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) {
matcher = entry.getKey().getPattern().matcher(builder.getUserAge... | [
"private",
"static",
"void",
"examineAsBrowser",
"(",
"final",
"UserAgent",
".",
"Builder",
"builder",
",",
"final",
"Data",
"data",
")",
"{",
"Matcher",
"matcher",
";",
"VersionNumber",
"version",
"=",
"VersionNumber",
".",
"UNKNOWN",
";",
"for",
"(",
"final"... | Examines the user agent string whether it is a browser.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information | [
"Examines",
"the",
"user",
"agent",
"string",
"whether",
"it",
"is",
"a",
"browser",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L54-L72 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java | AbstractUserAgentStringParser.examineAsRobot | private static boolean examineAsRobot(final UserAgent.Builder builder, final Data data) {
boolean isRobot = false;
VersionNumber version;
for (final Robot robot : data.getRobots()) {
if (robot.getUserAgentString().equals(builder.getUserAgentString())) {
isRobot = true;
robot.copyTo(builder);
// tr... | java | private static boolean examineAsRobot(final UserAgent.Builder builder, final Data data) {
boolean isRobot = false;
VersionNumber version;
for (final Robot robot : data.getRobots()) {
if (robot.getUserAgentString().equals(builder.getUserAgentString())) {
isRobot = true;
robot.copyTo(builder);
// tr... | [
"private",
"static",
"boolean",
"examineAsRobot",
"(",
"final",
"UserAgent",
".",
"Builder",
"builder",
",",
"final",
"Data",
"data",
")",
"{",
"boolean",
"isRobot",
"=",
"false",
";",
"VersionNumber",
"version",
";",
"for",
"(",
"final",
"Robot",
"robot",
"... | Examines the user agent string whether it is a robot.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information
@return {@code true} if it is a robot, otherwise {@code false} | [
"Examines",
"the",
"user",
"agent",
"string",
"whether",
"it",
"is",
"a",
"robot",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L83-L99 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java | AbstractUserAgentStringParser.examineDeviceCategory | private static void examineDeviceCategory(final UserAgent.Builder builder, final Data data) {
// a robot will be classified as 'Other'
if (UserAgentType.ROBOT == builder.getType()) {
final DeviceCategory category = findDeviceCategoryByValue(Category.OTHER, data);
builder.setDeviceCategory(category);
retur... | java | private static void examineDeviceCategory(final UserAgent.Builder builder, final Data data) {
// a robot will be classified as 'Other'
if (UserAgentType.ROBOT == builder.getType()) {
final DeviceCategory category = findDeviceCategoryByValue(Category.OTHER, data);
builder.setDeviceCategory(category);
retur... | [
"private",
"static",
"void",
"examineDeviceCategory",
"(",
"final",
"UserAgent",
".",
"Builder",
"builder",
",",
"final",
"Data",
"data",
")",
"{",
"// a robot will be classified as 'Other'",
"if",
"(",
"UserAgentType",
".",
"ROBOT",
"==",
"builder",
".",
"getType",... | Examines the user agent string whether has a specific device category.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information | [
"Examines",
"the",
"user",
"agent",
"string",
"whether",
"has",
"a",
"specific",
"device",
"category",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L109-L153 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java | AbstractUserAgentStringParser.examineOperatingSystem | private static void examineOperatingSystem(final UserAgent.Builder builder, final Data data) {
if (net.sf.uadetector.OperatingSystem.EMPTY.equals(builder.getOperatingSystem())) {
for (final Entry<OperatingSystemPattern, OperatingSystem> entry : data.getPatternToOperatingSystemMap().entrySet()) {
final Matcher ... | java | private static void examineOperatingSystem(final UserAgent.Builder builder, final Data data) {
if (net.sf.uadetector.OperatingSystem.EMPTY.equals(builder.getOperatingSystem())) {
for (final Entry<OperatingSystemPattern, OperatingSystem> entry : data.getPatternToOperatingSystemMap().entrySet()) {
final Matcher ... | [
"private",
"static",
"void",
"examineOperatingSystem",
"(",
"final",
"UserAgent",
".",
"Builder",
"builder",
",",
"final",
"Data",
"data",
")",
"{",
"if",
"(",
"net",
".",
"sf",
".",
"uadetector",
".",
"OperatingSystem",
".",
"EMPTY",
".",
"equals",
"(",
"... | Examines the operating system of the user agent string, if not available.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information | [
"Examines",
"the",
"operating",
"system",
"of",
"the",
"user",
"agent",
"string",
"if",
"not",
"available",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L163-L173 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/CompareNullSafe.java | CompareNullSafe.compare | @Override
public int compare(final T o1, final T o2) {
int result = 0;
if (o1 == null) {
if (o2 != null) {
result = -1;
}
} else if (o2 == null) {
result = 1;
} else {
result = compareType(o1, o2);
}
return result;
} | java | @Override
public int compare(final T o1, final T o2) {
int result = 0;
if (o1 == null) {
if (o2 != null) {
result = -1;
}
} else if (o2 == null) {
result = 1;
} else {
result = compareType(o1, o2);
}
return result;
} | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"final",
"T",
"o1",
",",
"final",
"T",
"o2",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"o1",
"==",
"null",
")",
"{",
"if",
"(",
"o2",
"!=",
"null",
")",
"{",
"result",
"=",
"-",
"1"... | Compares two objects null safe to each other.
@param o1
the first reference
@param o2
the second reference
@return a negative value if o1 < o2, zero if o1 = o2 and a positive value if o1 > o2 | [
"Compares",
"two",
"objects",
"null",
"safe",
"to",
"each",
"other",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/CompareNullSafe.java#L53-L66 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/BrowserPattern.java | BrowserPattern.compareInt | private static int compareInt(final int a, final int b) {
int result = 0;
if (a > b) {
result = 1;
} else if (a < b) {
result = -1;
}
return result;
} | java | private static int compareInt(final int a, final int b) {
int result = 0;
if (a > b) {
result = 1;
} else if (a < b) {
result = -1;
}
return result;
} | [
"private",
"static",
"int",
"compareInt",
"(",
"final",
"int",
"a",
",",
"final",
"int",
"b",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"a",
">",
"b",
")",
"{",
"result",
"=",
"1",
";",
"}",
"else",
"if",
"(",
"a",
"<",
"b",
")",
... | Compares to integers.
@param a
first integer
@param b
second integer
@return {@code -1} if {@code a} is less, {@code 0} if equal, or {@code 1} if greater than {@code b} | [
"Compares",
"to",
"integers",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/BrowserPattern.java#L198-L206 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java | AbstractUpdateOperation.hasUpdate | static boolean hasUpdate(final String newer, final String older) {
return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false;
} | java | static boolean hasUpdate(final String newer, final String older) {
return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false;
} | [
"static",
"boolean",
"hasUpdate",
"(",
"final",
"String",
"newer",
",",
"final",
"String",
"older",
")",
"{",
"return",
"VERSION_PATTERN",
".",
"matcher",
"(",
"newer",
")",
".",
"matches",
"(",
")",
"&&",
"VERSION_PATTERN",
".",
"matcher",
"(",
"older",
"... | Checks a given newer version against an older one.
@param newer
possible newer version
@param older
possible older version
@return {@code true} if the first argument is newer than the second argument, otherwise {@code false} | [
"Checks",
"a",
"given",
"newer",
"version",
"against",
"an",
"older",
"one",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java#L103-L105 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java | AbstractUpdateOperation.isUpdateAvailable | protected boolean isUpdateAvailable() {
boolean result = false;
String version = EMPTY_VERSION;
try {
version = retrieveRemoteVersion(store.getVersionUrl(), store.getCharset());
} catch (final IOException e) {
LOG.info(MSG_NO_UPDATE_CHECK_POSSIBLE);
LOG.debug(String.format(MSG_NO_UPDATE_CHECK_POSSIBLE_... | java | protected boolean isUpdateAvailable() {
boolean result = false;
String version = EMPTY_VERSION;
try {
version = retrieveRemoteVersion(store.getVersionUrl(), store.getCharset());
} catch (final IOException e) {
LOG.info(MSG_NO_UPDATE_CHECK_POSSIBLE);
LOG.debug(String.format(MSG_NO_UPDATE_CHECK_POSSIBLE_... | [
"protected",
"boolean",
"isUpdateAvailable",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"String",
"version",
"=",
"EMPTY_VERSION",
";",
"try",
"{",
"version",
"=",
"retrieveRemoteVersion",
"(",
"store",
".",
"getVersionUrl",
"(",
")",
",",
"store",... | Fetches the current version information over HTTP and compares it with the last version of the most recently
imported data.
@return {@code true} if an update exists, otherwise {@code false} | [
"Fetches",
"the",
"current",
"version",
"information",
"over",
"HTTP",
"and",
"compares",
"it",
"with",
"the",
"last",
"version",
"of",
"the",
"most",
"recently",
"imported",
"data",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractUpdateOperation.java#L175-L192 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java | DataBuilder.appendBrowserPattern | @Nonnull
public DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern) {
Check.notNull(pattern, "pattern");
if (!browserPatterns.containsKey(pattern.getId())) {
browserPatterns.put(pattern.getId(), new TreeSet<BrowserPattern>(BROWSER_PATTERN_COMPARATOR));
}
browserPatterns.get(pattern.getI... | java | @Nonnull
public DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern) {
Check.notNull(pattern, "pattern");
if (!browserPatterns.containsKey(pattern.getId())) {
browserPatterns.put(pattern.getId(), new TreeSet<BrowserPattern>(BROWSER_PATTERN_COMPARATOR));
}
browserPatterns.get(pattern.getI... | [
"@",
"Nonnull",
"public",
"DataBuilder",
"appendBrowserPattern",
"(",
"@",
"Nonnull",
"final",
"BrowserPattern",
"pattern",
")",
"{",
"Check",
".",
"notNull",
"(",
"pattern",
",",
"\"pattern\"",
")",
";",
"if",
"(",
"!",
"browserPatterns",
".",
"containsKey",
... | Appends a browser pattern to the map of pattern sorted by ID.
@param pattern
a pattern for a browser
@return itself
@throws net.sf.qualitycheck.exception.IllegalNullArgumentException
if the given argument is {@code null} | [
"Appends",
"a",
"browser",
"pattern",
"to",
"the",
"map",
"of",
"pattern",
"sorted",
"by",
"ID",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java#L303-L312 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java | DataBuilder.appendDevicePattern | @Nonnull
public DataBuilder appendDevicePattern(@Nonnull final DevicePattern pattern) {
Check.notNull(pattern, "pattern");
if (!devicePatterns.containsKey(pattern.getId())) {
devicePatterns.put(pattern.getId(), new TreeSet<DevicePattern>(DEVICE_PATTERN_COMPARATOR));
}
devicePatterns.get(pattern.getId()).ad... | java | @Nonnull
public DataBuilder appendDevicePattern(@Nonnull final DevicePattern pattern) {
Check.notNull(pattern, "pattern");
if (!devicePatterns.containsKey(pattern.getId())) {
devicePatterns.put(pattern.getId(), new TreeSet<DevicePattern>(DEVICE_PATTERN_COMPARATOR));
}
devicePatterns.get(pattern.getId()).ad... | [
"@",
"Nonnull",
"public",
"DataBuilder",
"appendDevicePattern",
"(",
"@",
"Nonnull",
"final",
"DevicePattern",
"pattern",
")",
"{",
"Check",
".",
"notNull",
"(",
"pattern",
",",
"\"pattern\"",
")",
";",
"if",
"(",
"!",
"devicePatterns",
".",
"containsKey",
"("... | Appends a device pattern to the map of pattern sorted by ID.
@param pattern
a pattern for a device
@return itself
@throws net.sf.qualitycheck.exception.IllegalNullArgumentException
if the given argument is {@code null} | [
"Appends",
"a",
"device",
"pattern",
"to",
"the",
"map",
"of",
"pattern",
"sorted",
"by",
"ID",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java#L364-L373 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java | DataBuilder.appendOperatingSystemPattern | @Nonnull
public DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern) {
Check.notNull(pattern, "pattern");
if (!operatingSystemPatterns.containsKey(pattern.getId())) {
operatingSystemPatterns.put(pattern.getId(), new TreeSet<OperatingSystemPattern>(OS_PATTERN_COMPARATOR));
}... | java | @Nonnull
public DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern) {
Check.notNull(pattern, "pattern");
if (!operatingSystemPatterns.containsKey(pattern.getId())) {
operatingSystemPatterns.put(pattern.getId(), new TreeSet<OperatingSystemPattern>(OS_PATTERN_COMPARATOR));
}... | [
"@",
"Nonnull",
"public",
"DataBuilder",
"appendOperatingSystemPattern",
"(",
"@",
"Nonnull",
"final",
"OperatingSystemPattern",
"pattern",
")",
"{",
"Check",
".",
"notNull",
"(",
"pattern",
",",
"\"pattern\"",
")",
";",
"if",
"(",
"!",
"operatingSystemPatterns",
... | Appends an operating system pattern to the map of pattern sorted by ID.
@param pattern
a pattern for a browser
@throws net.sf.qualitycheck.exception.IllegalNullArgumentException
if the pattern is {@code null}
@return itself | [
"Appends",
"an",
"operating",
"system",
"pattern",
"to",
"the",
"map",
"of",
"pattern",
"sorted",
"by",
"ID",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/DataBuilder.java#L417-L427 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/UpdatingUserAgentStringParserImpl.java | UpdatingUserAgentStringParserImpl.setUpUpdateService | private void setUpUpdateService() {
if (currentUpdateTask != null) {
currentUpdateTask.cancel(false);
}
currentUpdateTask = scheduler.scheduleWithFixedDelay(getDataStore().getUpdateOperation(), 0, updateInterval, MILLISECONDS);
} | java | private void setUpUpdateService() {
if (currentUpdateTask != null) {
currentUpdateTask.cancel(false);
}
currentUpdateTask = scheduler.scheduleWithFixedDelay(getDataStore().getUpdateOperation(), 0, updateInterval, MILLISECONDS);
} | [
"private",
"void",
"setUpUpdateService",
"(",
")",
"{",
"if",
"(",
"currentUpdateTask",
"!=",
"null",
")",
"{",
"currentUpdateTask",
".",
"cancel",
"(",
"false",
")",
";",
"}",
"currentUpdateTask",
"=",
"scheduler",
".",
"scheduleWithFixedDelay",
"(",
"getDataSt... | Set up a new update service to get newer UAS data | [
"Set",
"up",
"a",
"new",
"update",
"service",
"to",
"get",
"newer",
"UAS",
"data"
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/UpdatingUserAgentStringParserImpl.java#L102-L107 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java | OperatingSystem.copyTo | public void copyTo(@Nonnull final UserAgent.Builder builder) {
final OperatingSystemFamily f = OperatingSystemFamily.evaluate(family);
final VersionNumber version = VersionNumber.parseOperatingSystemVersion(f, builder.getUserAgentString());
builder.setOperatingSystem(new net.sf.uadetector.OperatingSystem(f, famil... | java | public void copyTo(@Nonnull final UserAgent.Builder builder) {
final OperatingSystemFamily f = OperatingSystemFamily.evaluate(family);
final VersionNumber version = VersionNumber.parseOperatingSystemVersion(f, builder.getUserAgentString());
builder.setOperatingSystem(new net.sf.uadetector.OperatingSystem(f, famil... | [
"public",
"void",
"copyTo",
"(",
"@",
"Nonnull",
"final",
"UserAgent",
".",
"Builder",
"builder",
")",
"{",
"final",
"OperatingSystemFamily",
"f",
"=",
"OperatingSystemFamily",
".",
"evaluate",
"(",
"family",
")",
";",
"final",
"VersionNumber",
"version",
"=",
... | Copies all information of the current operating system entry to the given user agent builder.
@param builder
user agent builder | [
"Copies",
"all",
"information",
"of",
"the",
"current",
"operating",
"system",
"entry",
"to",
"the",
"given",
"user",
"agent",
"builder",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/domain/OperatingSystem.java#L305-L309 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java | UpdateOperationWithCacheFileTask.createTemporaryFile | protected static File createTemporaryFile(@Nonnull final File file) {
Check.notNull(file, "file");
final File tempFile = new File(file.getParent(), file.getName() + ".temp");
// remove orphaned temporary file
deleteFile(tempFile);
return tempFile;
} | java | protected static File createTemporaryFile(@Nonnull final File file) {
Check.notNull(file, "file");
final File tempFile = new File(file.getParent(), file.getName() + ".temp");
// remove orphaned temporary file
deleteFile(tempFile);
return tempFile;
} | [
"protected",
"static",
"File",
"createTemporaryFile",
"(",
"@",
"Nonnull",
"final",
"File",
"file",
")",
"{",
"Check",
".",
"notNull",
"(",
"file",
",",
"\"file\"",
")",
";",
"final",
"File",
"tempFile",
"=",
"new",
"File",
"(",
"file",
".",
"getParent",
... | Creates a temporary file near the passed file. The name of the given one will be used and the suffix ".temp" will
be added.
@param file
file in which the entire contents from the given URL can be saved
@throws IllegalStateException
if the file can not be deleted | [
"Creates",
"a",
"temporary",
"file",
"near",
"the",
"passed",
"file",
".",
"The",
"name",
"of",
"the",
"given",
"one",
"will",
"be",
"used",
"and",
"the",
"suffix",
".",
"temp",
"will",
"be",
"added",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java#L62-L71 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java | UpdateOperationWithCacheFileTask.deleteFile | protected static void deleteFile(@Nonnull final File file) {
Check.notNull(file, "file");
Check.stateIsTrue(!file.exists() || file.delete(), "Cannot delete file '%s'.", file.getPath());
} | java | protected static void deleteFile(@Nonnull final File file) {
Check.notNull(file, "file");
Check.stateIsTrue(!file.exists() || file.delete(), "Cannot delete file '%s'.", file.getPath());
} | [
"protected",
"static",
"void",
"deleteFile",
"(",
"@",
"Nonnull",
"final",
"File",
"file",
")",
"{",
"Check",
".",
"notNull",
"(",
"file",
",",
"\"file\"",
")",
";",
"Check",
".",
"stateIsTrue",
"(",
"!",
"file",
".",
"exists",
"(",
")",
"||",
"file",
... | Removes the given file.
@param file
a file which should be deleted
@throws net.sf.qualitycheck.exception.IllegalNullArgumentException
if the given argument is {@code null}
@throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
if the file can not be deleted | [
"Removes",
"the",
"given",
"file",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java#L84-L87 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java | VersionNumber.toVersionString | private static String toVersionString(@Nonnull final List<String> groups) {
final StringBuilder builder = new StringBuilder(6);
int count = 0;
for (final String segment : groups) {
if (EMPTY_GROUP.equals(segment)) {
break;
} else {
if (count > 0) {
builder.append(SEPARATOR);
}
builder.a... | java | private static String toVersionString(@Nonnull final List<String> groups) {
final StringBuilder builder = new StringBuilder(6);
int count = 0;
for (final String segment : groups) {
if (EMPTY_GROUP.equals(segment)) {
break;
} else {
if (count > 0) {
builder.append(SEPARATOR);
}
builder.a... | [
"private",
"static",
"String",
"toVersionString",
"(",
"@",
"Nonnull",
"final",
"List",
"<",
"String",
">",
"groups",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"6",
")",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(... | Converts the given list of numbers in a version string. The groups of the version number will be separated by a
dot.
@param groups
list of numbers of a version number
@return a formated version string | [
"Converts",
"the",
"given",
"list",
"of",
"numbers",
"in",
"a",
"version",
"string",
".",
"The",
"groups",
"of",
"the",
"version",
"number",
"will",
"be",
"separated",
"by",
"a",
"dot",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java#L158-L173 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java | VersionNumber.compareTo | @Override
public int compareTo(@Nullable final ReadableVersionNumber other) {
int result = 0;
if (other == null) {
result = -1;
} else {
Check.notNull(other.getGroups(), "other.getGroups()");
final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size();
final... | java | @Override
public int compareTo(@Nullable final ReadableVersionNumber other) {
int result = 0;
if (other == null) {
result = -1;
} else {
Check.notNull(other.getGroups(), "other.getGroups()");
final int length = groups.size() < other.getGroups().size() ? groups.size() : other.getGroups().size();
final... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"@",
"Nullable",
"final",
"ReadableVersionNumber",
"other",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"other",
"==",
"null",
")",
"{",
"result",
"=",
"-",
"1",
";",
"}",
"else",
"{",
"Che... | Compares this version number with the specified version number for order. Returns a negative integer, zero, or a
positive integer as this version number is less than, equal to, or greater than the specified version number.
@return a negative integer, zero, or a positive integer as this version number is less than, equ... | [
"Compares",
"this",
"version",
"number",
"with",
"the",
"specified",
"version",
"number",
"for",
"order",
".",
"Returns",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"as",
"this",
"version",
"number",
"is",
"less",
"than",
"equal",
... | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java#L308-L329 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java | XmlDataHandler.logParsingIssue | protected static void logParsingIssue(final String prefix, final SAXParseException e) {
final StringBuilder buffer = new StringBuilder();
buffer.append(prefix);
buffer.append(" while reading UAS data: ");
buffer.append(e.getMessage());
buffer.append(" (line: ");
buffer.append(e.getLineNumber());
if (e.get... | java | protected static void logParsingIssue(final String prefix, final SAXParseException e) {
final StringBuilder buffer = new StringBuilder();
buffer.append(prefix);
buffer.append(" while reading UAS data: ");
buffer.append(e.getMessage());
buffer.append(" (line: ");
buffer.append(e.getLineNumber());
if (e.get... | [
"protected",
"static",
"void",
"logParsingIssue",
"(",
"final",
"String",
"prefix",
",",
"final",
"SAXParseException",
"e",
")",
"{",
"final",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buffer",
".",
"append",
"(",
"prefix",
")",
... | Logs an issue while parsing XML.
@param prefix
log level as string to add at the beginning of the message
@param e
exception to log | [
"Logs",
"an",
"issue",
"while",
"parsing",
"XML",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java#L292-L305 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java | XmlDataHandler.transferToSpecificBuilderAndReset | private void transferToSpecificBuilderAndReset() {
// version
if (currentTag == Tag.VERSION) {
dataBuilder.setVersion(buffer.toString());
}
// robot browser
addToRobotBuilder();
// build browser
addToBrowserBuilder();
// build operating system
addToOperatingSystemBuilder();
// build browser ... | java | private void transferToSpecificBuilderAndReset() {
// version
if (currentTag == Tag.VERSION) {
dataBuilder.setVersion(buffer.toString());
}
// robot browser
addToRobotBuilder();
// build browser
addToBrowserBuilder();
// build operating system
addToOperatingSystemBuilder();
// build browser ... | [
"private",
"void",
"transferToSpecificBuilderAndReset",
"(",
")",
"{",
"// version",
"if",
"(",
"currentTag",
"==",
"Tag",
".",
"VERSION",
")",
"{",
"dataBuilder",
".",
"setVersion",
"(",
"buffer",
".",
"toString",
"(",
")",
")",
";",
"}",
"// robot browser",
... | Transfers all characters of a specific tag to the corresponding builder and resets the string buffer. | [
"Transfers",
"all",
"characters",
"of",
"a",
"specific",
"tag",
"to",
"the",
"corresponding",
"builder",
"and",
"resets",
"the",
"string",
"buffer",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java#L665-L700 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java | CachingXmlDataStore.deleteCacheFile | private static void deleteCacheFile(final File cacheFile) {
try {
if (cacheFile.delete()) {
LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED_AND_DELETED, cacheFile.getPath()));
} else {
LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED, cacheFile.getPath()));
}
} catch (final Exception e) {
LOG.w... | java | private static void deleteCacheFile(final File cacheFile) {
try {
if (cacheFile.delete()) {
LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED_AND_DELETED, cacheFile.getPath()));
} else {
LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED, cacheFile.getPath()));
}
} catch (final Exception e) {
LOG.w... | [
"private",
"static",
"void",
"deleteCacheFile",
"(",
"final",
"File",
"cacheFile",
")",
"{",
"try",
"{",
"if",
"(",
"cacheFile",
".",
"delete",
"(",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"String",
".",
"format",
"(",
"MSG_CACHE_FILE_IS_DAMAGED_AND_DELETED"... | Removes the given cache file because it contains damaged content.
@param cacheFile
cache file to delete | [
"Removes",
"the",
"given",
"cache",
"file",
"because",
"it",
"contains",
"damaged",
"content",
"."
] | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java#L219-L229 | train |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java | CachingXmlDataStore.readCacheFileAsFallback | private static DataStore readCacheFileAsFallback(@Nonnull final DataReader reader, @Nonnull final File cacheFile,
@Nonnull final Charset charset, @Nonnull final DataStore fallback) {
DataStore fallbackDataStore;
if (!isEmpty(cacheFile, charset)) {
final URL cacheFileUrl = UrlUtil.toUrl(cacheFile);
try {
... | java | private static DataStore readCacheFileAsFallback(@Nonnull final DataReader reader, @Nonnull final File cacheFile,
@Nonnull final Charset charset, @Nonnull final DataStore fallback) {
DataStore fallbackDataStore;
if (!isEmpty(cacheFile, charset)) {
final URL cacheFileUrl = UrlUtil.toUrl(cacheFile);
try {
... | [
"private",
"static",
"DataStore",
"readCacheFileAsFallback",
"(",
"@",
"Nonnull",
"final",
"DataReader",
"reader",
",",
"@",
"Nonnull",
"final",
"File",
"cacheFile",
",",
"@",
"Nonnull",
"final",
"Charset",
"charset",
",",
"@",
"Nonnull",
"final",
"DataStore",
"... | Tries to read the content of specified cache file and returns them as fallback data store. If the cache file
contains unexpected data the given fallback data store will be returned instead.
@param reader
data reader to read the given {@code dataUrl}
@param cacheFile
file with cached <em>UAS data</em> in XML format or ... | [
"Tries",
"to",
"read",
"the",
"content",
"of",
"specified",
"cache",
"file",
"and",
"returns",
"them",
"as",
"fallback",
"data",
"store",
".",
"If",
"the",
"cache",
"file",
"contains",
"unexpected",
"data",
"the",
"given",
"fallback",
"data",
"store",
"will"... | 215fb652723c52866572cff885f52a3fe67b9db5 | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java#L286-L303 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java | ProxyOverrider.activate | public void activate(InetAddress host, int port, Collection<String> nonProxyHosts) {
for (String scheme : new String[] {"http", "https"}) {
String currentProxyHost = System.getProperty(scheme + ".proxyHost");
String currentProxyPort = System.getProperty(scheme + ".proxyPort");
... | java | public void activate(InetAddress host, int port, Collection<String> nonProxyHosts) {
for (String scheme : new String[] {"http", "https"}) {
String currentProxyHost = System.getProperty(scheme + ".proxyHost");
String currentProxyPort = System.getProperty(scheme + ".proxyPort");
... | [
"public",
"void",
"activate",
"(",
"InetAddress",
"host",
",",
"int",
"port",
",",
"Collection",
"<",
"String",
">",
"nonProxyHosts",
")",
"{",
"for",
"(",
"String",
"scheme",
":",
"new",
"String",
"[",
"]",
"{",
"\"http\"",
",",
"\"https\"",
"}",
")",
... | Activates a proxy override for the given URI scheme. | [
"Activates",
"a",
"proxy",
"override",
"for",
"the",
"given",
"URI",
"scheme",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java#L43-L63 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java | ProxyOverrider.deactivateAll | public void deactivateAll() {
for (String scheme : new String[] {"http", "https"}) {
InetSocketAddress originalProxy = originalProxies.remove(scheme);
if (originalProxy != null) {
System.setProperty(scheme + ".proxyHost", originalProxy.getHostName());
Syst... | java | public void deactivateAll() {
for (String scheme : new String[] {"http", "https"}) {
InetSocketAddress originalProxy = originalProxies.remove(scheme);
if (originalProxy != null) {
System.setProperty(scheme + ".proxyHost", originalProxy.getHostName());
Syst... | [
"public",
"void",
"deactivateAll",
"(",
")",
"{",
"for",
"(",
"String",
"scheme",
":",
"new",
"String",
"[",
"]",
"{",
"\"http\"",
",",
"\"https\"",
"}",
")",
"{",
"InetSocketAddress",
"originalProxy",
"=",
"originalProxies",
".",
"remove",
"(",
"scheme",
... | Deactivates all proxy overrides restoring the pre-existing proxy settings if any. | [
"Deactivates",
"all",
"proxy",
"overrides",
"restoring",
"the",
"pre",
"-",
"existing",
"proxy",
"settings",
"if",
"any",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java#L68-L86 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java | ProxyOverrider.getOriginalProxySelector | @Deprecated
public ProxySelector getOriginalProxySelector() {
return new ProxySelector() {
@Override
public List<Proxy> select(URI uri) {
InetSocketAddress address = originalProxies.get(uri.getScheme());
if (address != null && !(originalNonProxyHosts.c... | java | @Deprecated
public ProxySelector getOriginalProxySelector() {
return new ProxySelector() {
@Override
public List<Proxy> select(URI uri) {
InetSocketAddress address = originalProxies.get(uri.getScheme());
if (address != null && !(originalNonProxyHosts.c... | [
"@",
"Deprecated",
"public",
"ProxySelector",
"getOriginalProxySelector",
"(",
")",
"{",
"return",
"new",
"ProxySelector",
"(",
")",
"{",
"@",
"Override",
"public",
"List",
"<",
"Proxy",
">",
"select",
"(",
"URI",
"uri",
")",
"{",
"InetSocketAddress",
"address... | Used by the Betamax proxy so that it can use pre-existing proxy settings when forwarding requests that do not
match anything on tape.
@return a proxy selector that uses the overridden proxy settings if any. | [
"Used",
"by",
"the",
"Betamax",
"proxy",
"so",
"that",
"it",
"can",
"use",
"pre",
"-",
"existing",
"proxy",
"settings",
"when",
"forwarding",
"requests",
"that",
"do",
"not",
"match",
"anything",
"on",
"tape",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java#L94-L111 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java | ProxyOverrider.lookupChainedProxies | @Override
public void lookupChainedProxies(HttpRequest request, Queue<ChainedProxy> chainedProxies) {
final InetSocketAddress originalProxy = originalProxies.get(URI.create(request.getUri()).getScheme());
if (originalProxy != null) {
ChainedProxy chainProxy = new ChainedProxyAdapter() {
... | java | @Override
public void lookupChainedProxies(HttpRequest request, Queue<ChainedProxy> chainedProxies) {
final InetSocketAddress originalProxy = originalProxies.get(URI.create(request.getUri()).getScheme());
if (originalProxy != null) {
ChainedProxy chainProxy = new ChainedProxyAdapter() {
... | [
"@",
"Override",
"public",
"void",
"lookupChainedProxies",
"(",
"HttpRequest",
"request",
",",
"Queue",
"<",
"ChainedProxy",
">",
"chainedProxies",
")",
"{",
"final",
"InetSocketAddress",
"originalProxy",
"=",
"originalProxies",
".",
"get",
"(",
"URI",
".",
"creat... | Used by LittleProxy to connect to a downstream proxy if there is one. | [
"Used",
"by",
"LittleProxy",
"to",
"connect",
"to",
"a",
"downstream",
"proxy",
"if",
"there",
"is",
"one",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/util/ProxyOverrider.java#L116-L130 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/Recorder.java | Recorder.start | public void start(String tapeName, Optional<TapeMode> mode, Optional<MatchRule> matchRule) {
if (tape != null) {
throw new IllegalStateException("start called when Recorder is already started");
}
tape = getTapeLoader().loadTape(tapeName);
tape.setMode(mode.or(configuration.... | java | public void start(String tapeName, Optional<TapeMode> mode, Optional<MatchRule> matchRule) {
if (tape != null) {
throw new IllegalStateException("start called when Recorder is already started");
}
tape = getTapeLoader().loadTape(tapeName);
tape.setMode(mode.or(configuration.... | [
"public",
"void",
"start",
"(",
"String",
"tapeName",
",",
"Optional",
"<",
"TapeMode",
">",
"mode",
",",
"Optional",
"<",
"MatchRule",
">",
"matchRule",
")",
"{",
"if",
"(",
"tape",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"... | Starts the Recorder, inserting a tape with the specified parameters.
@param tapeName the name of the tape.
@param mode the tape mode. If not supplied the default mode from the configuration is used.
@param matchRule the rules used to match recordings on the tape. If not supplied a default is used.
@throws IllegalStat... | [
"Starts",
"the",
"Recorder",
"inserting",
"a",
"tape",
"with",
"the",
"specified",
"parameters",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/Recorder.java#L55-L67 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/Recorder.java | Recorder.stop | public void stop() {
if (tape == null) {
throw new IllegalStateException("stop called when Recorder is not started");
}
for (RecorderListener listener : listeners) {
listener.onRecorderStop();
}
getTapeLoader().writeTape(tape);
tape = null;
} | java | public void stop() {
if (tape == null) {
throw new IllegalStateException("stop called when Recorder is not started");
}
for (RecorderListener listener : listeners) {
listener.onRecorderStop();
}
getTapeLoader().writeTape(tape);
tape = null;
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"tape",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"stop called when Recorder is not started\"",
")",
";",
"}",
"for",
"(",
"RecorderListener",
"listener",
":",
"listeners",
")",
... | Stops the Recorder and writes its current tape out to a file.
@throws IllegalStateException if the Recorder is not started. | [
"Stops",
"the",
"Recorder",
"and",
"writes",
"its",
"current",
"tape",
"out",
"to",
"a",
"file",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/Recorder.java#L82-L92 | train |
betamaxteam/betamax | betamax-core/src/main/java/software/betamax/Configuration.java | Configuration.getIgnoreHosts | public Collection<String> getIgnoreHosts() {
if (isIgnoreLocalhost()) {
return new ImmutableSet.Builder<String>()
.addAll(ignoreHosts)
.addAll(Network.getLocalAddresses())
.build();
} else {
return ignoreHosts;
}... | java | public Collection<String> getIgnoreHosts() {
if (isIgnoreLocalhost()) {
return new ImmutableSet.Builder<String>()
.addAll(ignoreHosts)
.addAll(Network.getLocalAddresses())
.build();
} else {
return ignoreHosts;
}... | [
"public",
"Collection",
"<",
"String",
">",
"getIgnoreHosts",
"(",
")",
"{",
"if",
"(",
"isIgnoreLocalhost",
"(",
")",
")",
"{",
"return",
"new",
"ImmutableSet",
".",
"Builder",
"<",
"String",
">",
"(",
")",
".",
"addAll",
"(",
"ignoreHosts",
")",
".",
... | Hosts that are ignored by Betamax. Any connections made will be allowed to proceed normally and not be
intercepted. | [
"Hosts",
"that",
"are",
"ignored",
"by",
"Betamax",
".",
"Any",
"connections",
"made",
"will",
"be",
"allowed",
"to",
"proceed",
"normally",
"and",
"not",
"be",
"intercepted",
"."
] | 30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0 | https://github.com/betamaxteam/betamax/blob/30f29db9a2e2975f9d8ccd28ee3f4cea2bdf16e0/betamax-core/src/main/java/software/betamax/Configuration.java#L127-L136 | train |
webdriverextensions/webdriverextensions | src/main/java/com/github/webdriverextensions/internal/junitrunner/AnnotationUtils.java | AnnotationUtils.getAnnotationAttributes | public static Map<String, Object> getAnnotationAttributes(Annotation annotation, boolean classValuesAsString) {
Map<String, Object> attrs = new HashMap<>();
Method[] methods = annotation.annotationType().getDeclaredMethods();
for (Method method : methods) {
if (method.getParameterTyp... | java | public static Map<String, Object> getAnnotationAttributes(Annotation annotation, boolean classValuesAsString) {
Map<String, Object> attrs = new HashMap<>();
Method[] methods = annotation.annotationType().getDeclaredMethods();
for (Method method : methods) {
if (method.getParameterTyp... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"getAnnotationAttributes",
"(",
"Annotation",
"annotation",
",",
"boolean",
"classValuesAsString",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"attrs",
"=",
"new",
"HashMap",
"<>",
"(",
")... | Retrieve the given annotation's attributes as a Map.
@param annotation the annotation to retrieve the attributes for
@param classValuesAsString whether to turn Class references into Strings (for compatibility with
{@link org.springframework.core.type.AnnotationMetadata} or to preserve them as Class references
@return t... | [
"Retrieve",
"the",
"given",
"annotation",
"s",
"attributes",
"as",
"a",
"Map",
"."
] | 80151a2bb4fe92b093e60b1e628b8c3d73fb1cc1 | https://github.com/webdriverextensions/webdriverextensions/blob/80151a2bb4fe92b093e60b1e628b8c3d73fb1cc1/src/main/java/com/github/webdriverextensions/internal/junitrunner/AnnotationUtils.java#L81-L109 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.enableOrDisableExternalEntityParsing | protected static void enableOrDisableExternalEntityParsing(
DocumentBuilderFactory factory, boolean enableExternalEntities)
{
// Feature list drawn from:
// https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
/* Enable or disable external general entities */
... | java | protected static void enableOrDisableExternalEntityParsing(
DocumentBuilderFactory factory, boolean enableExternalEntities)
{
// Feature list drawn from:
// https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
/* Enable or disable external general entities */
... | [
"protected",
"static",
"void",
"enableOrDisableExternalEntityParsing",
"(",
"DocumentBuilderFactory",
"factory",
",",
"boolean",
"enableExternalEntities",
")",
"{",
"// Feature list drawn from:",
"// https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing",
"/* Enable or dis... | Explicitly enable or disable the 'external-general-entities' and
'external-parameter-entities' features of the underlying
DocumentBuilderFactory.
TODO This is a naive approach that simply tries to apply all known
feature name/URL values in turn until one succeeds, or none do.
@param factory
factory which will have ex... | [
"Explicitly",
"enable",
"or",
"disable",
"the",
"external",
"-",
"general",
"-",
"entities",
"and",
"external",
"-",
"parameter",
"-",
"entities",
"features",
"of",
"the",
"underlying",
"DocumentBuilderFactory",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L135-L190 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.createDocumentImpl | protected static Document createDocumentImpl(
String name, String namespaceURI, boolean enableExternalEntities,
boolean isNamespaceAware)
throws ParserConfigurationException, FactoryConfigurationError
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
fa... | java | protected static Document createDocumentImpl(
String name, String namespaceURI, boolean enableExternalEntities,
boolean isNamespaceAware)
throws ParserConfigurationException, FactoryConfigurationError
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
fa... | [
"protected",
"static",
"Document",
"createDocumentImpl",
"(",
"String",
"name",
",",
"String",
"namespaceURI",
",",
"boolean",
"enableExternalEntities",
",",
"boolean",
"isNamespaceAware",
")",
"throws",
"ParserConfigurationException",
",",
"FactoryConfigurationError",
"{",... | Construct an XML Document with a default namespace with the given
root element.
@param name
the name of the document's root element.
@param namespaceURI
default namespace URI for document, ignored if null or empty.
@param enableExternalEntities
enable external entities; beware of XML External Entity (XXE) injection.
@... | [
"Construct",
"an",
"XML",
"Document",
"with",
"a",
"default",
"namespace",
"with",
"the",
"given",
"root",
"element",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L211-L229 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.parseDocumentImpl | protected static Document parseDocumentImpl(
InputSource inputSource, boolean enableExternalEntities,
boolean isNamespaceAware)
throws ParserConfigurationException, SAXException, IOException
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setN... | java | protected static Document parseDocumentImpl(
InputSource inputSource, boolean enableExternalEntities,
boolean isNamespaceAware)
throws ParserConfigurationException, SAXException, IOException
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setN... | [
"protected",
"static",
"Document",
"parseDocumentImpl",
"(",
"InputSource",
"inputSource",
",",
"boolean",
"enableExternalEntities",
",",
"boolean",
"isNamespaceAware",
")",
"throws",
"ParserConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"DocumentBui... | Return an XML Document parsed from the given input source.
@param inputSource
an XML document input source that will be parsed into a DOM.
@param enableExternalEntities
enable external entities; beware of XML External Entity (XXE) injection.
@param isNamespaceAware
enable or disable namespace awareness in the underlyi... | [
"Return",
"an",
"XML",
"Document",
"parsed",
"from",
"the",
"given",
"input",
"source",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L250-L261 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.stripWhitespaceOnlyTextNodesImpl | protected void stripWhitespaceOnlyTextNodesImpl()
throws XPathExpressionException
{
XPathFactory xpathFactory = XPathFactory.newInstance();
// XPath to find empty text nodes.
XPathExpression xpathExp = xpathFactory.newXPath().compile(
"//text()[normalize-space(.) = '']");... | java | protected void stripWhitespaceOnlyTextNodesImpl()
throws XPathExpressionException
{
XPathFactory xpathFactory = XPathFactory.newInstance();
// XPath to find empty text nodes.
XPathExpression xpathExp = xpathFactory.newXPath().compile(
"//text()[normalize-space(.) = '']");... | [
"protected",
"void",
"stripWhitespaceOnlyTextNodesImpl",
"(",
")",
"throws",
"XPathExpressionException",
"{",
"XPathFactory",
"xpathFactory",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"// XPath to find empty text nodes.",
"XPathExpression",
"xpathExp",
"=",
"x... | Find and delete from the underlying Document any text nodes that
contain nothing but whitespace, such as newlines and tab or space
characters used to indent or pretty-print an XML document.
Uses approach I documented on StackOverflow:
http://stackoverflow.com/a/979606/4970
@throws XPathExpressionException | [
"Find",
"and",
"delete",
"from",
"the",
"underlying",
"Document",
"any",
"text",
"nodes",
"that",
"contain",
"nothing",
"but",
"whitespace",
"such",
"as",
"newlines",
"and",
"tab",
"or",
"space",
"characters",
"used",
"to",
"indent",
"or",
"pretty",
"-",
"pr... | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L273-L288 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.importXMLBuilderImpl | protected void importXMLBuilderImpl(BaseXMLBuilder builder) {
assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
Node importedNode = getDocument().importNode(
builder.getDocument().getDocumentElement(), true);
this.xmlNode.appendChild(importedNode);
} | java | protected void importXMLBuilderImpl(BaseXMLBuilder builder) {
assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
Node importedNode = getDocument().importNode(
builder.getDocument().getDocumentElement(), true);
this.xmlNode.appendChild(importedNode);
} | [
"protected",
"void",
"importXMLBuilderImpl",
"(",
"BaseXMLBuilder",
"builder",
")",
"{",
"assertElementContainsNoOrWhitespaceOnlyTextNodes",
"(",
"this",
".",
"xmlNode",
")",
";",
"Node",
"importedNode",
"=",
"getDocument",
"(",
")",
".",
"importNode",
"(",
"builder",... | Imports another BaseXMLBuilder document into this document at the
current position. The entire document provided is imported.
@param builder
the BaseXMLBuilder document to be imported. | [
"Imports",
"another",
"BaseXMLBuilder",
"document",
"into",
"this",
"document",
"at",
"the",
"current",
"position",
".",
"The",
"entire",
"document",
"provided",
"is",
"imported",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L312-L317 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.xpathQuery | public Object xpathQuery(String xpath, QName type, NamespaceContext nsContext)
throws XPathExpressionException {
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xPath = xpathFactory.newXPath();
if (nsContext != null) {
xPath.setNamespaceContext(n... | java | public Object xpathQuery(String xpath, QName type, NamespaceContext nsContext)
throws XPathExpressionException {
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xPath = xpathFactory.newXPath();
if (nsContext != null) {
xPath.setNamespaceContext(n... | [
"public",
"Object",
"xpathQuery",
"(",
"String",
"xpath",
",",
"QName",
"type",
",",
"NamespaceContext",
"nsContext",
")",
"throws",
"XPathExpressionException",
"{",
"XPathFactory",
"xpathFactory",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"XPath",
"... | Return the result of evaluating an XPath query on the builder's DOM
using the given namespace. Returns null if the query finds nothing,
or finds a node that does not match the type specified by returnType.
@param xpath
an XPath expression
@param type
the type the XPath is expected to resolve to, e.g:
{@link XPathConst... | [
"Return",
"the",
"result",
"of",
"evaluating",
"an",
"XPath",
"query",
"on",
"the",
"builder",
"s",
"DOM",
"using",
"the",
"given",
"namespace",
".",
"Returns",
"null",
"if",
"the",
"query",
"finds",
"nothing",
"or",
"finds",
"a",
"node",
"that",
"does",
... | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L398-L412 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.xpathQuery | public Object xpathQuery(String xpath, QName type)
throws XPathExpressionException {
return xpathQuery(xpath, type, null);
} | java | public Object xpathQuery(String xpath, QName type)
throws XPathExpressionException {
return xpathQuery(xpath, type, null);
} | [
"public",
"Object",
"xpathQuery",
"(",
"String",
"xpath",
",",
"QName",
"type",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"xpathQuery",
"(",
"xpath",
",",
"type",
",",
"null",
")",
";",
"}"
] | Return the result of evaluating an XPath query on the builder's DOM.
Returns null if the query finds nothing,
or finds a node that does not match the type specified by returnType.
@param xpath
an XPath expression
@param type
the type the XPath is expected to resolve to, e.g:
{@link XPathConstants#NODE}, {@link XPathCo... | [
"Return",
"the",
"result",
"of",
"evaluating",
"an",
"XPath",
"query",
"on",
"the",
"builder",
"s",
"DOM",
".",
"Returns",
"null",
"if",
"the",
"query",
"finds",
"nothing",
"or",
"finds",
"a",
"node",
"that",
"does",
"not",
"match",
"the",
"type",
"speci... | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L434-L437 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.elementImpl | protected Element elementImpl(String name, String namespaceURI) {
assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
if (namespaceURI == null) {
return getDocument().createElement(name);
} else {
return getDocument().createElementNS(namespaceURI, name);
... | java | protected Element elementImpl(String name, String namespaceURI) {
assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
if (namespaceURI == null) {
return getDocument().createElement(name);
} else {
return getDocument().createElementNS(namespaceURI, name);
... | [
"protected",
"Element",
"elementImpl",
"(",
"String",
"name",
",",
"String",
"namespaceURI",
")",
"{",
"assertElementContainsNoOrWhitespaceOnlyTextNodes",
"(",
"this",
".",
"xmlNode",
")",
";",
"if",
"(",
"namespaceURI",
"==",
"null",
")",
"{",
"return",
"getDocum... | Add a named and namespaced XML element to the document as a child of
this builder's node.
@param name
the name of the XML element.
@param namespaceURI
a namespace URI
@return
@throws IllegalStateException
if you attempt to add a child element to an XML node that already
contains a text node value. | [
"Add",
"a",
"named",
"and",
"namespaced",
"XML",
"element",
"to",
"the",
"document",
"as",
"a",
"child",
"of",
"this",
"builder",
"s",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L542-L549 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.elementBeforeImpl | protected Element elementBeforeImpl(String name) {
String prefix = getPrefixFromQualifiedName(name);
String namespaceURI = this.xmlNode.lookupNamespaceURI(prefix);
return elementBeforeImpl(name, namespaceURI);
} | java | protected Element elementBeforeImpl(String name) {
String prefix = getPrefixFromQualifiedName(name);
String namespaceURI = this.xmlNode.lookupNamespaceURI(prefix);
return elementBeforeImpl(name, namespaceURI);
} | [
"protected",
"Element",
"elementBeforeImpl",
"(",
"String",
"name",
")",
"{",
"String",
"prefix",
"=",
"getPrefixFromQualifiedName",
"(",
"name",
")",
";",
"String",
"namespaceURI",
"=",
"this",
".",
"xmlNode",
".",
"lookupNamespaceURI",
"(",
"prefix",
")",
";",... | Add a named XML element to the document as a sibling element
that precedes the position of this builder node.
When adding an element to a namespaced document, the new node will be
assigned a namespace matching it's qualified name prefix (if any) or
the document's default namespace. NOTE: If the element has a prefix th... | [
"Add",
"a",
"named",
"XML",
"element",
"to",
"the",
"document",
"as",
"a",
"sibling",
"element",
"that",
"precedes",
"the",
"position",
"of",
"this",
"builder",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L765-L769 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.elementBeforeImpl | protected Element elementBeforeImpl(String name, String namespaceURI) {
Node parentNode = this.xmlNode.getParentNode();
assertElementContainsNoOrWhitespaceOnlyTextNodes(parentNode);
Element newElement = (namespaceURI == null
? getDocument().createElement(name)
: getDocum... | java | protected Element elementBeforeImpl(String name, String namespaceURI) {
Node parentNode = this.xmlNode.getParentNode();
assertElementContainsNoOrWhitespaceOnlyTextNodes(parentNode);
Element newElement = (namespaceURI == null
? getDocument().createElement(name)
: getDocum... | [
"protected",
"Element",
"elementBeforeImpl",
"(",
"String",
"name",
",",
"String",
"namespaceURI",
")",
"{",
"Node",
"parentNode",
"=",
"this",
".",
"xmlNode",
".",
"getParentNode",
"(",
")",
";",
"assertElementContainsNoOrWhitespaceOnlyTextNodes",
"(",
"parentNode",
... | Add a named and namespaced XML element to the document as a sibling element
that precedes the position of this builder node.
@param name
the name of the XML element.
@param namespaceURI
a namespace URI
@throws IllegalStateException
if you attempt to add a sibling element to a node where there are already
one or more ... | [
"Add",
"a",
"named",
"and",
"namespaced",
"XML",
"element",
"to",
"the",
"document",
"as",
"a",
"sibling",
"element",
"that",
"precedes",
"the",
"position",
"of",
"this",
"builder",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L784-L796 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.attributeImpl | protected void attributeImpl(String name, String value) {
if (! (this.xmlNode instanceof Element)) {
throw new RuntimeException(
"Cannot add an attribute to non-Element underlying node: "
+ this.xmlNode);
}
((Element) xmlNode).setAttribute(name, value)... | java | protected void attributeImpl(String name, String value) {
if (! (this.xmlNode instanceof Element)) {
throw new RuntimeException(
"Cannot add an attribute to non-Element underlying node: "
+ this.xmlNode);
}
((Element) xmlNode).setAttribute(name, value)... | [
"protected",
"void",
"attributeImpl",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"this",
".",
"xmlNode",
"instanceof",
"Element",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Cannot add an attribute to non-Element... | Add a named attribute value to the element for this builder node.
@param name
the attribute's name.
@param value
the attribute's value. | [
"Add",
"a",
"named",
"attribute",
"value",
"to",
"the",
"element",
"for",
"this",
"builder",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L806-L813 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.textImpl | protected void textImpl(String value, boolean replaceText) {
// Issue 10: null text values cause exceptions on subsequent call to
// Transformer to render document, so we fail-fast here on bad data.
if (value == null) {
throw new IllegalArgumentException("Illegal null text value");
... | java | protected void textImpl(String value, boolean replaceText) {
// Issue 10: null text values cause exceptions on subsequent call to
// Transformer to render document, so we fail-fast here on bad data.
if (value == null) {
throw new IllegalArgumentException("Illegal null text value");
... | [
"protected",
"void",
"textImpl",
"(",
"String",
"value",
",",
"boolean",
"replaceText",
")",
"{",
"// Issue 10: null text values cause exceptions on subsequent call to",
"// Transformer to render document, so we fail-fast here on bad data.",
"if",
"(",
"value",
"==",
"null",
")",... | Add or replace the text value of an element for this builder node.
@param value
the text value to set or add to the element.
@param replaceText
if True any existing text content of the node is replaced with the
given text value, if the given value is appended to any existing text. | [
"Add",
"or",
"replace",
"the",
"text",
"value",
"of",
"an",
"element",
"for",
"this",
"builder",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L824-L836 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.instructionImpl | protected void instructionImpl(String target, String data) {
xmlNode.appendChild(getDocument().createProcessingInstruction(target, data));
} | java | protected void instructionImpl(String target, String data) {
xmlNode.appendChild(getDocument().createProcessingInstruction(target, data));
} | [
"protected",
"void",
"instructionImpl",
"(",
"String",
"target",
",",
"String",
"data",
")",
"{",
"xmlNode",
".",
"appendChild",
"(",
"getDocument",
"(",
")",
".",
"createProcessingInstruction",
"(",
"target",
",",
"data",
")",
")",
";",
"}"
] | Add an instruction to the element represented by this builder node.
@param target
the target value for the instruction.
@param data
the data value for the instruction | [
"Add",
"an",
"instruction",
"to",
"the",
"element",
"represented",
"by",
"this",
"builder",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L881-L883 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.insertInstructionImpl | protected void insertInstructionImpl(String target, String data) {
getDocument().insertBefore(
getDocument().createProcessingInstruction(target, data),
xmlNode);
} | java | protected void insertInstructionImpl(String target, String data) {
getDocument().insertBefore(
getDocument().createProcessingInstruction(target, data),
xmlNode);
} | [
"protected",
"void",
"insertInstructionImpl",
"(",
"String",
"target",
",",
"String",
"data",
")",
"{",
"getDocument",
"(",
")",
".",
"insertBefore",
"(",
"getDocument",
"(",
")",
".",
"createProcessingInstruction",
"(",
"target",
",",
"data",
")",
",",
"xmlNo... | Insert an instruction before the element represented by this builder node.
@param target
the target value for the instruction.
@param data
the data value for the instruction | [
"Insert",
"an",
"instruction",
"before",
"the",
"element",
"represented",
"by",
"this",
"builder",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L893-L897 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.namespaceImpl | protected void namespaceImpl(String prefix, String namespaceURI) {
if (! (this.xmlNode instanceof Element)) {
throw new RuntimeException(
"Cannot add an attribute to non-Element underlying node: "
+ this.xmlNode);
}
if (prefix != null && prefix.length(... | java | protected void namespaceImpl(String prefix, String namespaceURI) {
if (! (this.xmlNode instanceof Element)) {
throw new RuntimeException(
"Cannot add an attribute to non-Element underlying node: "
+ this.xmlNode);
}
if (prefix != null && prefix.length(... | [
"protected",
"void",
"namespaceImpl",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"{",
"if",
"(",
"!",
"(",
"this",
".",
"xmlNode",
"instanceof",
"Element",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Cannot add an attribute to no... | Add an XML namespace attribute to this builder's element node.
@param prefix
a prefix for the namespace URI within the document, may be null
or empty in which case a default "xmlns" attribute is created.
@param namespaceURI
a namespace uri | [
"Add",
"an",
"XML",
"namespace",
"attribute",
"to",
"this",
"builder",
"s",
"element",
"node",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L918-L931 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.asString | public String asString() throws TransformerException {
Properties outputProperties = new Properties();
outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
return asString(outputProperties);
} | java | public String asString() throws TransformerException {
Properties outputProperties = new Properties();
outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
return asString(outputProperties);
} | [
"public",
"String",
"asString",
"(",
")",
"throws",
"TransformerException",
"{",
"Properties",
"outputProperties",
"=",
"new",
"Properties",
"(",
")",
";",
"outputProperties",
".",
"put",
"(",
"javax",
".",
"xml",
".",
"transform",
".",
"OutputKeys",
".",
"OMI... | Serialize the XML document to a string excluding the XML declaration.
@return
the XML document as a string without the XML declaration at the
beginning of the output.
@throws TransformerException | [
"Serialize",
"the",
"XML",
"document",
"to",
"a",
"string",
"excluding",
"the",
"XML",
"declaration",
"."
] | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L1400-L1404 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/XMLBuilder2.java | XMLBuilder2.parse | public static XMLBuilder2 parse(
InputSource inputSource, boolean enableExternalEntities,
boolean isNamespaceAware)
{
try {
return new XMLBuilder2(
parseDocumentImpl(
inputSource, enableExternalEntities, isNamespaceAware));
} catch (Par... | java | public static XMLBuilder2 parse(
InputSource inputSource, boolean enableExternalEntities,
boolean isNamespaceAware)
{
try {
return new XMLBuilder2(
parseDocumentImpl(
inputSource, enableExternalEntities, isNamespaceAware));
} catch (Par... | [
"public",
"static",
"XMLBuilder2",
"parse",
"(",
"InputSource",
"inputSource",
",",
"boolean",
"enableExternalEntities",
",",
"boolean",
"isNamespaceAware",
")",
"{",
"try",
"{",
"return",
"new",
"XMLBuilder2",
"(",
"parseDocumentImpl",
"(",
"inputSource",
",",
"ena... | Construct a builder from an existing XML document. The provided XML
document will be parsed and an XMLBuilder2 object referencing the
document's root element will be returned.
@param inputSource
an XML document input source that will be parsed into a DOM.
@param enableExternalEntities
enable external entities; beware ... | [
"Construct",
"a",
"builder",
"from",
"an",
"existing",
"XML",
"document",
".",
"The",
"provided",
"XML",
"document",
"will",
"be",
"parsed",
"and",
"an",
"XMLBuilder2",
"object",
"referencing",
"the",
"document",
"s",
"root",
"element",
"will",
"be",
"returned... | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/XMLBuilder2.java#L223-L238 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/XMLBuilder2.java | XMLBuilder2.parse | public static XMLBuilder2 parse(
String xmlString, boolean enableExternalEntities, boolean isNamespaceAware)
{
return XMLBuilder2.parse(
new InputSource(new StringReader(xmlString)),
enableExternalEntities,
isNamespaceAware);
} | java | public static XMLBuilder2 parse(
String xmlString, boolean enableExternalEntities, boolean isNamespaceAware)
{
return XMLBuilder2.parse(
new InputSource(new StringReader(xmlString)),
enableExternalEntities,
isNamespaceAware);
} | [
"public",
"static",
"XMLBuilder2",
"parse",
"(",
"String",
"xmlString",
",",
"boolean",
"enableExternalEntities",
",",
"boolean",
"isNamespaceAware",
")",
"{",
"return",
"XMLBuilder2",
".",
"parse",
"(",
"new",
"InputSource",
"(",
"new",
"StringReader",
"(",
"xmlS... | Construct a builder from an existing XML document string.
The provided XML document will be parsed and an XMLBuilder2
object referencing the document's root element will be returned.
@param xmlString
an XML document string that will be parsed into a DOM.
@param enableExternalEntities
enable external entities; beware o... | [
"Construct",
"a",
"builder",
"from",
"an",
"existing",
"XML",
"document",
"string",
".",
"The",
"provided",
"XML",
"document",
"will",
"be",
"parsed",
"and",
"an",
"XMLBuilder2",
"object",
"referencing",
"the",
"document",
"s",
"root",
"element",
"will",
"be",... | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/XMLBuilder2.java#L255-L262 | train |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/XMLBuilder2.java | XMLBuilder2.parse | public static XMLBuilder2 parse(File xmlFile, boolean enableExternalEntities,
boolean isNamespaceAware)
{
try {
return XMLBuilder2.parse(
new InputSource(new FileReader(xmlFile)),
enableExternalEntities,
isNamespaceAware);
} catch (... | java | public static XMLBuilder2 parse(File xmlFile, boolean enableExternalEntities,
boolean isNamespaceAware)
{
try {
return XMLBuilder2.parse(
new InputSource(new FileReader(xmlFile)),
enableExternalEntities,
isNamespaceAware);
} catch (... | [
"public",
"static",
"XMLBuilder2",
"parse",
"(",
"File",
"xmlFile",
",",
"boolean",
"enableExternalEntities",
",",
"boolean",
"isNamespaceAware",
")",
"{",
"try",
"{",
"return",
"XMLBuilder2",
".",
"parse",
"(",
"new",
"InputSource",
"(",
"new",
"FileReader",
"(... | Construct a builder from an existing XML document file.
The provided XML document will be parsed and an XMLBuilder2
object referencing the document's root element will be returned.
@param xmlFile
an XML document file that will be parsed into a DOM.
@param enableExternalEntities
enable external entities; beware of XML ... | [
"Construct",
"a",
"builder",
"from",
"an",
"existing",
"XML",
"document",
"file",
".",
"The",
"provided",
"XML",
"document",
"will",
"be",
"parsed",
"and",
"an",
"XMLBuilder2",
"object",
"referencing",
"the",
"document",
"s",
"root",
"element",
"will",
"be",
... | 7c224b8e8ed79808509322cb141dab5a88dd3cec | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/XMLBuilder2.java#L282-L293 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.initProperties | private void initProperties() {
center = new SimpleObjectProperty<>();
center.addListener((observable, oldValue, newValue) -> {
// check if this is the same value that was just reported from the map using object equality
if (newValue != lastCoordinateFromMap.get()) {
... | java | private void initProperties() {
center = new SimpleObjectProperty<>();
center.addListener((observable, oldValue, newValue) -> {
// check if this is the same value that was just reported from the map using object equality
if (newValue != lastCoordinateFromMap.get()) {
... | [
"private",
"void",
"initProperties",
"(",
")",
"{",
"center",
"=",
"new",
"SimpleObjectProperty",
"<>",
"(",
")",
";",
"center",
".",
"addListener",
"(",
"(",
"observable",
",",
"oldValue",
",",
"newValue",
")",
"->",
"{",
"// check if this is the same value tha... | initializes the JavaFX properties. | [
"initializes",
"the",
"JavaFX",
"properties",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L203-L272 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.setCenterInMap | private void setCenterInMap() {
final Coordinate actCenter = getCenter();
if (getInitialized() && null != actCenter) {
if (logger.isTraceEnabled()) {
logger.trace("setting center in OpenLayers map: {}, animation: {}", actCenter, animationDuration.get());
}
... | java | private void setCenterInMap() {
final Coordinate actCenter = getCenter();
if (getInitialized() && null != actCenter) {
if (logger.isTraceEnabled()) {
logger.trace("setting center in OpenLayers map: {}, animation: {}", actCenter, animationDuration.get());
}
... | [
"private",
"void",
"setCenterInMap",
"(",
")",
"{",
"final",
"Coordinate",
"actCenter",
"=",
"getCenter",
"(",
")",
";",
"if",
"(",
"getInitialized",
"(",
")",
"&&",
"null",
"!=",
"actCenter",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")... | sets the value of the center property in the OL map. | [
"sets",
"the",
"value",
"of",
"the",
"center",
"property",
"in",
"the",
"OL",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L338-L348 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.setZoomInMap | private void setZoomInMap() {
if (getInitialized()) {
final int zoomInt = (int) getZoom();
if (logger.isTraceEnabled()) {
logger.trace("setting zoom in OpenLayers map: {}, animation: {}", zoomInt, animationDuration.get());
}
jsMapView.call("setZoom... | java | private void setZoomInMap() {
if (getInitialized()) {
final int zoomInt = (int) getZoom();
if (logger.isTraceEnabled()) {
logger.trace("setting zoom in OpenLayers map: {}, animation: {}", zoomInt, animationDuration.get());
}
jsMapView.call("setZoom... | [
"private",
"void",
"setZoomInMap",
"(",
")",
"{",
"if",
"(",
"getInitialized",
"(",
")",
")",
"{",
"final",
"int",
"zoomInt",
"=",
"(",
"int",
")",
"getZoom",
"(",
")",
";",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"logger",
... | sets the value of the actual zoom property in the OL map. | [
"sets",
"the",
"value",
"of",
"the",
"actual",
"zoom",
"property",
"in",
"the",
"OL",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L353-L361 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.checkApiKey | private boolean checkApiKey(final MapType mapTypeToCheck) {
switch (requireNonNull(mapTypeToCheck)) {
case BINGMAPS_ROAD:
case BINGMAPS_AERIAL:
return bingMapsApiKey.isPresent();
default:
return true;
}
} | java | private boolean checkApiKey(final MapType mapTypeToCheck) {
switch (requireNonNull(mapTypeToCheck)) {
case BINGMAPS_ROAD:
case BINGMAPS_AERIAL:
return bingMapsApiKey.isPresent();
default:
return true;
}
} | [
"private",
"boolean",
"checkApiKey",
"(",
"final",
"MapType",
"mapTypeToCheck",
")",
"{",
"switch",
"(",
"requireNonNull",
"(",
"mapTypeToCheck",
")",
")",
"{",
"case",
"BINGMAPS_ROAD",
":",
"case",
"BINGMAPS_AERIAL",
":",
"return",
"bingMapsApiKey",
".",
"isPrese... | checks if the given map type needs an api key, and if so, if it is set.
@param mapTypeToCheck
the map type
@return true if either the map type does not need an api key or an api key was set. | [
"checks",
"if",
"the",
"given",
"map",
"type",
"needs",
"an",
"api",
"key",
"and",
"if",
"so",
"if",
"it",
"is",
"set",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L370-L378 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.setMapTypeInMap | private void setMapTypeInMap() {
if (getInitialized()) {
final String mapTypeName = getMapType().toString();
if (logger.isDebugEnabled()) {
logger.debug("setting map type in OpenLayers map: {}", mapTypeName);
}
bingMapsApiKey.ifPresent(apiKey -> js... | java | private void setMapTypeInMap() {
if (getInitialized()) {
final String mapTypeName = getMapType().toString();
if (logger.isDebugEnabled()) {
logger.debug("setting map type in OpenLayers map: {}", mapTypeName);
}
bingMapsApiKey.ifPresent(apiKey -> js... | [
"private",
"void",
"setMapTypeInMap",
"(",
")",
"{",
"if",
"(",
"getInitialized",
"(",
")",
")",
"{",
"final",
"String",
"mapTypeName",
"=",
"getMapType",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
"... | sets the value of the mapType property in the OL map. | [
"sets",
"the",
"value",
"of",
"the",
"mapType",
"property",
"in",
"the",
"OL",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L383-L400 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.addCoordinateLine | public MapView addCoordinateLine(final CoordinateLine coordinateLine) {
if (!getInitialized()) {
if (logger.isWarnEnabled()) {
logger.warn(MAP_VIEW_NOT_YET_INITIALIZED);
}
} else {
// sync on the coordinatesLines map as the cleaner thread accesses this... | java | public MapView addCoordinateLine(final CoordinateLine coordinateLine) {
if (!getInitialized()) {
if (logger.isWarnEnabled()) {
logger.warn(MAP_VIEW_NOT_YET_INITIALIZED);
}
} else {
// sync on the coordinatesLines map as the cleaner thread accesses this... | [
"public",
"MapView",
"addCoordinateLine",
"(",
"final",
"CoordinateLine",
"coordinateLine",
")",
"{",
"if",
"(",
"!",
"getInitialized",
"(",
")",
")",
"{",
"if",
"(",
"logger",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"logger",
".",
"warn",
"(",
"MAP_VIEW... | add a CoordinateLine to the map. If it was already added, nothing happens. The MapView only stores a weak
reference to the object, so the caller must keep a reference in order to prevent the line to be removed from the
map. This method must only be called after the map is initialized, otherwise a warning is logged and ... | [
"add",
"a",
"CoordinateLine",
"to",
"the",
"map",
".",
"If",
"it",
"was",
"already",
"added",
"nothing",
"happens",
".",
"The",
"MapView",
"only",
"stores",
"a",
"weak",
"reference",
"to",
"the",
"object",
"so",
"the",
"caller",
"must",
"keep",
"a",
"ref... | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L488-L529 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.setCoordinateLineVisibleInMap | private void setCoordinateLineVisibleInMap(final String coordinateLineId) {
if (null != coordinateLineId) {
final WeakReference<CoordinateLine> coordinateLineWeakReference = coordinateLines.get(coordinateLineId);
if (null != coordinateLineWeakReference) {
final Coordinate... | java | private void setCoordinateLineVisibleInMap(final String coordinateLineId) {
if (null != coordinateLineId) {
final WeakReference<CoordinateLine> coordinateLineWeakReference = coordinateLines.get(coordinateLineId);
if (null != coordinateLineWeakReference) {
final Coordinate... | [
"private",
"void",
"setCoordinateLineVisibleInMap",
"(",
"final",
"String",
"coordinateLineId",
")",
"{",
"if",
"(",
"null",
"!=",
"coordinateLineId",
")",
"{",
"final",
"WeakReference",
"<",
"CoordinateLine",
">",
"coordinateLineWeakReference",
"=",
"coordinateLines",
... | shows or hides the coordinateline in the map according to it's visible property.
@param coordinateLineId
the id of the CoordinateLine object | [
"shows",
"or",
"hides",
"the",
"coordinateline",
"in",
"the",
"map",
"according",
"to",
"it",
"s",
"visible",
"property",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L537-L551 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.addLabel | public MapView addLabel(final MapLabel mapLabel) {
if (!getInitialized()) {
if (logger.isWarnEnabled()) {
logger.warn(MAP_VIEW_NOT_YET_INITIALIZED);
}
} else {
if (null == requireNonNull(mapLabel).getPosition()) {
if (logger.isDebugEnab... | java | public MapView addLabel(final MapLabel mapLabel) {
if (!getInitialized()) {
if (logger.isWarnEnabled()) {
logger.warn(MAP_VIEW_NOT_YET_INITIALIZED);
}
} else {
if (null == requireNonNull(mapLabel).getPosition()) {
if (logger.isDebugEnab... | [
"public",
"MapView",
"addLabel",
"(",
"final",
"MapLabel",
"mapLabel",
")",
"{",
"if",
"(",
"!",
"getInitialized",
"(",
")",
")",
"{",
"if",
"(",
"logger",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"logger",
".",
"warn",
"(",
"MAP_VIEW_NOT_YET_INITIALIZED"... | adds a label to the map. If it was already added, nothing is changed. If the MapView is not yet initialized, a
warning is logged and nothing changes. If the label has no coordinate set, it is not added and a logging entry is
written.
The MapView only keeps a weak reference to the label, so the caller must keep a refer... | [
"adds",
"a",
"label",
"to",
"the",
"map",
".",
"If",
"it",
"was",
"already",
"added",
"nothing",
"is",
"changed",
".",
"If",
"the",
"MapView",
"is",
"not",
"yet",
"initialized",
"a",
"warning",
"is",
"logged",
"and",
"nothing",
"changes",
".",
"If",
"t... | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L567-L600 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.addMapCoordinateElement | private void addMapCoordinateElement(final MapCoordinateElement mapCoordinateElement) {
final String id = mapCoordinateElement.getId();
// create change listeners for the coordinate and the visibility and store them with the
// marker's id.
final ChangeListener<Coordinate> coordinateChan... | java | private void addMapCoordinateElement(final MapCoordinateElement mapCoordinateElement) {
final String id = mapCoordinateElement.getId();
// create change listeners for the coordinate and the visibility and store them with the
// marker's id.
final ChangeListener<Coordinate> coordinateChan... | [
"private",
"void",
"addMapCoordinateElement",
"(",
"final",
"MapCoordinateElement",
"mapCoordinateElement",
")",
"{",
"final",
"String",
"id",
"=",
"mapCoordinateElement",
".",
"getId",
"(",
")",
";",
"// create change listeners for the coordinate and the visibility and store t... | sets up the internal information about a MapCoordinate Element.
@param mapCoordinateElement
the MapCooordinate Element | [
"sets",
"up",
"the",
"internal",
"information",
"about",
"a",
"MapCoordinate",
"Element",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L608-L629 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.setMarkerVisibleInMap | private void setMarkerVisibleInMap(final String id) {
if (null != id) {
final WeakReference<MapCoordinateElement> weakReference = mapCoordinateElements.get(id);
if (null != weakReference) {
final MapCoordinateElement mapCoordinateElement = weakReference.get();
... | java | private void setMarkerVisibleInMap(final String id) {
if (null != id) {
final WeakReference<MapCoordinateElement> weakReference = mapCoordinateElements.get(id);
if (null != weakReference) {
final MapCoordinateElement mapCoordinateElement = weakReference.get();
... | [
"private",
"void",
"setMarkerVisibleInMap",
"(",
"final",
"String",
"id",
")",
"{",
"if",
"(",
"null",
"!=",
"id",
")",
"{",
"final",
"WeakReference",
"<",
"MapCoordinateElement",
">",
"weakReference",
"=",
"mapCoordinateElements",
".",
"get",
"(",
"id",
")",
... | sets the visibility of a MapCoordinateElement in the map.
@param id
the marker to show or hide | [
"sets",
"the",
"visibility",
"of",
"a",
"MapCoordinateElement",
"in",
"the",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L649-L663 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.moveMapCoordinateElementInMap | private void moveMapCoordinateElementInMap(final String id) {
if (getInitialized() && null != id) {
final WeakReference<MapCoordinateElement> weakReference = mapCoordinateElements.get(id);
if (null != weakReference) {
final MapCoordinateElement mapCoordinateElement = weak... | java | private void moveMapCoordinateElementInMap(final String id) {
if (getInitialized() && null != id) {
final WeakReference<MapCoordinateElement> weakReference = mapCoordinateElements.get(id);
if (null != weakReference) {
final MapCoordinateElement mapCoordinateElement = weak... | [
"private",
"void",
"moveMapCoordinateElementInMap",
"(",
"final",
"String",
"id",
")",
"{",
"if",
"(",
"getInitialized",
"(",
")",
"&&",
"null",
"!=",
"id",
")",
"{",
"final",
"WeakReference",
"<",
"MapCoordinateElement",
">",
"weakReference",
"=",
"mapCoordinat... | adjusts the mapCoordinateElement's position in the map.
@param id
the id of the element to move | [
"adjusts",
"the",
"mapCoordinateElement",
"s",
"position",
"in",
"the",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L671-L686 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.addMarker | public MapView addMarker(final Marker marker) {
if (!getInitialized()) {
if (logger.isWarnEnabled()) {
logger.warn(MAP_VIEW_NOT_YET_INITIALIZED);
}
} else {
if (null == requireNonNull(marker).getPosition()) {
if (logger.isTraceEnabled()... | java | public MapView addMarker(final Marker marker) {
if (!getInitialized()) {
if (logger.isWarnEnabled()) {
logger.warn(MAP_VIEW_NOT_YET_INITIALIZED);
}
} else {
if (null == requireNonNull(marker).getPosition()) {
if (logger.isTraceEnabled()... | [
"public",
"MapView",
"addMarker",
"(",
"final",
"Marker",
"marker",
")",
"{",
"if",
"(",
"!",
"getInitialized",
"(",
")",
")",
"{",
"if",
"(",
"logger",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"logger",
".",
"warn",
"(",
"MAP_VIEW_NOT_YET_INITIALIZED",
... | adds a marker to the map. If it was already added, nothing is changed. If the MapView is not yet initialized, a
warning is logged and nothing changes. If the marker has no coordinate set, it is not added and a logging entry
is written.
The MapView only keeps a weak reference to the marker, so the caller must keep a re... | [
"adds",
"a",
"marker",
"to",
"the",
"map",
".",
"If",
"it",
"was",
"already",
"added",
"nothing",
"is",
"changed",
".",
"If",
"the",
"MapView",
"is",
"not",
"yet",
"initialized",
"a",
"warning",
"is",
"logged",
"and",
"nothing",
"changes",
".",
"If",
"... | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L702-L732 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | MapView.createDataURI | @SuppressWarnings("UnusedDeclaration")
private String createDataURI(final URL imageURL) {
return imgCache.computeIfAbsent(imageURL, url -> {
String dataUrl = null;
try (final InputStream isGuess = url.openStream();
final InputStream isConvert = url.openStream();
... | java | @SuppressWarnings("UnusedDeclaration")
private String createDataURI(final URL imageURL) {
return imgCache.computeIfAbsent(imageURL, url -> {
String dataUrl = null;
try (final InputStream isGuess = url.openStream();
final InputStream isConvert = url.openStream();
... | [
"@",
"SuppressWarnings",
"(",
"\"UnusedDeclaration\"",
")",
"private",
"String",
"createDataURI",
"(",
"final",
"URL",
"imageURL",
")",
"{",
"return",
"imgCache",
".",
"computeIfAbsent",
"(",
"imageURL",
",",
"url",
"->",
"{",
"String",
"dataUrl",
"=",
"null",
... | loads an image and converts it's data to a base64 encoded data url.
NOT NEEDED AT THE MOMENT
@param imageURL
where to load the image from, may not be null
@return the encoded image as data url | [
"loads",
"an",
"image",
"and",
"converts",
"it",
"s",
"data",
"to",
"a",
"base64",
"encoded",
"data",
"url",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L751-L785 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.showLink | public void showLink(final String href) {
if (null != href && !href.isEmpty()) {
if (logger.isTraceEnabled()) {
logger.trace("JS asks to browse to {}", href);
}
if (!Desktop.isDesktopSupported()) {
if (logger.isWarnEnabl... | java | public void showLink(final String href) {
if (null != href && !href.isEmpty()) {
if (logger.isTraceEnabled()) {
logger.trace("JS asks to browse to {}", href);
}
if (!Desktop.isDesktopSupported()) {
if (logger.isWarnEnabl... | [
"public",
"void",
"showLink",
"(",
"final",
"String",
"href",
")",
"{",
"if",
"(",
"null",
"!=",
"href",
"&&",
"!",
"href",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"logger",
".",
"trace",
... | called when an a href in the map is clicked and shows the URL in the default browser.
@param href
the url to show | [
"called",
"when",
"an",
"a",
"href",
"in",
"the",
"map",
"is",
"clicked",
"and",
"shows",
"the",
"URL",
"in",
"the",
"default",
"browser",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1343-L1362 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.processMarkerClicked | private void processMarkerClicked(final String name, final ClickType clickType) {
if (logger.isTraceEnabled()) {
logger.trace("JS reports marker {} clicked {}", name, clickType);
}
synchronized (mapCoordinateElements) {
if (mapCoordinateElements.contai... | java | private void processMarkerClicked(final String name, final ClickType clickType) {
if (logger.isTraceEnabled()) {
logger.trace("JS reports marker {} clicked {}", name, clickType);
}
synchronized (mapCoordinateElements) {
if (mapCoordinateElements.contai... | [
"private",
"void",
"processMarkerClicked",
"(",
"final",
"String",
"name",
",",
"final",
"ClickType",
"clickType",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"logger",
".",
"trace",
"(",
"\"JS reports marker {} clicked {}\"",
",",
... | processes a marker click
@param name
name of the marker
@param clickType
the type of click | [
"processes",
"a",
"marker",
"click"
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1474-L1508 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.processLabelClicked | private void processLabelClicked(final String name, final ClickType clickType) {
if (logger.isTraceEnabled()) {
logger.trace("JS reports label {} clicked {}", name, clickType);
}
synchronized (mapCoordinateElements) {
if (mapCoordinateElements.contains... | java | private void processLabelClicked(final String name, final ClickType clickType) {
if (logger.isTraceEnabled()) {
logger.trace("JS reports label {} clicked {}", name, clickType);
}
synchronized (mapCoordinateElements) {
if (mapCoordinateElements.contains... | [
"private",
"void",
"processLabelClicked",
"(",
"final",
"String",
"name",
",",
"final",
"ClickType",
"clickType",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"logger",
".",
"trace",
"(",
"\"JS reports label {} clicked {}\"",
",",
... | called when a label was clicked.
@param name
name of the lael
@param clickType
the type of click | [
"called",
"when",
"a",
"label",
"was",
"clicked",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1588-L1624 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.zoomChanged | public void zoomChanged(double newZoom) {
final long roundedZoom = Math.round(newZoom);
if (logger.isTraceEnabled()) {
logger.trace("JS reports zoom value {}", roundedZoom);
}
lastZoomFromMap.set(roundedZoom);
setZoom(roundedZoom);
} | java | public void zoomChanged(double newZoom) {
final long roundedZoom = Math.round(newZoom);
if (logger.isTraceEnabled()) {
logger.trace("JS reports zoom value {}", roundedZoom);
}
lastZoomFromMap.set(roundedZoom);
setZoom(roundedZoom);
} | [
"public",
"void",
"zoomChanged",
"(",
"double",
"newZoom",
")",
"{",
"final",
"long",
"roundedZoom",
"=",
"Math",
".",
"round",
"(",
"newZoom",
")",
";",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"logger",
".",
"trace",
"(",
"\"JS... | called when the user changed the zoom with the controls in the map.
@param newZoom
new zoom value | [
"called",
"when",
"the",
"user",
"changed",
"the",
"zoom",
"with",
"the",
"controls",
"in",
"the",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1632-L1639 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.extentSelected | public void extentSelected(double latMin, double lonMin, double latMax, double lonMax) {
final Extent extent = Extent.forCoordinates(new Coordinate(latMin, lonMin), new Coordinate(latMax, lonMax));
if (logger.isTraceEnabled()) {
logger.trace("JS reports extend selected: {}", exte... | java | public void extentSelected(double latMin, double lonMin, double latMax, double lonMax) {
final Extent extent = Extent.forCoordinates(new Coordinate(latMin, lonMin), new Coordinate(latMax, lonMax));
if (logger.isTraceEnabled()) {
logger.trace("JS reports extend selected: {}", exte... | [
"public",
"void",
"extentSelected",
"(",
"double",
"latMin",
",",
"double",
"lonMin",
",",
"double",
"latMax",
",",
"double",
"lonMax",
")",
"{",
"final",
"Extent",
"extent",
"=",
"Extent",
".",
"forCoordinates",
"(",
"new",
"Coordinate",
"(",
"latMin",
",",... | called when the user selected an extent by dragging the mouse with modifier pressed.
@param latMin
latitude of upper left corner
@param lonMin
longitude of upper left corner
@param latMax
latitude of lower right corner
@param lonMax
longitude of lower right corner | [
"called",
"when",
"the",
"user",
"selected",
"an",
"extent",
"by",
"dragging",
"the",
"mouse",
"with",
"modifier",
"pressed",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1653-L1659 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.extentChanged | public void extentChanged(double latMin, double lonMin, double latMax, double lonMax) {
final Extent extent = Extent.forCoordinates(new Coordinate(latMin, lonMin), new Coordinate(latMax, lonMax));
if (logger.isTraceEnabled()) {
logger.trace("JS reports extend change: {}", extent)... | java | public void extentChanged(double latMin, double lonMin, double latMax, double lonMax) {
final Extent extent = Extent.forCoordinates(new Coordinate(latMin, lonMin), new Coordinate(latMax, lonMax));
if (logger.isTraceEnabled()) {
logger.trace("JS reports extend change: {}", extent)... | [
"public",
"void",
"extentChanged",
"(",
"double",
"latMin",
",",
"double",
"lonMin",
",",
"double",
"latMax",
",",
"double",
"lonMax",
")",
"{",
"final",
"Extent",
"extent",
"=",
"Extent",
".",
"forCoordinates",
"(",
"new",
"Coordinate",
"(",
"latMin",
",",
... | called when the map extent changed by changing the center or zoom of the map.
@param latMin
latitude of upper left corner
@param lonMin
longitude of upper left corner
@param latMax
latitude of lower right corner
@param lonMax
longitude of lower right corner | [
"called",
"when",
"the",
"map",
"extent",
"changed",
"by",
"changing",
"the",
"center",
"or",
"zoom",
"of",
"the",
"map",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1673-L1679 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/Extent.java | Extent.forCoordinates | public static Extent forCoordinates(Collection<? extends Coordinate> coordinates) {
requireNonNull(coordinates);
if (coordinates.size() < 2) {
throw new IllegalArgumentException();
}
double minLatitude = Double.MAX_VALUE;
double maxLatitude = -Double.MAX_VALUE;
... | java | public static Extent forCoordinates(Collection<? extends Coordinate> coordinates) {
requireNonNull(coordinates);
if (coordinates.size() < 2) {
throw new IllegalArgumentException();
}
double minLatitude = Double.MAX_VALUE;
double maxLatitude = -Double.MAX_VALUE;
... | [
"public",
"static",
"Extent",
"forCoordinates",
"(",
"Collection",
"<",
"?",
"extends",
"Coordinate",
">",
"coordinates",
")",
"{",
"requireNonNull",
"(",
"coordinates",
")",
";",
"if",
"(",
"coordinates",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",
"throw"... | creates the extent of the given coordinates.
@param coordinates
the coordinates
@return Extent for the coorinates
@throws java.lang.IllegalArgumentException
when less than 2 coordinates or null are passed in
@throws NullPointerException
when coordinates is null | [
"creates",
"the",
"extent",
"of",
"the",
"given",
"coordinates",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/Extent.java#L64-L81 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/offline/CachingURLStreamHandlerFactory.java | CachingURLStreamHandlerFactory.getURLStreamHandler | private URLStreamHandler getURLStreamHandler(final String protocol) {
try {
final Method method = URL.class.getDeclaredMethod("getURLStreamHandler", String.class);
method.setAccessible(true);
return (URLStreamHandler) method.invoke(null, protocol);
} catch (final Exce... | java | private URLStreamHandler getURLStreamHandler(final String protocol) {
try {
final Method method = URL.class.getDeclaredMethod("getURLStreamHandler", String.class);
method.setAccessible(true);
return (URLStreamHandler) method.invoke(null, protocol);
} catch (final Exce... | [
"private",
"URLStreamHandler",
"getURLStreamHandler",
"(",
"final",
"String",
"protocol",
")",
"{",
"try",
"{",
"final",
"Method",
"method",
"=",
"URL",
".",
"class",
".",
"getDeclaredMethod",
"(",
"\"getURLStreamHandler\"",
",",
"String",
".",
"class",
")",
";"... | returns the URL class's stream handler for a protocol. this uses inspection.
@param protocol
the protocol
@return the URLStreamHandler, null if it cannot be retrieved. | [
"returns",
"the",
"URL",
"class",
"s",
"stream",
"handler",
"for",
"a",
"protocol",
".",
"this",
"uses",
"inspection",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/offline/CachingURLStreamHandlerFactory.java#L74-L85 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/offline/CachingURLStreamHandlerFactory.java | CachingURLStreamHandlerFactory.createURLStreamHandler | @Override
public URLStreamHandler createURLStreamHandler(final String protocol) {
if (null == protocol) {
throw new IllegalArgumentException("null protocol not allowed");
}
if (logger.isTraceEnabled()) {
logger.trace("need to create URLStreamHandler for protocol {}", ... | java | @Override
public URLStreamHandler createURLStreamHandler(final String protocol) {
if (null == protocol) {
throw new IllegalArgumentException("null protocol not allowed");
}
if (logger.isTraceEnabled()) {
logger.trace("need to create URLStreamHandler for protocol {}", ... | [
"@",
"Override",
"public",
"URLStreamHandler",
"createURLStreamHandler",
"(",
"final",
"String",
"protocol",
")",
"{",
"if",
"(",
"null",
"==",
"protocol",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null protocol not allowed\"",
")",
";",
"}",
"... | default Handler for http and https. | [
"default",
"Handler",
"for",
"http",
"and",
"https",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/offline/CachingURLStreamHandlerFactory.java#L89-L153 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/Marker.java | Marker.createProvided | public static Marker createProvided(Provided provided) {
requireNonNull(provided);
return new Marker(Marker.class.getResource("/markers/" + provided.getFilename()), provided.getOffsetX(),
provided.getOffsetY());
} | java | public static Marker createProvided(Provided provided) {
requireNonNull(provided);
return new Marker(Marker.class.getResource("/markers/" + provided.getFilename()), provided.getOffsetX(),
provided.getOffsetY());
} | [
"public",
"static",
"Marker",
"createProvided",
"(",
"Provided",
"provided",
")",
"{",
"requireNonNull",
"(",
"provided",
")",
";",
"return",
"new",
"Marker",
"(",
"Marker",
".",
"class",
".",
"getResource",
"(",
"\"/markers/\"",
"+",
"provided",
".",
"getFile... | return a provided Marker with the given color.
@param provided
desired color
@return Marker
@throws NullPointerException
when provided is null | [
"return",
"a",
"provided",
"Marker",
"with",
"the",
"given",
"color",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/Marker.java#L66-L70 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/Marker.java | Marker.attachLabel | public Marker attachLabel(MapLabel mapLabel) {
optMapLabel = Optional.of(requireNonNull(mapLabel));
mapLabel.setMarker(this);
mapLabel.visibleProperty().bind(visibleProperty());
mapLabel.positionProperty().bind(positionProperty());
return this;
} | java | public Marker attachLabel(MapLabel mapLabel) {
optMapLabel = Optional.of(requireNonNull(mapLabel));
mapLabel.setMarker(this);
mapLabel.visibleProperty().bind(visibleProperty());
mapLabel.positionProperty().bind(positionProperty());
return this;
} | [
"public",
"Marker",
"attachLabel",
"(",
"MapLabel",
"mapLabel",
")",
"{",
"optMapLabel",
"=",
"Optional",
".",
"of",
"(",
"requireNonNull",
"(",
"mapLabel",
")",
")",
";",
"mapLabel",
".",
"setMarker",
"(",
"this",
")",
";",
"mapLabel",
".",
"visibleProperty... | attaches the MapLabel to this Marker
@param mapLabel
the MapLabel to attach
@return this object
@throws NullPointerException
of mapLabel is null | [
"attaches",
"the",
"MapLabel",
"to",
"this",
"Marker"
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/Marker.java#L149-L155 | train |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/Marker.java | Marker.detachLabel | public Marker detachLabel() {
optMapLabel.ifPresent(mapLabel -> {
mapLabel.setMarker(null);
mapLabel.visibleProperty().unbind();
mapLabel.positionProperty().unbind();
});
optMapLabel = Optional.empty();
return this;
} | java | public Marker detachLabel() {
optMapLabel.ifPresent(mapLabel -> {
mapLabel.setMarker(null);
mapLabel.visibleProperty().unbind();
mapLabel.positionProperty().unbind();
});
optMapLabel = Optional.empty();
return this;
} | [
"public",
"Marker",
"detachLabel",
"(",
")",
"{",
"optMapLabel",
".",
"ifPresent",
"(",
"mapLabel",
"->",
"{",
"mapLabel",
".",
"setMarker",
"(",
"null",
")",
";",
"mapLabel",
".",
"visibleProperty",
"(",
")",
".",
"unbind",
"(",
")",
";",
"mapLabel",
".... | detaches an attached Label.
@return this object | [
"detaches",
"an",
"attached",
"Label",
"."
] | 202091de492ab7a8b000c77efd833029f7f0ef92 | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/Marker.java#L162-L170 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/ResponseParser.java | ResponseParser.parse | public Object parse(SerializerHandler serializerHandler, InputStream response, boolean debugMode) throws XMLRPCException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document dom = ... | java | public Object parse(SerializerHandler serializerHandler, InputStream response, boolean debugMode) throws XMLRPCException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document dom = ... | [
"public",
"Object",
"parse",
"(",
"SerializerHandler",
"serializerHandler",
",",
"InputStream",
"response",
",",
"boolean",
"debugMode",
")",
"throws",
"XMLRPCException",
"{",
"try",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInsta... | The given InputStream must contain the xml response from an xmlrpc server.
This method extract the content of it as an object.
@param response The InputStream of the server response.
@return The returned object.
@throws XMLRPCException Will be thrown whenever something fails.
@throws XMLRPCServerException Will be thro... | [
"The",
"given",
"InputStream",
"must",
"contain",
"the",
"xml",
"response",
"from",
"an",
"xmlrpc",
"server",
".",
"This",
"method",
"extract",
"the",
"content",
"of",
"it",
"as",
"an",
"object",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/ResponseParser.java#L42-L90 | train |
gturri/aXMLRPC | src/main/java/de/timroes/base64/Base64.java | Base64.decode | public static byte[] decode(String in) {
in = in.replaceAll("\\r|\\n","");
if(in.length() % 4 != 0) {
throw new IllegalArgumentException("The length of the input string must be a multiple of four.");
}
if(!in.matches("^[A-Za-z0-9+/]*[=]{0,3}$")) {
throw new IllegalArgumentException("The argument contain... | java | public static byte[] decode(String in) {
in = in.replaceAll("\\r|\\n","");
if(in.length() % 4 != 0) {
throw new IllegalArgumentException("The length of the input string must be a multiple of four.");
}
if(!in.matches("^[A-Za-z0-9+/]*[=]{0,3}$")) {
throw new IllegalArgumentException("The argument contain... | [
"public",
"static",
"byte",
"[",
"]",
"decode",
"(",
"String",
"in",
")",
"{",
"in",
"=",
"in",
".",
"replaceAll",
"(",
"\"\\\\r|\\\\n\"",
",",
"\"\"",
")",
";",
"if",
"(",
"in",
".",
"length",
"(",
")",
"%",
"4",
"!=",
"0",
")",
"{",
"throw",
... | Decode a base64 encoded string to a byte array.
@param in A string representing a base64 encoding.
@return The decoded byte array. | [
"Decode",
"a",
"base64",
"encoded",
"string",
"to",
"a",
"byte",
"array",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/base64/Base64.java#L31-L66 | train |
gturri/aXMLRPC | src/main/java/de/timroes/base64/Base64.java | Base64.encode | public static String encode(Byte[] in) {
byte[] tmp = new byte[in.length];
for(int i = 0; i < tmp.length; i++) {
tmp[i] = in[i];
}
return encode(tmp);
} | java | public static String encode(Byte[] in) {
byte[] tmp = new byte[in.length];
for(int i = 0; i < tmp.length; i++) {
tmp[i] = in[i];
}
return encode(tmp);
} | [
"public",
"static",
"String",
"encode",
"(",
"Byte",
"[",
"]",
"in",
")",
"{",
"byte",
"[",
"]",
"tmp",
"=",
"new",
"byte",
"[",
"in",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tmp",
".",
"length",
";",
"i",
... | Encode a Byte array and return the encoded string.
@param in A string to encode.
@return The encoded byte array. | [
"Encode",
"a",
"Byte",
"array",
"and",
"return",
"the",
"encoded",
"string",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/base64/Base64.java#L94-L100 | train |
gturri/aXMLRPC | src/main/java/de/timroes/base64/Base64.java | Base64.encode | public static String encode(byte[] in) {
StringBuilder builder = new StringBuilder(4 * ((in.length+2)/3));
byte[] encoded = encodeAsBytes(in);
for(int i = 0; i < encoded.length; i++) {
builder.append(code[encoded[i]+1]);
if(i % 72 == 71)
builder.append("\n");
}
return builder.toString();
} | java | public static String encode(byte[] in) {
StringBuilder builder = new StringBuilder(4 * ((in.length+2)/3));
byte[] encoded = encodeAsBytes(in);
for(int i = 0; i < encoded.length; i++) {
builder.append(code[encoded[i]+1]);
if(i % 72 == 71)
builder.append("\n");
}
return builder.toString();
} | [
"public",
"static",
"String",
"encode",
"(",
"byte",
"[",
"]",
"in",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"4",
"*",
"(",
"(",
"in",
".",
"length",
"+",
"2",
")",
"/",
"3",
")",
")",
";",
"byte",
"[",
"]",
"encod... | Encode a byte array and return the encoded string.
@param in A string to encode.
@return The encoded byte array. | [
"Encode",
"a",
"byte",
"array",
"and",
"return",
"the",
"encoded",
"string",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/base64/Base64.java#L108-L117 | train |
gturri/aXMLRPC | src/main/java/de/timroes/base64/Base64.java | Base64.encodeAsBytes | public static byte[] encodeAsBytes(byte[] inArray) {
// Output string must be 4 * floor((n+2)/3) large
byte[] out = new byte[4 * ((inArray.length+2)/3)];
// Create padded input array with the next largest length that is a multiple of 3
byte[] in = new byte[(inArray.length+2)/3*3];
// Copy content form unpadd... | java | public static byte[] encodeAsBytes(byte[] inArray) {
// Output string must be 4 * floor((n+2)/3) large
byte[] out = new byte[4 * ((inArray.length+2)/3)];
// Create padded input array with the next largest length that is a multiple of 3
byte[] in = new byte[(inArray.length+2)/3*3];
// Copy content form unpadd... | [
"public",
"static",
"byte",
"[",
"]",
"encodeAsBytes",
"(",
"byte",
"[",
"]",
"inArray",
")",
"{",
"// Output string must be 4 * floor((n+2)/3) large",
"byte",
"[",
"]",
"out",
"=",
"new",
"byte",
"[",
"4",
"*",
"(",
"(",
"inArray",
".",
"length",
"+",
"2"... | Encode a byte array and return the encoded byte array. Bytes that has been
appended to pad the string to a multiple of four are set to -1 in the array.
@param inArray A string to encode.
@return The encoded byte array. | [
"Encode",
"a",
"byte",
"array",
"and",
"return",
"the",
"encoded",
"byte",
"array",
".",
"Bytes",
"that",
"has",
"been",
"appended",
"to",
"pad",
"the",
"string",
"to",
"a",
"multiple",
"of",
"four",
"are",
"set",
"to",
"-",
"1",
"in",
"the",
"array",
... | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/base64/Base64.java#L137-L161 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/AuthenticationManager.java | AuthenticationManager.setAuthentication | public void setAuthentication(HttpURLConnection http) {
if(user == null || pass == null
|| user.length() <= 0 || pass.length() <= 0) {
return;
}
String base64login = Base64.encode(user + ":" + pass);
http.addRequestProperty("Authorization", "Basic " + base64login);
} | java | public void setAuthentication(HttpURLConnection http) {
if(user == null || pass == null
|| user.length() <= 0 || pass.length() <= 0) {
return;
}
String base64login = Base64.encode(user + ":" + pass);
http.addRequestProperty("Authorization", "Basic " + base64login);
} | [
"public",
"void",
"setAuthentication",
"(",
"HttpURLConnection",
"http",
")",
"{",
"if",
"(",
"user",
"==",
"null",
"||",
"pass",
"==",
"null",
"||",
"user",
".",
"length",
"(",
")",
"<=",
"0",
"||",
"pass",
".",
"length",
"(",
")",
"<=",
"0",
")",
... | Set the authentication at the HttpURLConnection.
@param http The HttpURLConnection to set authentication. | [
"Set",
"the",
"authentication",
"at",
"the",
"HttpURLConnection",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/AuthenticationManager.java#L42-L53 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/Call.java | Call.getXMLParam | private XmlElement getXMLParam(Object o) throws XMLRPCException {
XmlElement param = new XmlElement(XMLRPCClient.PARAM);
XmlElement value = new XmlElement(XMLRPCClient.VALUE);
param.addChildren(value);
value.addChildren(serializerHandler.serialize(o));
return param;
} | java | private XmlElement getXMLParam(Object o) throws XMLRPCException {
XmlElement param = new XmlElement(XMLRPCClient.PARAM);
XmlElement value = new XmlElement(XMLRPCClient.VALUE);
param.addChildren(value);
value.addChildren(serializerHandler.serialize(o));
return param;
} | [
"private",
"XmlElement",
"getXMLParam",
"(",
"Object",
"o",
")",
"throws",
"XMLRPCException",
"{",
"XmlElement",
"param",
"=",
"new",
"XmlElement",
"(",
"XMLRPCClient",
".",
"PARAM",
")",
";",
"XmlElement",
"value",
"=",
"new",
"XmlElement",
"(",
"XMLRPCClient",... | Generates the param xml tag for a specific parameter object.
@param o The parameter object.
@return The object serialized into an xml tag.
@throws XMLRPCException Will be thrown if the serialization failed. | [
"Generates",
"the",
"param",
"xml",
"tag",
"for",
"a",
"specific",
"parameter",
"object",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/Call.java#L87-L93 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLRPCClient.java | XMLRPCClient.setCustomHttpHeader | public void setCustomHttpHeader(String headerName, String headerValue) {
if(CONTENT_TYPE.equals(headerName) || HOST.equals(headerName)
|| CONTENT_LENGTH.equals(headerName)) {
throw new XMLRPCRuntimeException("You cannot modify the Host, Content-Type or Content-Length header.");
}
httpParameters.put(headerN... | java | public void setCustomHttpHeader(String headerName, String headerValue) {
if(CONTENT_TYPE.equals(headerName) || HOST.equals(headerName)
|| CONTENT_LENGTH.equals(headerName)) {
throw new XMLRPCRuntimeException("You cannot modify the Host, Content-Type or Content-Length header.");
}
httpParameters.put(headerN... | [
"public",
"void",
"setCustomHttpHeader",
"(",
"String",
"headerName",
",",
"String",
"headerValue",
")",
"{",
"if",
"(",
"CONTENT_TYPE",
".",
"equals",
"(",
"headerName",
")",
"||",
"HOST",
".",
"equals",
"(",
"headerName",
")",
"||",
"CONTENT_LENGTH",
".",
... | Set a HTTP header field to a custom value.
You cannot modify the Host or Content-Type field that way.
If the field already exists, the old value is overwritten.
@param headerName The name of the header field.
@param headerValue The new value of the header field. | [
"Set",
"a",
"HTTP",
"header",
"field",
"to",
"a",
"custom",
"value",
".",
"You",
"cannot",
"modify",
"the",
"Host",
"or",
"Content",
"-",
"Type",
"field",
"that",
"way",
".",
"If",
"the",
"field",
"already",
"exists",
"the",
"old",
"value",
"is",
"over... | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java#L344-L350 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLRPCClient.java | XMLRPCClient.callAsync | public long callAsync(XMLRPCCallback listener, String methodName, Object... params) {
long id = System.currentTimeMillis();
new Caller(listener, id, methodName, params).start();
return id;
} | java | public long callAsync(XMLRPCCallback listener, String methodName, Object... params) {
long id = System.currentTimeMillis();
new Caller(listener, id, methodName, params).start();
return id;
} | [
"public",
"long",
"callAsync",
"(",
"XMLRPCCallback",
"listener",
",",
"String",
"methodName",
",",
"Object",
"...",
"params",
")",
"{",
"long",
"id",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"new",
"Caller",
"(",
"listener",
",",
"id",
",",... | Asynchronously call a remote procedure on the server. The method must be
described by a method name. If the method requires parameters, this must
be set. When the server returns a response the onResponse method is called
on the listener. If the server returns an error the onServerError method
is called on the listener... | [
"Asynchronously",
"call",
"a",
"remote",
"procedure",
"on",
"the",
"server",
".",
"The",
"method",
"must",
"be",
"described",
"by",
"a",
"method",
"name",
".",
"If",
"the",
"method",
"requires",
"parameters",
"this",
"must",
"be",
"set",
".",
"When",
"the"... | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java#L485-L489 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLRPCClient.java | XMLRPCClient.cancel | public void cancel(long id) {
// Lookup the background call for the given id.
Caller cancel = backgroundCalls.get(id);
if(cancel == null) {
return;
}
// Cancel the thread
cancel.cancel();
try {
// Wait for the thread
cancel.join();
} catch (InterruptedException ex) {
// Ignore this
}
... | java | public void cancel(long id) {
// Lookup the background call for the given id.
Caller cancel = backgroundCalls.get(id);
if(cancel == null) {
return;
}
// Cancel the thread
cancel.cancel();
try {
// Wait for the thread
cancel.join();
} catch (InterruptedException ex) {
// Ignore this
}
... | [
"public",
"void",
"cancel",
"(",
"long",
"id",
")",
"{",
"// Lookup the background call for the given id.",
"Caller",
"cancel",
"=",
"backgroundCalls",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"cancel",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// Canc... | Cancel a specific asynchronous call.
@param id The id of the call as returned by the callAsync method. | [
"Cancel",
"a",
"specific",
"asynchronous",
"call",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java#L496-L514 | train |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLRPCClient.java | XMLRPCClient.createCall | private Call createCall(String method, Object[] params) {
if(isFlagSet(FLAGS_STRICT) && !method.matches("^[A-Za-z0-9\\._:/]*$")) {
throw new XMLRPCRuntimeException("Method name must only contain A-Z a-z . : _ / ");
}
return new Call(serializerHandler, method, params);
} | java | private Call createCall(String method, Object[] params) {
if(isFlagSet(FLAGS_STRICT) && !method.matches("^[A-Za-z0-9\\._:/]*$")) {
throw new XMLRPCRuntimeException("Method name must only contain A-Z a-z . : _ / ");
}
return new Call(serializerHandler, method, params);
} | [
"private",
"Call",
"createCall",
"(",
"String",
"method",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"if",
"(",
"isFlagSet",
"(",
"FLAGS_STRICT",
")",
"&&",
"!",
"method",
".",
"matches",
"(",
"\"^[A-Za-z0-9\\\\._:/]*$\"",
")",
")",
"{",
"throw",
"new",
... | Create a call object from a given method string and parameters.
@param method The method that should be called.
@param params An array of parameters or null if no parameters needed.
@return A call object. | [
"Create",
"a",
"call",
"object",
"from",
"a",
"given",
"method",
"string",
"and",
"parameters",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java#L523-L530 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.