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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.generateConfigFile | static void generateConfigFile(String configFilePath) throws ConfigurationException {
String fileExtention = FilenameUtils.getExtension(configFilePath);
ConfigProvider<Configuration> provider = getProviderByFileExtention(fileExtention);
if (!AuditUtil.isFileExists(configFilePath)) {
... | java | static void generateConfigFile(String configFilePath) throws ConfigurationException {
String fileExtention = FilenameUtils.getExtension(configFilePath);
ConfigProvider<Configuration> provider = getProviderByFileExtention(fileExtention);
if (!AuditUtil.isFileExists(configFilePath)) {
... | [
"static",
"void",
"generateConfigFile",
"(",
"String",
"configFilePath",
")",
"throws",
"ConfigurationException",
"{",
"String",
"fileExtention",
"=",
"FilenameUtils",
".",
"getExtension",
"(",
"configFilePath",
")",
";",
"ConfigProvider",
"<",
"Configuration",
">",
"... | Generate config file.
@param configFilePath the config file path
@throws ConfigurationException the configuration exception | [
"Generate",
"config",
"file",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L168-L174 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.getProviderByFileExtention | private static ConfigProvider<Configuration> getProviderByFileExtention(String extention) throws ConfigurationException {
ConfigProvider<Configuration> provider;
if (XML_EXTENTION.equals(extention)) {
provider = new XMLConfigProvider<>(Configuration.class);
} else if (YML_EXTENTION.e... | java | private static ConfigProvider<Configuration> getProviderByFileExtention(String extention) throws ConfigurationException {
ConfigProvider<Configuration> provider;
if (XML_EXTENTION.equals(extention)) {
provider = new XMLConfigProvider<>(Configuration.class);
} else if (YML_EXTENTION.e... | [
"private",
"static",
"ConfigProvider",
"<",
"Configuration",
">",
"getProviderByFileExtention",
"(",
"String",
"extention",
")",
"throws",
"ConfigurationException",
"{",
"ConfigProvider",
"<",
"Configuration",
">",
"provider",
";",
"if",
"(",
"XML_EXTENTION",
".",
"eq... | Gets the provider by file extention.
@param extention
the extention
@return the provider by file extention
@throws ConfigurationException | [
"Gets",
"the",
"provider",
"by",
"file",
"extention",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L184-L196 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.getEnvironemtVariableConfigFilePath | static Path getEnvironemtVariableConfigFilePath() {
final String value = System.getenv(ENVIRONMENT_CONFIG_VARIABLE_NAME);
return Paths.get(value);
} | java | static Path getEnvironemtVariableConfigFilePath() {
final String value = System.getenv(ENVIRONMENT_CONFIG_VARIABLE_NAME);
return Paths.get(value);
} | [
"static",
"Path",
"getEnvironemtVariableConfigFilePath",
"(",
")",
"{",
"final",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"ENVIRONMENT_CONFIG_VARIABLE_NAME",
")",
";",
"return",
"Paths",
".",
"get",
"(",
"value",
")",
";",
"}"
] | Gets the environemt variable config file path.
@return the environemt variable config file path | [
"Gets",
"the",
"environemt",
"variable",
"config",
"file",
"path",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L203-L206 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.hasEnvironmentVariable | static boolean hasEnvironmentVariable(String variable) {
final String value = System.getenv(variable);
if (value != null) {
return true;
}
return false;
} | java | static boolean hasEnvironmentVariable(String variable) {
final String value = System.getenv(variable);
if (value != null) {
return true;
}
return false;
} | [
"static",
"boolean",
"hasEnvironmentVariable",
"(",
"String",
"variable",
")",
"{",
"final",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"variable",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"fa... | Checks for environment variable.
@param variable the variable
@return true, if successful | [
"Checks",
"for",
"environment",
"variable",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L214-L220 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.getSystemPropertyConfigFilePath | static Path getSystemPropertyConfigFilePath() {
final String path = System.getProperty(SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME);
return Paths.get(path);
} | java | static Path getSystemPropertyConfigFilePath() {
final String path = System.getProperty(SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME);
return Paths.get(path);
} | [
"static",
"Path",
"getSystemPropertyConfigFilePath",
"(",
")",
"{",
"final",
"String",
"path",
"=",
"System",
".",
"getProperty",
"(",
"SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME",
")",
";",
"return",
"Paths",
".",
"get",
"(",
"path",
")",
";",
"}"
] | Gets the system property config file path.
@return the system property config file path | [
"Gets",
"the",
"system",
"property",
"config",
"file",
"path",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L227-L230 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.hasSystemPropertyVariable | static boolean hasSystemPropertyVariable(String variable) {
final String path = System.getProperty(variable);
if (path != null) {
return true;
}
return false;
} | java | static boolean hasSystemPropertyVariable(String variable) {
final String path = System.getProperty(variable);
if (path != null) {
return true;
}
return false;
} | [
"static",
"boolean",
"hasSystemPropertyVariable",
"(",
"String",
"variable",
")",
"{",
"final",
"String",
"path",
"=",
"System",
".",
"getProperty",
"(",
"variable",
")",
";",
"if",
"(",
"path",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",... | Checks for system property variable.
@param variable the variable
@return true, if successful | [
"Checks",
"for",
"system",
"property",
"variable",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L238-L244 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Configurations.java | Configurations.getFileAsStream | static InputStream getFileAsStream(File resourceFile) throws ConfigurationException {
try {
return new FileInputStream(resourceFile);
} catch (FileNotFoundException e) {
Log.error("File Resource could not be resolved. Given Resource:" + resourceFile, e);
throw new Con... | java | static InputStream getFileAsStream(File resourceFile) throws ConfigurationException {
try {
return new FileInputStream(resourceFile);
} catch (FileNotFoundException e) {
Log.error("File Resource could not be resolved. Given Resource:" + resourceFile, e);
throw new Con... | [
"static",
"InputStream",
"getFileAsStream",
"(",
"File",
"resourceFile",
")",
"throws",
"ConfigurationException",
"{",
"try",
"{",
"return",
"new",
"FileInputStream",
"(",
"resourceFile",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
"Log",
... | Gets the file as stream.
@param resourceFile
the resource file
@return the file as stream
@throws ConfigurationException | [
"Gets",
"the",
"file",
"as",
"stream",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Configurations.java#L278-L285 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/FileAuditHandler.java | FileAuditHandler.hasDiskAccess | static boolean hasDiskAccess(final String path) {
try {
AccessController.checkPermission(new FilePermission(path, "read,write"));
return true;
} catch (AccessControlException e) {
return false;
}
} | java | static boolean hasDiskAccess(final String path) {
try {
AccessController.checkPermission(new FilePermission(path, "read,write"));
return true;
} catch (AccessControlException e) {
return false;
}
} | [
"static",
"boolean",
"hasDiskAccess",
"(",
"final",
"String",
"path",
")",
"{",
"try",
"{",
"AccessController",
".",
"checkPermission",
"(",
"new",
"FilePermission",
"(",
"path",
",",
"\"read,write\"",
")",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",... | Checks for disk access.
@param path
the path
@return true, if successful | [
"Checks",
"for",
"disk",
"access",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/FileAuditHandler.java#L120-L127 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/ClassLoaderUtils.java | ClassLoaderUtils.getClassLoader | public static ClassLoader getClassLoader(final Class<?> clazz) {
// Context class loader can be null
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
if (contextClassLoader != null) {
return contextClassLoader;
}
if (clazz != null... | java | public static ClassLoader getClassLoader(final Class<?> clazz) {
// Context class loader can be null
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
if (contextClassLoader != null) {
return contextClassLoader;
}
if (clazz != null... | [
"public",
"static",
"ClassLoader",
"getClassLoader",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"// Context class loader can be null",
"final",
"ClassLoader",
"contextClassLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoade... | Gets the class loader.
@param clazz the clazz
@return the class loader | [
"Gets",
"the",
"class",
"loader",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/ClassLoaderUtils.java#L25-L41 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/ConcurrentTimelyBufferedArrayList.java | ConcurrentTimelyBufferedArrayList.getBuffered | public List<E> getBuffered() {
List<E> temp = new ArrayList<>(buff);
clear();
return temp;
} | java | public List<E> getBuffered() {
List<E> temp = new ArrayList<>(buff);
clear();
return temp;
} | [
"public",
"List",
"<",
"E",
">",
"getBuffered",
"(",
")",
"{",
"List",
"<",
"E",
">",
"temp",
"=",
"new",
"ArrayList",
"<>",
"(",
"buff",
")",
";",
"clear",
"(",
")",
";",
"return",
"temp",
";",
"}"
] | Gets the buffered.
@return the buffered | [
"Gets",
"the",
"buffered",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/ConcurrentTimelyBufferedArrayList.java#L136-L140 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/dto/Event.java | Event.setRepository | public void setRepository(String repository) {
if (meta == null) {
meta = new EventMeta();
}
meta.setRepository(repository);
} | java | public void setRepository(String repository) {
if (meta == null) {
meta = new EventMeta();
}
meta.setRepository(repository);
} | [
"public",
"void",
"setRepository",
"(",
"String",
"repository",
")",
"{",
"if",
"(",
"meta",
"==",
"null",
")",
"{",
"meta",
"=",
"new",
"EventMeta",
"(",
")",
";",
"}",
"meta",
".",
"setRepository",
"(",
"repository",
")",
";",
"}"
] | Sets the repository.
@param repository
the new repository | [
"Sets",
"the",
"repository",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/dto/Event.java#L97-L102 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/dto/Event.java | Event.setClient | public void setClient(String client) {
if (meta == null) {
meta = new EventMeta();
}
meta.setClient(client);
} | java | public void setClient(String client) {
if (meta == null) {
meta = new EventMeta();
}
meta.setClient(client);
} | [
"public",
"void",
"setClient",
"(",
"String",
"client",
")",
"{",
"if",
"(",
"meta",
"==",
"null",
")",
"{",
"meta",
"=",
"new",
"EventMeta",
"(",
")",
";",
"}",
"meta",
".",
"setClient",
"(",
"client",
")",
";",
"}"
] | Sets the client.
@param client
the new client | [
"Sets",
"the",
"client",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/dto/Event.java#L110-L115 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/Base64Coder.java | Base64Coder.encodeLines | public static String encodeLines(final byte[] input, final int iOff, final int iLen, final int lineLen,
final String lineSeparator) {
final int blockLen = (lineLen * CONSTANT_3) / CONSTANT_4;
if (blockLen <= 0) {
throw new IllegalArgumentException();
}
final int lines =... | java | public static String encodeLines(final byte[] input, final int iOff, final int iLen, final int lineLen,
final String lineSeparator) {
final int blockLen = (lineLen * CONSTANT_3) / CONSTANT_4;
if (blockLen <= 0) {
throw new IllegalArgumentException();
}
final int lines =... | [
"public",
"static",
"String",
"encodeLines",
"(",
"final",
"byte",
"[",
"]",
"input",
",",
"final",
"int",
"iOff",
",",
"final",
"int",
"iLen",
",",
"final",
"int",
"lineLen",
",",
"final",
"String",
"lineSeparator",
")",
"{",
"final",
"int",
"blockLen",
... | Encode lines.
@param input the input
@param iOff the i off
@param iLen the i len
@param lineLen the line len
@param lineSeparator the line separator
@return the string | [
"Encode",
"lines",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/Base64Coder.java#L134-L151 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/Base64Coder.java | Base64Coder.decodeLines | public static byte[] decodeLines(final String text) {
char[] buf = new char[text.length()];
int pValue = 0;
for (int ip = 0; ip < text.length(); ip++) {
final char cValue = text.charAt(ip);
if (cValue != ' ' && cValue != '\r' && cValue != '\n' && cValue != '\t') {
... | java | public static byte[] decodeLines(final String text) {
char[] buf = new char[text.length()];
int pValue = 0;
for (int ip = 0; ip < text.length(); ip++) {
final char cValue = text.charAt(ip);
if (cValue != ' ' && cValue != '\r' && cValue != '\n' && cValue != '\t') {
... | [
"public",
"static",
"byte",
"[",
"]",
"decodeLines",
"(",
"final",
"String",
"text",
")",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"text",
".",
"length",
"(",
")",
"]",
";",
"int",
"pValue",
"=",
"0",
";",
"for",
"(",
"int",
"ip",
... | Decode lines.
@param text the text
@return the byte[] | [
"Decode",
"lines",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/Base64Coder.java#L223-L233 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/ObjectToJsonSerializer.java | ObjectToJsonSerializer.toJson | public final static String toJson(Object object, DeIdentify deidentify) {
if (isPrimitive(object)) {
Object deidentifiedObj = deidentifyObject(object, deidentify);
String primitiveValue = String.valueOf(deidentifiedObj);
if (object instanceof String || object instanceof Chara... | java | public final static String toJson(Object object, DeIdentify deidentify) {
if (isPrimitive(object)) {
Object deidentifiedObj = deidentifyObject(object, deidentify);
String primitiveValue = String.valueOf(deidentifiedObj);
if (object instanceof String || object instanceof Chara... | [
"public",
"final",
"static",
"String",
"toJson",
"(",
"Object",
"object",
",",
"DeIdentify",
"deidentify",
")",
"{",
"if",
"(",
"isPrimitive",
"(",
"object",
")",
")",
"{",
"Object",
"deidentifiedObj",
"=",
"deidentifyObject",
"(",
"object",
",",
"deidentify",... | Converts an object to json.
@param object an object
@param deidentify the deidentify
@return a json string of the object | [
"Converts",
"an",
"object",
"to",
"json",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/ObjectToJsonSerializer.java#L63-L73 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java | DeIdentifyUtil.deidentifyLeft | public static String deidentifyLeft(String str, int size) {
int repeat;
if (size > str.length()) {
repeat = str.length();
} else {
repeat = size;
}
return StringUtils.overlay(str, StringUtils.repeat('*', repeat), 0, size);
} | java | public static String deidentifyLeft(String str, int size) {
int repeat;
if (size > str.length()) {
repeat = str.length();
} else {
repeat = size;
}
return StringUtils.overlay(str, StringUtils.repeat('*', repeat), 0, size);
} | [
"public",
"static",
"String",
"deidentifyLeft",
"(",
"String",
"str",
",",
"int",
"size",
")",
"{",
"int",
"repeat",
";",
"if",
"(",
"size",
">",
"str",
".",
"length",
"(",
")",
")",
"{",
"repeat",
"=",
"str",
".",
"length",
"(",
")",
";",
"}",
"... | Deidentify left.
@param str the str
@param size the size
@return the string
@since 2.0.0 | [
"Deidentify",
"left",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java#L49-L57 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java | DeIdentifyUtil.deidentifyRight | public static String deidentifyRight(String str, int size) {
int end = str.length();
int repeat;
if (size > str.length()) {
repeat = str.length();
} else {
repeat = size;
}
return StringUtils.overlay(str, StringUtils.repeat('*', repeat), end - size, end);
} | java | public static String deidentifyRight(String str, int size) {
int end = str.length();
int repeat;
if (size > str.length()) {
repeat = str.length();
} else {
repeat = size;
}
return StringUtils.overlay(str, StringUtils.repeat('*', repeat), end - size, end);
} | [
"public",
"static",
"String",
"deidentifyRight",
"(",
"String",
"str",
",",
"int",
"size",
")",
"{",
"int",
"end",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"repeat",
";",
"if",
"(",
"size",
">",
"str",
".",
"length",
"(",
")",
")",
"{",
"... | Deidentify right.
@param str the str
@param size the size
@return the string
@since 2.0.0 | [
"Deidentify",
"right",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java#L68-L77 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java | DeIdentifyUtil.deidentifyMiddle | public static String deidentifyMiddle(String str, int start, int end) {
int repeat;
if (end - start > str.length()) {
repeat = str.length();
} else {
repeat = (str.length()- end) - start;
}
return StringUtils.overlay(str, StringUtils.repeat('*', repeat), start, str.length()-end);
} | java | public static String deidentifyMiddle(String str, int start, int end) {
int repeat;
if (end - start > str.length()) {
repeat = str.length();
} else {
repeat = (str.length()- end) - start;
}
return StringUtils.overlay(str, StringUtils.repeat('*', repeat), start, str.length()-end);
} | [
"public",
"static",
"String",
"deidentifyMiddle",
"(",
"String",
"str",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"repeat",
";",
"if",
"(",
"end",
"-",
"start",
">",
"str",
".",
"length",
"(",
")",
")",
"{",
"repeat",
"=",
"str",
"."... | Deidentify middle.
@param str the str
@param start the start
@param end the end
@return the string
@since 2.0.0 | [
"Deidentify",
"middle",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java#L129-L138 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java | DeIdentifyUtil.deidentifyEdge | public static String deidentifyEdge(String str, int start, int end) {
return deidentifyLeft(deidentifyRight(str, end), start);
} | java | public static String deidentifyEdge(String str, int start, int end) {
return deidentifyLeft(deidentifyRight(str, end), start);
} | [
"public",
"static",
"String",
"deidentifyEdge",
"(",
"String",
"str",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"deidentifyLeft",
"(",
"deidentifyRight",
"(",
"str",
",",
"end",
")",
",",
"start",
")",
";",
"}"
] | Deidentify edge.
@param str the str
@param start the start
@param end the end
@return the string
@since 2.0.0 | [
"Deidentify",
"edge",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java#L150-L152 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.stop | final static void stop() {
if (lifeCycle.getStatus().equals(RunStatus.RUNNING) || lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
lifeCycle.setStatus(RunStatus.STOPPED);
Log.info("Preparing to shutdown Audit4j...");
Log.info("Closing Streams...");
auditStream.close();
Log.info("Shutdown handlers.... | java | final static void stop() {
if (lifeCycle.getStatus().equals(RunStatus.RUNNING) || lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
lifeCycle.setStatus(RunStatus.STOPPED);
Log.info("Preparing to shutdown Audit4j...");
Log.info("Closing Streams...");
auditStream.close();
Log.info("Shutdown handlers.... | [
"final",
"static",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"lifeCycle",
".",
"getStatus",
"(",
")",
".",
"equals",
"(",
"RunStatus",
".",
"RUNNING",
")",
"||",
"lifeCycle",
".",
"getStatus",
"(",
")",
".",
"equals",
"(",
"RunStatus",
".",
"DISABLED",... | The Audit4j context shutdown method. This will release the all allocated
resources by the Audit4j Context initialization.
@since 2.2.0 | [
"The",
"Audit4j",
"context",
"shutdown",
"method",
".",
"This",
"will",
"release",
"the",
"all",
"allocated",
"resources",
"by",
"the",
"Audit4j",
"Context",
"initialization",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L245-L266 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.enable | final static void enable() {
if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
init();
} else if (lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
lifeCycle.setStatus(RunStatus.RUNNING);
}
} | java | final static void enable() {
if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
init();
} else if (lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
lifeCycle.setStatus(RunStatus.RUNNING);
}
} | [
"final",
"static",
"void",
"enable",
"(",
")",
"{",
"if",
"(",
"lifeCycle",
".",
"getStatus",
"(",
")",
".",
"equals",
"(",
"RunStatus",
".",
"READY",
")",
"||",
"lifeCycle",
".",
"getStatus",
"(",
")",
".",
"equals",
"(",
"RunStatus",
".",
"STOPPED",
... | Enable Audit4j core services.
@since 2.2.0 | [
"Enable",
"Audit4j",
"core",
"services",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L273-L279 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.checkEnvironment | private final static void checkEnvironment() {
// Check java support.!
boolean javaSupport = EnvUtil.isJDK7OrHigher();
if (!javaSupport) {
Log.error("Your Java version (", EnvUtil.getJavaersion(), ") is not supported for Audit4j. ",
ErrorGuide.getGuide(ErrorGuide.JAVA_VERSION_ERROR));
throw new Initial... | java | private final static void checkEnvironment() {
// Check java support.!
boolean javaSupport = EnvUtil.isJDK7OrHigher();
if (!javaSupport) {
Log.error("Your Java version (", EnvUtil.getJavaersion(), ") is not supported for Audit4j. ",
ErrorGuide.getGuide(ErrorGuide.JAVA_VERSION_ERROR));
throw new Initial... | [
"private",
"final",
"static",
"void",
"checkEnvironment",
"(",
")",
"{",
"// Check java support.!",
"boolean",
"javaSupport",
"=",
"EnvUtil",
".",
"isJDK7OrHigher",
"(",
")",
";",
"if",
"(",
"!",
"javaSupport",
")",
"{",
"Log",
".",
"error",
"(",
"\"Your Java ... | Check environment.
@since 2.3.0 | [
"Check",
"environment",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L315-L323 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.loadConfig | private final static void loadConfig() {
try {
conf = Configurations.loadConfig(configFilePath);
} catch (ConfigurationException e) {
terminate();
throw new InitializationException(INIT_FAILED, e);
}
} | java | private final static void loadConfig() {
try {
conf = Configurations.loadConfig(configFilePath);
} catch (ConfigurationException e) {
terminate();
throw new InitializationException(INIT_FAILED, e);
}
} | [
"private",
"final",
"static",
"void",
"loadConfig",
"(",
")",
"{",
"try",
"{",
"conf",
"=",
"Configurations",
".",
"loadConfig",
"(",
"configFilePath",
")",
";",
"}",
"catch",
"(",
"ConfigurationException",
"e",
")",
"{",
"terminate",
"(",
")",
";",
"throw... | Load configuration items. | [
"Load",
"configuration",
"items",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L328-L335 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.loadRegistry | private static void loadRegistry() {
// Load audit filters to runtime configurations.
for (AuditEventFilter filter : PreConfigurationContext.getPrefilters()) {
configContext.addFilter(filter);
}
// Load audit annotation filters to runtime configurations.
for (AuditAnnotationFilter annotationFilter : PreCon... | java | private static void loadRegistry() {
// Load audit filters to runtime configurations.
for (AuditEventFilter filter : PreConfigurationContext.getPrefilters()) {
configContext.addFilter(filter);
}
// Load audit annotation filters to runtime configurations.
for (AuditAnnotationFilter annotationFilter : PreCon... | [
"private",
"static",
"void",
"loadRegistry",
"(",
")",
"{",
"// Load audit filters to runtime configurations.",
"for",
"(",
"AuditEventFilter",
"filter",
":",
"PreConfigurationContext",
".",
"getPrefilters",
"(",
")",
")",
"{",
"configContext",
".",
"addFilter",
"(",
... | Load initial configurations from Registry.
@since 2.3.0 | [
"Load",
"initial",
"configurations",
"from",
"Registry",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L342-L351 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.initHandlers | private static void initHandlers() {
Log.info("Initializing Handlers...");
for (Handler handler : conf.getHandlers()) {
try {
if (!configContext.getHandlers().contains(handler)) {
Map<String, String> handlerproperties = new HashMap<>();
handlerproperties.putAll(configContext.getProperties());
... | java | private static void initHandlers() {
Log.info("Initializing Handlers...");
for (Handler handler : conf.getHandlers()) {
try {
if (!configContext.getHandlers().contains(handler)) {
Map<String, String> handlerproperties = new HashMap<>();
handlerproperties.putAll(configContext.getProperties());
... | [
"private",
"static",
"void",
"initHandlers",
"(",
")",
"{",
"Log",
".",
"info",
"(",
"\"Initializing Handlers...\"",
")",
";",
"for",
"(",
"Handler",
"handler",
":",
"conf",
".",
"getHandlers",
"(",
")",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"configConte... | Initialize handlers. | [
"Initialize",
"handlers",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L356-L375 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.initStreams | private static void initStreams() {
Log.info("Initializing Streams...");
MetadataCommand command = (MetadataCommand) PreConfigurationContext.getCommandByName("-metadata");
BatchCommand batchCommand = (BatchCommand) PreConfigurationContext.getCommandByName("-batchSize");
AsyncAnnotationAuditOutputStream async... | java | private static void initStreams() {
Log.info("Initializing Streams...");
MetadataCommand command = (MetadataCommand) PreConfigurationContext.getCommandByName("-metadata");
BatchCommand batchCommand = (BatchCommand) PreConfigurationContext.getCommandByName("-batchSize");
AsyncAnnotationAuditOutputStream async... | [
"private",
"static",
"void",
"initStreams",
"(",
")",
"{",
"Log",
".",
"info",
"(",
"\"Initializing Streams...\"",
")",
";",
"MetadataCommand",
"command",
"=",
"(",
"MetadataCommand",
")",
"PreConfigurationContext",
".",
"getCommandByName",
"(",
"\"-metadata\"",
")"... | Initialize streams. | [
"Initialize",
"streams",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L398-L433 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/Context.java | Context.getDefaultAnnotationTransformer | private static AnnotationTransformer<AuditEvent> getDefaultAnnotationTransformer() {
DefaultAnnotationTransformer defaultAnnotationTransformer = new DefaultAnnotationTransformer();
ObjectSerializerCommand serializerCommand = (ObjectSerializerCommand) PreConfigurationContext
.getCommandByName("-objectSerializer"... | java | private static AnnotationTransformer<AuditEvent> getDefaultAnnotationTransformer() {
DefaultAnnotationTransformer defaultAnnotationTransformer = new DefaultAnnotationTransformer();
ObjectSerializerCommand serializerCommand = (ObjectSerializerCommand) PreConfigurationContext
.getCommandByName("-objectSerializer"... | [
"private",
"static",
"AnnotationTransformer",
"<",
"AuditEvent",
">",
"getDefaultAnnotationTransformer",
"(",
")",
"{",
"DefaultAnnotationTransformer",
"defaultAnnotationTransformer",
"=",
"new",
"DefaultAnnotationTransformer",
"(",
")",
";",
"ObjectSerializerCommand",
"seriali... | Initializes and returns the default annotation transformer.
@return default annotation transformer | [
"Initializes",
"and",
"returns",
"the",
"default",
"annotation",
"transformer",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/Context.java#L440-L451 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/ValidationManager.java | ValidationManager.validateConfigurations | static void validateConfigurations(Configuration conf) throws ValidationException {
if (null == conf.getHandlers()) {
Log.error(
"Handler should not be null, One or more handler implementation shuld be configured in the configuration",
ErrorGuide.getGuide(Erro... | java | static void validateConfigurations(Configuration conf) throws ValidationException {
if (null == conf.getHandlers()) {
Log.error(
"Handler should not be null, One or more handler implementation shuld be configured in the configuration",
ErrorGuide.getGuide(Erro... | [
"static",
"void",
"validateConfigurations",
"(",
"Configuration",
"conf",
")",
"throws",
"ValidationException",
"{",
"if",
"(",
"null",
"==",
"conf",
".",
"getHandlers",
"(",
")",
")",
"{",
"Log",
".",
"error",
"(",
"\"Handler should not be null, One or more handler... | Validate configurations.
@param conf
the conf
@throws ValidationException
the validation exception | [
"Validate",
"configurations",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/ValidationManager.java#L70-L83 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/ValidationManager.java | ValidationManager.isSerializable | static boolean isSerializable(Object object) {
final boolean retVal;
if (implementsInterface(object)) {
retVal = attemptToSerialize(object);
} else {
retVal = false;
}
return retVal;
} | java | static boolean isSerializable(Object object) {
final boolean retVal;
if (implementsInterface(object)) {
retVal = attemptToSerialize(object);
} else {
retVal = false;
}
return retVal;
} | [
"static",
"boolean",
"isSerializable",
"(",
"Object",
"object",
")",
"{",
"final",
"boolean",
"retVal",
";",
"if",
"(",
"implementsInterface",
"(",
"object",
")",
")",
"{",
"retVal",
"=",
"attemptToSerialize",
"(",
"object",
")",
";",
"}",
"else",
"{",
"re... | Checks if is serializable.
@param object
the object
@return true, if is serializable | [
"Checks",
"if",
"is",
"serializable",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/ValidationManager.java#L92-L100 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/ValidationManager.java | ValidationManager.implementsInterface | private static boolean implementsInterface(final Object o) {
final boolean retVal;
retVal = (o instanceof Serializable) || (o instanceof Externalizable);
return retVal;
} | java | private static boolean implementsInterface(final Object o) {
final boolean retVal;
retVal = (o instanceof Serializable) || (o instanceof Externalizable);
return retVal;
} | [
"private",
"static",
"boolean",
"implementsInterface",
"(",
"final",
"Object",
"o",
")",
"{",
"final",
"boolean",
"retVal",
";",
"retVal",
"=",
"(",
"o",
"instanceof",
"Serializable",
")",
"||",
"(",
"o",
"instanceof",
"Externalizable",
")",
";",
"return",
"... | Implements interface.
@param o
the o
@return true, if successful | [
"Implements",
"interface",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/ValidationManager.java#L109-L113 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/ValidationManager.java | ValidationManager.attemptToSerialize | private static boolean attemptToSerialize(final Object o) {
final OutputStream sink;
ObjectOutputStream stream;
stream = null;
try {
sink = new ByteArrayOutputStream();
stream = new ObjectOutputStream(sink);
stream.writeObject(o);
// coul... | java | private static boolean attemptToSerialize(final Object o) {
final OutputStream sink;
ObjectOutputStream stream;
stream = null;
try {
sink = new ByteArrayOutputStream();
stream = new ObjectOutputStream(sink);
stream.writeObject(o);
// coul... | [
"private",
"static",
"boolean",
"attemptToSerialize",
"(",
"final",
"Object",
"o",
")",
"{",
"final",
"OutputStream",
"sink",
";",
"ObjectOutputStream",
"stream",
";",
"stream",
"=",
"null",
";",
"try",
"{",
"sink",
"=",
"new",
"ByteArrayOutputStream",
"(",
")... | Attempt to serialize.
@param o
the o
@return true, if successful | [
"Attempt",
"to",
"serialize",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/ValidationManager.java#L122-L146 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/command/AbstractCommand.java | AbstractCommand.getOptionsByCommand | protected List<String> getOptionsByCommand(String command){
String rawOption = commands.get(command);
String[] options = rawOption.split(CoreConstants.COMMA);
return Arrays.asList(options);
} | java | protected List<String> getOptionsByCommand(String command){
String rawOption = commands.get(command);
String[] options = rawOption.split(CoreConstants.COMMA);
return Arrays.asList(options);
} | [
"protected",
"List",
"<",
"String",
">",
"getOptionsByCommand",
"(",
"String",
"command",
")",
"{",
"String",
"rawOption",
"=",
"commands",
".",
"get",
"(",
"command",
")",
";",
"String",
"[",
"]",
"options",
"=",
"rawOption",
".",
"split",
"(",
"CoreConst... | Gets the options by command.
@param command the command
@return the options by command | [
"Gets",
"the",
"options",
"by",
"command",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/command/AbstractCommand.java#L76-L80 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/extra/scannotation/AnnotationDB.java | AnnotationDB.scanClass | public void scanClass(InputStream bits) throws IOException {
DataInputStream dstream = new DataInputStream(new BufferedInputStream(bits));
ClassFile cf = null;
try {
cf = new ClassFile(dstream);
classIndex.put(cf.getName(), new HashSet<String>());
if (scanClas... | java | public void scanClass(InputStream bits) throws IOException {
DataInputStream dstream = new DataInputStream(new BufferedInputStream(bits));
ClassFile cf = null;
try {
cf = new ClassFile(dstream);
classIndex.put(cf.getName(), new HashSet<String>());
if (scanClas... | [
"public",
"void",
"scanClass",
"(",
"InputStream",
"bits",
")",
"throws",
"IOException",
"{",
"DataInputStream",
"dstream",
"=",
"new",
"DataInputStream",
"(",
"new",
"BufferedInputStream",
"(",
"bits",
")",
")",
";",
"ClassFile",
"cf",
"=",
"null",
";",
"try"... | Parse a .class file for annotations
@param bits
input stream pointing to .class file bits
@throws IOException | [
"Parse",
"a",
".",
"class",
"file",
"for",
"annotations"
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/extra/scannotation/AnnotationDB.java#L203-L226 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/extra/scannotation/AnnotationDB.java | AnnotationDB.scanMethods | protected void scanMethods(ClassFile cf) {
List<ClassFile> methods = cf.getMethods();
if (methods == null)
return;
for (Object obj : methods) {
MethodInfo method = (MethodInfo) obj;
if (scanMethodAnnotations) {
AnnotationsAttribute visible = (A... | java | protected void scanMethods(ClassFile cf) {
List<ClassFile> methods = cf.getMethods();
if (methods == null)
return;
for (Object obj : methods) {
MethodInfo method = (MethodInfo) obj;
if (scanMethodAnnotations) {
AnnotationsAttribute visible = (A... | [
"protected",
"void",
"scanMethods",
"(",
"ClassFile",
"cf",
")",
"{",
"List",
"<",
"ClassFile",
">",
"methods",
"=",
"cf",
".",
"getMethods",
"(",
")",
";",
"if",
"(",
"methods",
"==",
"null",
")",
"return",
";",
"for",
"(",
"Object",
"obj",
":",
"me... | Scanns both the method and its parameters for annotations.
@param cf | [
"Scanns",
"both",
"the",
"method",
"and",
"its",
"parameters",
"for",
"annotations",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/extra/scannotation/AnnotationDB.java#L243-L276 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/extra/scannotation/AnnotationDB.java | AnnotationDB.outputAnnotationIndex | public void outputAnnotationIndex(PrintWriter writer) {
for (String ann : annotationIndex.keySet()) {
writer.print(ann);
writer.print(": ");
Set<String> classes = annotationIndex.get(ann);
Iterator<String> it = classes.iterator();
while (it.hasNext()) ... | java | public void outputAnnotationIndex(PrintWriter writer) {
for (String ann : annotationIndex.keySet()) {
writer.print(ann);
writer.print(": ");
Set<String> classes = annotationIndex.get(ann);
Iterator<String> it = classes.iterator();
while (it.hasNext()) ... | [
"public",
"void",
"outputAnnotationIndex",
"(",
"PrintWriter",
"writer",
")",
"{",
"for",
"(",
"String",
"ann",
":",
"annotationIndex",
".",
"keySet",
"(",
")",
")",
"{",
"writer",
".",
"print",
"(",
"ann",
")",
";",
"writer",
".",
"print",
"(",
"\": \""... | Prints out annotationIndex
@param writer | [
"Prints",
"out",
"annotationIndex"
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/extra/scannotation/AnnotationDB.java#L314-L327 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/web/ServletContexConfigSupport.java | ServletContexConfigSupport.canSearchConfigFile | boolean canSearchConfigFile(ServletContext servletContext) {
String searchConfigFile = servletContext.getInitParameter("searchConfigFile");
if (searchConfigFile == null || searchConfigFile.equals("")) {
return false;
} else if ("true".equals(searchConfigFile)) {
return tr... | java | boolean canSearchConfigFile(ServletContext servletContext) {
String searchConfigFile = servletContext.getInitParameter("searchConfigFile");
if (searchConfigFile == null || searchConfigFile.equals("")) {
return false;
} else if ("true".equals(searchConfigFile)) {
return tr... | [
"boolean",
"canSearchConfigFile",
"(",
"ServletContext",
"servletContext",
")",
"{",
"String",
"searchConfigFile",
"=",
"servletContext",
".",
"getInitParameter",
"(",
"\"searchConfigFile\"",
")",
";",
"if",
"(",
"searchConfigFile",
"==",
"null",
"||",
"searchConfigFile... | Can search config file.
@param servletContext the servlet context
@return true, if successful | [
"Can",
"search",
"config",
"file",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/web/ServletContexConfigSupport.java#L80-L88 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/web/ServletContexConfigSupport.java | ServletContexConfigSupport.hasHandlers | boolean hasHandlers(ServletContext servletContext) {
String handlers = servletContext.getInitParameter("handlers");
return !(handlers == null || handlers.equals(""));
} | java | boolean hasHandlers(ServletContext servletContext) {
String handlers = servletContext.getInitParameter("handlers");
return !(handlers == null || handlers.equals(""));
} | [
"boolean",
"hasHandlers",
"(",
"ServletContext",
"servletContext",
")",
"{",
"String",
"handlers",
"=",
"servletContext",
".",
"getInitParameter",
"(",
"\"handlers\"",
")",
";",
"return",
"!",
"(",
"handlers",
"==",
"null",
"||",
"handlers",
".",
"equals",
"(",
... | Checks for handlers.
@param servletContext the servlet context
@return true, if successful | [
"Checks",
"for",
"handlers",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/web/ServletContexConfigSupport.java#L96-L99 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/CronSequenceGenerator.java | CronSequenceGenerator.setNumberHits | private void setNumberHits(BitSet bits, String value, int min, int max) {
String[] fields = StringUtils.delimitedListToStringArray(value, ",");
for (String field : fields) {
if (!field.contains("/")) {
// Not an incrementer so it must be a range (possibly empty)
... | java | private void setNumberHits(BitSet bits, String value, int min, int max) {
String[] fields = StringUtils.delimitedListToStringArray(value, ",");
for (String field : fields) {
if (!field.contains("/")) {
// Not an incrementer so it must be a range (possibly empty)
... | [
"private",
"void",
"setNumberHits",
"(",
"BitSet",
"bits",
",",
"String",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"String",
"[",
"]",
"fields",
"=",
"StringUtils",
".",
"delimitedListToStringArray",
"(",
"value",
",",
"\",\"",
")",
";",
... | Sets the number hits.
@param bits the bits
@param value the value
@param min the min
@param max the max | [
"Sets",
"the",
"number",
"hits",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/CronSequenceGenerator.java#L322-L345 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/CronSequenceGenerator.java | CronSequenceGenerator.getRange | private int[] getRange(String field, int min, int max) {
int[] result = new int[2];
if (field.contains("*")) {
result[0] = min;
result[1] = max - 1;
return result;
}
if (!field.contains("-")) {
result[0] = result[1] = Integer.valueOf(field)... | java | private int[] getRange(String field, int min, int max) {
int[] result = new int[2];
if (field.contains("*")) {
result[0] = min;
result[1] = max - 1;
return result;
}
if (!field.contains("-")) {
result[0] = result[1] = Integer.valueOf(field)... | [
"private",
"int",
"[",
"]",
"getRange",
"(",
"String",
"field",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"int",
"[",
"]",
"result",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"if",
"(",
"field",
".",
"contains",
"(",
"\"*\"",
")",
")",
"{",
... | Gets the range.
@param field the field
@param min the min
@param max the max
@return the range | [
"Gets",
"the",
"range",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/CronSequenceGenerator.java#L355-L382 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/TaskExecutorAdapter.java | TaskExecutorAdapter.execute | @Override
public void execute(Runnable task) {
try {
this.concurrentExecutor.execute(task);
} catch (RejectedExecutionException ex) {
throw new TaskRejectedException("Executor [" + this.concurrentExecutor + "] did not accept task: " + task,
ex);
}
... | java | @Override
public void execute(Runnable task) {
try {
this.concurrentExecutor.execute(task);
} catch (RejectedExecutionException ex) {
throw new TaskRejectedException("Executor [" + this.concurrentExecutor + "] did not accept task: " + task,
ex);
}
... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"Runnable",
"task",
")",
"{",
"try",
"{",
"this",
".",
"concurrentExecutor",
".",
"execute",
"(",
"task",
")",
";",
"}",
"catch",
"(",
"RejectedExecutionException",
"ex",
")",
"{",
"throw",
"new",
"TaskRej... | Delegates to the specified JDK concurrent executor.
@param task the task
@see java.util.concurrent.Executor#execute(Runnable) | [
"Delegates",
"to",
"the",
"specified",
"JDK",
"concurrent",
"executor",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/TaskExecutorAdapter.java#L47-L55 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/archive/ArchiveManager.java | ArchiveManager.executeArchive | private void executeArchive() {
for (AbstractArchiveJob archiveJob : jobs) {
archiveJob.setArchiveDateDiff(extractArchiveDateCount(archiveEnv.getDatePattern()));
archiveJob.setPath(archiveEnv.getDirPath());
archiveJob.setCompressionExtention(archiveEnv.getCompression().getExt... | java | private void executeArchive() {
for (AbstractArchiveJob archiveJob : jobs) {
archiveJob.setArchiveDateDiff(extractArchiveDateCount(archiveEnv.getDatePattern()));
archiveJob.setPath(archiveEnv.getDirPath());
archiveJob.setCompressionExtention(archiveEnv.getCompression().getExt... | [
"private",
"void",
"executeArchive",
"(",
")",
"{",
"for",
"(",
"AbstractArchiveJob",
"archiveJob",
":",
"jobs",
")",
"{",
"archiveJob",
".",
"setArchiveDateDiff",
"(",
"extractArchiveDateCount",
"(",
"archiveEnv",
".",
"getDatePattern",
"(",
")",
")",
")",
";",... | Execute archive. | [
"Execute",
"archive",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/archive/ArchiveManager.java#L75-L82 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/archive/ArchiveManager.java | ArchiveManager.extractArchiveDateCount | public Integer extractArchiveDateCount(String datePattern) {
int dateCount = 0;
String[] splits = datePattern.split("d|M|y");
if (splits.length > 0) {
dateCount = dateCount + Integer.valueOf(splits[0]);
}
if (splits.length > 1) {
dateCount = dateCount + (I... | java | public Integer extractArchiveDateCount(String datePattern) {
int dateCount = 0;
String[] splits = datePattern.split("d|M|y");
if (splits.length > 0) {
dateCount = dateCount + Integer.valueOf(splits[0]);
}
if (splits.length > 1) {
dateCount = dateCount + (I... | [
"public",
"Integer",
"extractArchiveDateCount",
"(",
"String",
"datePattern",
")",
"{",
"int",
"dateCount",
"=",
"0",
";",
"String",
"[",
"]",
"splits",
"=",
"datePattern",
".",
"split",
"(",
"\"d|M|y\"",
")",
";",
"if",
"(",
"splits",
".",
"length",
">",
... | Extract archive date count.
@param datePattern
the date pattern
@return the integer | [
"Extract",
"archive",
"date",
"count",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/archive/ArchiveManager.java#L91-L104 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/EnvUtil.java | EnvUtil.isJDK_N_OrHigher | private static boolean isJDK_N_OrHigher(int n) {
List<String> versionList = new ArrayList<String>();
// this code should work at least until JDK 10 (assuming n parameter is
// always 6 or more)
for (int i = 0; i < 5; i++) {
//Till JDK 1.8 versioning is 1.x after 10 its will J... | java | private static boolean isJDK_N_OrHigher(int n) {
List<String> versionList = new ArrayList<String>();
// this code should work at least until JDK 10 (assuming n parameter is
// always 6 or more)
for (int i = 0; i < 5; i++) {
//Till JDK 1.8 versioning is 1.x after 10 its will J... | [
"private",
"static",
"boolean",
"isJDK_N_OrHigher",
"(",
"int",
"n",
")",
"{",
"List",
"<",
"String",
">",
"versionList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"// this code should work at least until JDK 10 (assuming n parameter is",
"// always ... | Checks if is jD k_ n_ or higher.
@param n
the n
@return true, if is jD k_ n_ or higher | [
"Checks",
"if",
"is",
"jD",
"k_",
"n_",
"or",
"higher",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/EnvUtil.java#L51-L72 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/EnvUtil.java | EnvUtil.isJaninoAvailable | static public boolean isJaninoAvailable() {
ClassLoader classLoader = EnvUtil.class.getClassLoader();
try {
Class<?> bindingClass = classLoader.loadClass("org.codehaus.janino.ScriptEvaluator");
return bindingClass != null;
} catch (ClassNotFoundException e) {
... | java | static public boolean isJaninoAvailable() {
ClassLoader classLoader = EnvUtil.class.getClassLoader();
try {
Class<?> bindingClass = classLoader.loadClass("org.codehaus.janino.ScriptEvaluator");
return bindingClass != null;
} catch (ClassNotFoundException e) {
... | [
"static",
"public",
"boolean",
"isJaninoAvailable",
"(",
")",
"{",
"ClassLoader",
"classLoader",
"=",
"EnvUtil",
".",
"class",
".",
"getClassLoader",
"(",
")",
";",
"try",
"{",
"Class",
"<",
"?",
">",
"bindingClass",
"=",
"classLoader",
".",
"loadClass",
"("... | Checks if is janino available.
@return true, if is janino available | [
"Checks",
"if",
"is",
"janino",
"available",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/EnvUtil.java#L116-L124 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/EnvUtil.java | EnvUtil.hasConfigFileExists | public static boolean hasConfigFileExists(String dirPath) {
String filePath = dirPath + File.separator + Configurations.CONFIG_FILE_NAME + ".";
if (AuditUtil.isFileExists(filePath + Configurations.YML_EXTENTION)
|| AuditUtil.isFileExists(filePath + Configurations.YAML_EXTENTION)
... | java | public static boolean hasConfigFileExists(String dirPath) {
String filePath = dirPath + File.separator + Configurations.CONFIG_FILE_NAME + ".";
if (AuditUtil.isFileExists(filePath + Configurations.YML_EXTENTION)
|| AuditUtil.isFileExists(filePath + Configurations.YAML_EXTENTION)
... | [
"public",
"static",
"boolean",
"hasConfigFileExists",
"(",
"String",
"dirPath",
")",
"{",
"String",
"filePath",
"=",
"dirPath",
"+",
"File",
".",
"separator",
"+",
"Configurations",
".",
"CONFIG_FILE_NAME",
"+",
"\".\"",
";",
"if",
"(",
"AuditUtil",
".",
"isFi... | Checks whether config file exists in directory.
@param dirPath the dir path
@return true, if successful | [
"Checks",
"whether",
"config",
"file",
"exists",
"in",
"directory",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/EnvUtil.java#L156-L164 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java | ClasspathUrlFinder.findClassBase | public static URL findClassBase(Class clazz)
{
String resource = clazz.getName().replace('.', '/') + ".class";
return findResourceBase(resource, clazz.getClassLoader());
} | java | public static URL findClassBase(Class clazz)
{
String resource = clazz.getName().replace('.', '/') + ".class";
return findResourceBase(resource, clazz.getClassLoader());
} | [
"public",
"static",
"URL",
"findClassBase",
"(",
"Class",
"clazz",
")",
"{",
"String",
"resource",
"=",
"clazz",
".",
"getName",
"(",
")",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
"+",
"\".class\"",
";",
"return",
"findResourceBase",
"(",
"re... | Find the classpath for the particular class
@param clazz
@return | [
"Find",
"the",
"classpath",
"for",
"the",
"particular",
"class"
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java#L115-L119 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/EncryptionUtil.java | EncryptionUtil.getCipher | private Cipher getCipher(int mode) throws InvalidKeyException, InvalidAlgorithmParameterException,
UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException {
Cipher c = Cipher.getInstance(ALGORYITHM);
byte[] iv = CoreConstants.IV.getBytes(CoreConstants.ENCODE_UTF8);
... | java | private Cipher getCipher(int mode) throws InvalidKeyException, InvalidAlgorithmParameterException,
UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException {
Cipher c = Cipher.getInstance(ALGORYITHM);
byte[] iv = CoreConstants.IV.getBytes(CoreConstants.ENCODE_UTF8);
... | [
"private",
"Cipher",
"getCipher",
"(",
"int",
"mode",
")",
"throws",
"InvalidKeyException",
",",
"InvalidAlgorithmParameterException",
",",
"UnsupportedEncodingException",
",",
"NoSuchAlgorithmException",
",",
"NoSuchPaddingException",
"{",
"Cipher",
"c",
"=",
"Cipher",
"... | Gets the cipher.
@param mode the mode
@return the cipher
@throws InvalidKeyException the invalid key exception
@throws InvalidAlgorithmParameterException the invalid algorithm parameter exception
@throws UnsupportedEncodingException the unsupported encoding exception
@throws NoSuchAlgorithmException the no such algori... | [
"Gets",
"the",
"cipher",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/EncryptionUtil.java#L123-L131 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/EncryptionUtil.java | EncryptionUtil.getInstance | public static EncryptionUtil getInstance(String key, String salt) throws NoSuchAlgorithmException,
UnsupportedEncodingException, InvalidKeySpecException {
if (instance == null) {
synchronized (EncryptionUtil.class) {
if (instance == null) {
instance = ... | java | public static EncryptionUtil getInstance(String key, String salt) throws NoSuchAlgorithmException,
UnsupportedEncodingException, InvalidKeySpecException {
if (instance == null) {
synchronized (EncryptionUtil.class) {
if (instance == null) {
instance = ... | [
"public",
"static",
"EncryptionUtil",
"getInstance",
"(",
"String",
"key",
",",
"String",
"salt",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnsupportedEncodingException",
",",
"InvalidKeySpecException",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"syn... | Gets the Encryptor.
@param key the key
@param salt the salt
@return the Encryptor
@throws NoSuchAlgorithmException the no such algorithm exception
@throws UnsupportedEncodingException the unsupported encoding exception
@throws InvalidKeySpecException the invalid key spec exception | [
"Gets",
"the",
"Encryptor",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/EncryptionUtil.java#L173-L184 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/ErrorGuide.java | ErrorGuide.getGuide | public static String getGuide(String code){
StringBuilder builder = new StringBuilder();
builder.append(" see ").append(code).append(" for further details.");
return builder.toString();
} | java | public static String getGuide(String code){
StringBuilder builder = new StringBuilder();
builder.append(" see ").append(code).append(" for further details.");
return builder.toString();
} | [
"public",
"static",
"String",
"getGuide",
"(",
"String",
"code",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\" see \"",
")",
".",
"append",
"(",
"code",
")",
".",
"append",
"(",
"\" f... | Gets the guide.
@param code the code
@return the guide | [
"Gets",
"the",
"guide",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/ErrorGuide.java#L76-L80 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/AuditFieldAnnotationAttribute.java | AuditFieldAnnotationAttribute.getAllFields | public List<Field> getAllFields(final Method method, final Object[] arg1) {
final Annotation[][] parameterAnnotations = method.getParameterAnnotations();
List<Field> actionItems = new ArrayList<Field>();
int i = 0;
String paramName = null;
String paramValue = null;
Class<?> paramType;
for (final Annotat... | java | public List<Field> getAllFields(final Method method, final Object[] arg1) {
final Annotation[][] parameterAnnotations = method.getParameterAnnotations();
List<Field> actionItems = new ArrayList<Field>();
int i = 0;
String paramName = null;
String paramValue = null;
Class<?> paramType;
for (final Annotat... | [
"public",
"List",
"<",
"Field",
">",
"getAllFields",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"[",
"]",
"arg1",
")",
"{",
"final",
"Annotation",
"[",
"]",
"[",
"]",
"parameterAnnotations",
"=",
"method",
".",
"getParameterAnnotations",
"(",
... | Gets the all params.
@param method
the method
@param arg1
the arg1
@return the all params | [
"Gets",
"the",
"all",
"params",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/AuditFieldAnnotationAttribute.java#L47-L84 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/util/StringUtils.java | StringUtils.quoteIfString | public static Object quoteIfString(Object obj) {
return obj instanceof String ? quote((String) obj) : obj;
} | java | public static Object quoteIfString(Object obj) {
return obj instanceof String ? quote((String) obj) : obj;
} | [
"public",
"static",
"Object",
"quoteIfString",
"(",
"Object",
"obj",
")",
"{",
"return",
"obj",
"instanceof",
"String",
"?",
"quote",
"(",
"(",
"String",
")",
"obj",
")",
":",
"obj",
";",
"}"
] | Turn the given Object into a String with single quotes if it is a String;
keeping the Object as-is else.
@param obj
the input Object (e.g. "myString")
@return the quoted String (e.g. "'myString'"), or the input object as-is
if not a String | [
"Turn",
"the",
"given",
"Object",
"into",
"a",
"String",
"with",
"single",
"quotes",
"if",
"it",
"is",
"a",
"String",
";",
"keeping",
"the",
"Object",
"as",
"-",
"is",
"else",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/util/StringUtils.java#L485-L487 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/DefaultAnnotationTransformer.java | DefaultAnnotationTransformer.transformToEvent | @Override
public AuditEvent transformToEvent(AnnotationAuditEvent annotationEvent) {
AuditEvent event = null;
if (annotationEvent.getClazz().isAnnotationPresent(Audit.class)
&& !annotationEvent.getMethod().isAnnotationPresent(IgnoreAudit.class)) {
event = new AuditEvent();
Audit audit = annotationEvent.... | java | @Override
public AuditEvent transformToEvent(AnnotationAuditEvent annotationEvent) {
AuditEvent event = null;
if (annotationEvent.getClazz().isAnnotationPresent(Audit.class)
&& !annotationEvent.getMethod().isAnnotationPresent(IgnoreAudit.class)) {
event = new AuditEvent();
Audit audit = annotationEvent.... | [
"@",
"Override",
"public",
"AuditEvent",
"transformToEvent",
"(",
"AnnotationAuditEvent",
"annotationEvent",
")",
"{",
"AuditEvent",
"event",
"=",
"null",
";",
"if",
"(",
"annotationEvent",
".",
"getClazz",
"(",
")",
".",
"isAnnotationPresent",
"(",
"Audit",
".",
... | Transform annotation informations to Audit Event object.
@param annotationEvent
the annotation event
@return the audit event
@since 2.0.0 | [
"Transform",
"annotation",
"informations",
"to",
"Audit",
"Event",
"object",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/DefaultAnnotationTransformer.java#L65-L114 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/DefaultAnnotationTransformer.java | DefaultAnnotationTransformer.getFields | private List<Field> getFields(final Method method, final Object[] params) {
final Annotation[][] parameterAnnotations = method.getParameterAnnotations();
final List<Field> fields = new ArrayList<Field>();
int i = 0;
String paramName = null;
for (final Annotation[] annotations : parameterAnnotations) {
fi... | java | private List<Field> getFields(final Method method, final Object[] params) {
final Annotation[][] parameterAnnotations = method.getParameterAnnotations();
final List<Field> fields = new ArrayList<Field>();
int i = 0;
String paramName = null;
for (final Annotation[] annotations : parameterAnnotations) {
fi... | [
"private",
"List",
"<",
"Field",
">",
"getFields",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"[",
"]",
"params",
")",
"{",
"final",
"Annotation",
"[",
"]",
"[",
"]",
"parameterAnnotations",
"=",
"method",
".",
"getParameterAnnotations",
"(",
... | Extract fields based on annotations.
@param method
: Class method with annotations.
@param params
: Method parameter values.
@return list of fields extracted from method.
@since 2.4.1 | [
"Extract",
"fields",
"based",
"on",
"annotations",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/DefaultAnnotationTransformer.java#L128-L165 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/ThreadPoolTaskScheduler.java | ThreadPoolTaskScheduler.errorHandlingTask | private Runnable errorHandlingTask(Runnable task, boolean isRepeatingTask) {
return TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, isRepeatingTask);
} | java | private Runnable errorHandlingTask(Runnable task, boolean isRepeatingTask) {
return TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, isRepeatingTask);
} | [
"private",
"Runnable",
"errorHandlingTask",
"(",
"Runnable",
"task",
",",
"boolean",
"isRepeatingTask",
")",
"{",
"return",
"TaskUtils",
".",
"decorateTaskWithErrorHandler",
"(",
"task",
",",
"this",
".",
"errorHandler",
",",
"isRepeatingTask",
")",
";",
"}"
] | Error handling task.
@param task the task
@param isRepeatingTask the is repeating task
@return the runnable | [
"Error",
"handling",
"task",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/ThreadPoolTaskScheduler.java#L407-L409 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/AuditUtil.java | AuditUtil.transformMap | public static Map<String, String> transformMap(final Map<String, Object> paramMap) {
final Map<String, String> paramStrMap = new LinkedHashMap<String, String>();
for (final Map.Entry<String, Object> entry : paramMap.entrySet()) {
paramStrMap.put(entry.getKey(), entry.getValue().toString());
... | java | public static Map<String, String> transformMap(final Map<String, Object> paramMap) {
final Map<String, String> paramStrMap = new LinkedHashMap<String, String>();
for (final Map.Entry<String, Object> entry : paramMap.entrySet()) {
paramStrMap.put(entry.getKey(), entry.getValue().toString());
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"transformMap",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"paramStrMap",
"=",
"new",
"LinkedHashMap",
"<"... | Transform map.
@param paramMap
the param map
@return the map | [
"Transform",
"map",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/AuditUtil.java#L54-L61 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/AuditUtil.java | AuditUtil.dateToString | public static String dateToString(final Date date, final String format) {
if (date == null) {
return null;
}
final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);
return dateFormat.format(date);
} | java | public static String dateToString(final Date date, final String format) {
if (date == null) {
return null;
}
final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);
return dateFormat.format(date);
} | [
"public",
"static",
"String",
"dateToString",
"(",
"final",
"Date",
"date",
",",
"final",
"String",
"format",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"DateFormat",
"dateFormat",
"=",
"new",
"SimpleDateForma... | Date to string.
@param date
the date
@param format
the format
@return the string | [
"Date",
"to",
"string",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/AuditUtil.java#L81-L87 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/AuditUtil.java | AuditUtil.stringTodate | public static Date stringTodate(String dateString, String format) throws ParseException {
final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);
return dateFormat.parse(dateString);
} | java | public static Date stringTodate(String dateString, String format) throws ParseException {
final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);
return dateFormat.parse(dateString);
} | [
"public",
"static",
"Date",
"stringTodate",
"(",
"String",
"dateString",
",",
"String",
"format",
")",
"throws",
"ParseException",
"{",
"final",
"DateFormat",
"dateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"format",
",",
"Locale",
".",
"US",
")",
";",
"ret... | Convert string to date.
@param dateString the date string
@param format the format
@return the date
@throws ParseException the parse exception | [
"Convert",
"string",
"to",
"date",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/AuditUtil.java#L97-L100 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/AuditUtil.java | AuditUtil.timeStampToString | public static String timeStampToString(final Timestamp timestamp, final String format) {
return dateToString(new Date(timestamp.getTime()), format);
} | java | public static String timeStampToString(final Timestamp timestamp, final String format) {
return dateToString(new Date(timestamp.getTime()), format);
} | [
"public",
"static",
"String",
"timeStampToString",
"(",
"final",
"Timestamp",
"timestamp",
",",
"final",
"String",
"format",
")",
"{",
"return",
"dateToString",
"(",
"new",
"Date",
"(",
"timestamp",
".",
"getTime",
"(",
")",
")",
",",
"format",
")",
";",
"... | Time stamp to string.
@param timestamp
the timestamp
@param format
the format
@return the string | [
"Time",
"stamp",
"to",
"string",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/AuditUtil.java#L111-L113 | train |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/AuditUtil.java | AuditUtil.isFileExists | public static boolean isFileExists(String filePathString) {
File file = new File(filePathString);
if (file.exists() && !file.isDirectory())
return true;
return false;
} | java | public static boolean isFileExists(String filePathString) {
File file = new File(filePathString);
if (file.exists() && !file.isDirectory())
return true;
return false;
} | [
"public",
"static",
"boolean",
"isFileExists",
"(",
"String",
"filePathString",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"filePathString",
")",
";",
"if",
"(",
"file",
".",
"exists",
"(",
")",
"&&",
"!",
"file",
".",
"isDirectory",
"(",
")",
... | Checks if is file exists.
@param filePathString the file path string
@return true, if is file exists | [
"Checks",
"if",
"is",
"file",
"exists",
"."
] | dc8569108851e64cb0ecc7a39048db0ad070fba2 | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/AuditUtil.java#L121-L126 | train |
prestodb/presto-hive-apache | src/main/java/org/apache/hive/common/util/TimestampParser.java | TimestampParser.parseTimestamp | public Timestamp parseTimestamp(String strValue) throws IllegalArgumentException {
if (fmt != null) {
Optional<Timestamp> parsed = tryParseWithFormat(strValue);
if (parsed.isPresent()) {
return parsed.get();
}
}
// Otherwise try default timest... | java | public Timestamp parseTimestamp(String strValue) throws IllegalArgumentException {
if (fmt != null) {
Optional<Timestamp> parsed = tryParseWithFormat(strValue);
if (parsed.isPresent()) {
return parsed.get();
}
}
// Otherwise try default timest... | [
"public",
"Timestamp",
"parseTimestamp",
"(",
"String",
"strValue",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"fmt",
"!=",
"null",
")",
"{",
"Optional",
"<",
"Timestamp",
">",
"parsed",
"=",
"tryParseWithFormat",
"(",
"strValue",
")",
";",
"if... | Parse the input string and return a timestamp value
@param strValue
@return
@throws IllegalArgumentException if input string cannot be parsed into timestamp | [
"Parse",
"the",
"input",
"string",
"and",
"return",
"a",
"timestamp",
"value"
] | 000f51d04c520f2096faffbc6733e51e19a4ddcc | https://github.com/prestodb/presto-hive-apache/blob/000f51d04c520f2096faffbc6733e51e19a4ddcc/src/main/java/org/apache/hive/common/util/TimestampParser.java#L112-L122 | train |
prestodb/presto-hive-apache | src/main/java/org/apache/hive/hcatalog/data/JsonSerDe.java | JsonSerDe.deserialize | @Override
public Object deserialize(Writable blob) throws SerDeException {
Text t = (Text) blob;
JsonParser p;
List<Object> r = new ArrayList<Object>(Collections.nCopies(columnNames.size(), null));
try {
p = jsonFactory.createJsonParser(new ByteArrayInputStream((t.getBytes())));
if (p.nex... | java | @Override
public Object deserialize(Writable blob) throws SerDeException {
Text t = (Text) blob;
JsonParser p;
List<Object> r = new ArrayList<Object>(Collections.nCopies(columnNames.size(), null));
try {
p = jsonFactory.createJsonParser(new ByteArrayInputStream((t.getBytes())));
if (p.nex... | [
"@",
"Override",
"public",
"Object",
"deserialize",
"(",
"Writable",
"blob",
")",
"throws",
"SerDeException",
"{",
"Text",
"t",
"=",
"(",
"Text",
")",
"blob",
";",
"JsonParser",
"p",
";",
"List",
"<",
"Object",
">",
"r",
"=",
"new",
"ArrayList",
"<",
"... | Takes JSON string in Text form, and has to return an object representation above
it that's readable by the corresponding object inspector.
For this implementation, since we're using the jackson parser, we can construct
our own object implementation, and we use HCatRecord for it | [
"Takes",
"JSON",
"string",
"in",
"Text",
"form",
"and",
"has",
"to",
"return",
"an",
"object",
"representation",
"above",
"it",
"that",
"s",
"readable",
"by",
"the",
"corresponding",
"object",
"inspector",
"."
] | 000f51d04c520f2096faffbc6733e51e19a4ddcc | https://github.com/prestodb/presto-hive-apache/blob/000f51d04c520f2096faffbc6733e51e19a4ddcc/src/main/java/org/apache/hive/hcatalog/data/JsonSerDe.java#L163-L190 | train |
prestodb/presto-hive-apache | src/main/java/org/apache/hive/hcatalog/data/JsonSerDe.java | JsonSerDe.serialize | @Override
public Writable serialize(Object obj, ObjectInspector objInspector)
throws SerDeException {
StringBuilder sb = new StringBuilder();
try {
StructObjectInspector soi = (StructObjectInspector) objInspector;
List<? extends StructField> structFields = soi.getAllStructFieldRefs();
a... | java | @Override
public Writable serialize(Object obj, ObjectInspector objInspector)
throws SerDeException {
StringBuilder sb = new StringBuilder();
try {
StructObjectInspector soi = (StructObjectInspector) objInspector;
List<? extends StructField> structFields = soi.getAllStructFieldRefs();
a... | [
"@",
"Override",
"public",
"Writable",
"serialize",
"(",
"Object",
"obj",
",",
"ObjectInspector",
"objInspector",
")",
"throws",
"SerDeException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"StructObjectInspector",
"soi",
... | Given an object and object inspector pair, traverse the object
and generate a Text representation of the object. | [
"Given",
"an",
"object",
"and",
"object",
"inspector",
"pair",
"traverse",
"the",
"object",
"and",
"generate",
"a",
"Text",
"representation",
"of",
"the",
"object",
"."
] | 000f51d04c520f2096faffbc6733e51e19a4ddcc | https://github.com/prestodb/presto-hive-apache/blob/000f51d04c520f2096faffbc6733e51e19a4ddcc/src/main/java/org/apache/hive/hcatalog/data/JsonSerDe.java#L423-L453 | train |
forge/core | scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/MetawidgetInspectorFacade.java | MetawidgetInspectorFacade.setupCompositeInspector | private void setupCompositeInspector()
{
ForgePropertyStyleConfig forgePropertyStyleConfig = new ForgePropertyStyleConfig();
forgePropertyStyleConfig.setProject(this.project);
ForgeInspectorConfig forgeInspectorConfig = new ForgeInspectorConfig();
forgeInspectorConfig.setProject(this.project)... | java | private void setupCompositeInspector()
{
ForgePropertyStyleConfig forgePropertyStyleConfig = new ForgePropertyStyleConfig();
forgePropertyStyleConfig.setProject(this.project);
ForgeInspectorConfig forgeInspectorConfig = new ForgeInspectorConfig();
forgeInspectorConfig.setProject(this.project)... | [
"private",
"void",
"setupCompositeInspector",
"(",
")",
"{",
"ForgePropertyStyleConfig",
"forgePropertyStyleConfig",
"=",
"new",
"ForgePropertyStyleConfig",
"(",
")",
";",
"forgePropertyStyleConfig",
".",
"setProject",
"(",
"this",
".",
"project",
")",
";",
"ForgeInspec... | Setup the composite inspector. This is not done at construction time, since Metawidget inspectors cache trait
lookups, and hence report incorrect values when underlying Java classes change in projects. Therefore, the
composite inspector setup and configuration is perform explicitly upon every inspection. | [
"Setup",
"the",
"composite",
"inspector",
".",
"This",
"is",
"not",
"done",
"at",
"construction",
"time",
"since",
"Metawidget",
"inspectors",
"cache",
"trait",
"lookups",
"and",
"hence",
"report",
"incorrect",
"values",
"when",
"underlying",
"Java",
"classes",
... | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/MetawidgetInspectorFacade.java#L76-L101 | train |
forge/core | scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java | ForgePropertyStyle.traverse | @Override
public ValueAndDeclaredType traverse(final Object toTraverse, final String type, final boolean onlyToParent,
final String... names)
{
// Traverse through names (if any)
if ((names == null) || (names.length == 0))
{
// If no names, no parent
if (onlyToPar... | java | @Override
public ValueAndDeclaredType traverse(final Object toTraverse, final String type, final boolean onlyToParent,
final String... names)
{
// Traverse through names (if any)
if ((names == null) || (names.length == 0))
{
// If no names, no parent
if (onlyToPar... | [
"@",
"Override",
"public",
"ValueAndDeclaredType",
"traverse",
"(",
"final",
"Object",
"toTraverse",
",",
"final",
"String",
"type",
",",
"final",
"boolean",
"onlyToParent",
",",
"final",
"String",
"...",
"names",
")",
"{",
"// Traverse through names (if any)",
"if"... | Traverses the given Class heirarchy using properties of the given names.
@return the declared type (not actual type). May be null | [
"Traverses",
"the",
"given",
"Class",
"heirarchy",
"using",
"properties",
"of",
"the",
"given",
"names",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java#L80-L119 | train |
forge/core | scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java | ForgePropertyStyle.inspectClassProperties | private void inspectClassProperties(final String type,
Map<String, Property> properties)
{
JavaSource<?> clazz = sourceForName(this.project, type);
if (clazz instanceof MethodHolder<?>)
{
lookupGetters(properties, (MethodHolder<?>) clazz);
lookupSetters(properties, (... | java | private void inspectClassProperties(final String type,
Map<String, Property> properties)
{
JavaSource<?> clazz = sourceForName(this.project, type);
if (clazz instanceof MethodHolder<?>)
{
lookupGetters(properties, (MethodHolder<?>) clazz);
lookupSetters(properties, (... | [
"private",
"void",
"inspectClassProperties",
"(",
"final",
"String",
"type",
",",
"Map",
"<",
"String",
",",
"Property",
">",
"properties",
")",
"{",
"JavaSource",
"<",
"?",
">",
"clazz",
"=",
"sourceForName",
"(",
"this",
".",
"project",
",",
"type",
")",... | Recursive lookup for properties from superclass in order to support inheritance | [
"Recursive",
"lookup",
"for",
"properties",
"from",
"superclass",
"in",
"order",
"to",
"support",
"inheritance"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java#L149-L170 | train |
forge/core | scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java | ForgePropertyStyle.isGetter | protected String isGetter(final Method<?, ?> method)
{
String methodName = method.getName();
String propertyName;
if (methodName.startsWith(ClassUtils.JAVABEAN_GET_PREFIX))
{
propertyName = methodName.substring(ClassUtils.JAVABEAN_GET_PREFIX.length());
}
else if (metho... | java | protected String isGetter(final Method<?, ?> method)
{
String methodName = method.getName();
String propertyName;
if (methodName.startsWith(ClassUtils.JAVABEAN_GET_PREFIX))
{
propertyName = methodName.substring(ClassUtils.JAVABEAN_GET_PREFIX.length());
}
else if (metho... | [
"protected",
"String",
"isGetter",
"(",
"final",
"Method",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"String",
"methodName",
"=",
"method",
".",
"getName",
"(",
")",
";",
"String",
"propertyName",
";",
"if",
"(",
"methodName",
".",
"startsWith",
"(",
... | Returns whether the given method is a 'getter' method.
@param method a parameterless method that returns a non-void
@return the property name | [
"Returns",
"whether",
"the",
"given",
"method",
"is",
"a",
"getter",
"method",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java#L240-L266 | train |
forge/core | scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java | ForgePropertyStyle.isSetter | protected String isSetter(final Method<?, ?> method)
{
String methodName = method.getName();
if (!methodName.startsWith(ClassUtils.JAVABEAN_SET_PREFIX))
{
return null;
}
String propertyName = methodName.substring(ClassUtils.JAVABEAN_SET_PREFIX.length());
return StringU... | java | protected String isSetter(final Method<?, ?> method)
{
String methodName = method.getName();
if (!methodName.startsWith(ClassUtils.JAVABEAN_SET_PREFIX))
{
return null;
}
String propertyName = methodName.substring(ClassUtils.JAVABEAN_SET_PREFIX.length());
return StringU... | [
"protected",
"String",
"isSetter",
"(",
"final",
"Method",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"String",
"methodName",
"=",
"method",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"methodName",
".",
"startsWith",
"(",
"ClassUtils",
".",
"JAVA... | Returns whether the given method is a 'setter' method.
@param method a single-parametered method. May return non-void (ie. for Fluent interfaces)
@return the property name | [
"Returns",
"whether",
"the",
"given",
"method",
"is",
"a",
"setter",
"method",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java#L361-L373 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java | JPAFieldOperationsImpl.newOneToOneRelationship | @Override
public void newOneToOneRelationship(Project project, final JavaResource resource, final String fieldName,
final String fieldType,
final String inverseFieldName,
final FetchType fetchType, final boolean required,
final Iterable<CascadeType> cascadeTypes) throw... | java | @Override
public void newOneToOneRelationship(Project project, final JavaResource resource, final String fieldName,
final String fieldType,
final String inverseFieldName,
final FetchType fetchType, final boolean required,
final Iterable<CascadeType> cascadeTypes) throw... | [
"@",
"Override",
"public",
"void",
"newOneToOneRelationship",
"(",
"Project",
"project",
",",
"final",
"JavaResource",
"resource",
",",
"final",
"String",
"fieldName",
",",
"final",
"String",
"fieldType",
",",
"final",
"String",
"inverseFieldName",
",",
"final",
"... | Creates a One-to-One relationship
@param project
@param resource
@param fieldName
@param fieldType
@param inverseFieldName
@param fetchType
@param required
@param cascadeTypes
@throws FileNotFoundException | [
"Creates",
"a",
"One",
"-",
"to",
"-",
"One",
"relationship"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java#L61-L104 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java | JPAFieldOperationsImpl.newManyToOneRelationship | @Override
public void newManyToOneRelationship(
final Project project,
final JavaResource resource,
final String fieldName,
final String fieldType,
final String inverseFieldName,
final FetchType fetchType,
final boolean required,
... | java | @Override
public void newManyToOneRelationship(
final Project project,
final JavaResource resource,
final String fieldName,
final String fieldType,
final String inverseFieldName,
final FetchType fetchType,
final boolean required,
... | [
"@",
"Override",
"public",
"void",
"newManyToOneRelationship",
"(",
"final",
"Project",
"project",
",",
"final",
"JavaResource",
"resource",
",",
"final",
"String",
"fieldName",
",",
"final",
"String",
"fieldType",
",",
"final",
"String",
"inverseFieldName",
",",
... | Creates a Many-To-One relationship
@param project
@param resource
@param fieldName
@param fieldType
@param inverseFieldName
@param fetchType
@param required
@param cascadeTypes
@throws FileNotFoundException | [
"Creates",
"a",
"Many",
"-",
"To",
"-",
"One",
"relationship"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java#L141-L211 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java | JPAFieldOperationsImpl.newEmbeddedRelationship | @Override
public void newEmbeddedRelationship(
final Project project,
final JavaResource resource,
final String fieldName,
final String fieldType) throws FileNotFoundException
{
JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
JavaClassSou... | java | @Override
public void newEmbeddedRelationship(
final Project project,
final JavaResource resource,
final String fieldName,
final String fieldType) throws FileNotFoundException
{
JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
JavaClassSou... | [
"@",
"Override",
"public",
"void",
"newEmbeddedRelationship",
"(",
"final",
"Project",
"project",
",",
"final",
"JavaResource",
"resource",
",",
"final",
"String",
"fieldName",
",",
"final",
"String",
"fieldType",
")",
"throws",
"FileNotFoundException",
"{",
"JavaSo... | Creates an Embedded relationship
@param project
@param resource
@param fieldName
@param fieldType
@throws FileNotFoundException | [
"Creates",
"an",
"Embedded",
"relationship"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java#L222-L245 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java | JPAFieldOperationsImpl.areTypesSame | private boolean areTypesSame(String from, String to)
{
String fromCompare = from.endsWith(".java") ? from.substring(0, from.length() - 5) : from;
String toCompare = to.endsWith(".java") ? to.substring(0, to.length() - 5) : to;
return fromCompare.equals(toCompare);
} | java | private boolean areTypesSame(String from, String to)
{
String fromCompare = from.endsWith(".java") ? from.substring(0, from.length() - 5) : from;
String toCompare = to.endsWith(".java") ? to.substring(0, to.length() - 5) : to;
return fromCompare.equals(toCompare);
} | [
"private",
"boolean",
"areTypesSame",
"(",
"String",
"from",
",",
"String",
"to",
")",
"{",
"String",
"fromCompare",
"=",
"from",
".",
"endsWith",
"(",
"\".java\"",
")",
"?",
"from",
".",
"substring",
"(",
"0",
",",
"from",
".",
"length",
"(",
")",
"-"... | Checks if the types are the same, removing the ".java" in the end of the string in case it exists
@param from
@param to
@return | [
"Checks",
"if",
"the",
"types",
"are",
"the",
"same",
"removing",
"the",
".",
"java",
"in",
"the",
"end",
"of",
"the",
"string",
"in",
"case",
"it",
"exists"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java#L430-L435 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.allResources | public Collection<JavaClassSource> allResources()
{
Set<JavaClassSource> result = new HashSet<>();
for (DTOPair pair : dtos.values())
{
if (pair.rootDTO != null)
{
result.add(pair.rootDTO);
}
if (pair.nestedDTO != null)
{
result.a... | java | public Collection<JavaClassSource> allResources()
{
Set<JavaClassSource> result = new HashSet<>();
for (DTOPair pair : dtos.values())
{
if (pair.rootDTO != null)
{
result.add(pair.rootDTO);
}
if (pair.nestedDTO != null)
{
result.a... | [
"public",
"Collection",
"<",
"JavaClassSource",
">",
"allResources",
"(",
")",
"{",
"Set",
"<",
"JavaClassSource",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"DTOPair",
"pair",
":",
"dtos",
".",
"values",
"(",
")",
")",
"{",... | Retrieves all the DTOs present in this instance.
@return A {@link Collection} of all the DTOs present in this {@link DTOCollection} instance. | [
"Retrieves",
"all",
"the",
"DTOs",
"present",
"in",
"this",
"instance",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L33-L48 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.addRootDTO | public void addRootDTO(JavaClass<?> entity, JavaClassSource rootDTO)
{
DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
dtoPair.rootDTO = rootDTO;
dtos.put(entity, dtoPair);
} | java | public void addRootDTO(JavaClass<?> entity, JavaClassSource rootDTO)
{
DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
dtoPair.rootDTO = rootDTO;
dtos.put(entity, dtoPair);
} | [
"public",
"void",
"addRootDTO",
"(",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"JavaClassSource",
"rootDTO",
")",
"{",
"DTOPair",
"dtoPair",
"=",
"dtos",
".",
"containsKey",
"(",
"entity",
")",
"?",
"dtos",
".",
"get",
"(",
"entity",
")",
":",
"new",
... | Registers the root DTO created for a JPA entity
@param entity The JPA entity
@param rootDTO The root DTO created for the JPA entity | [
"Registers",
"the",
"root",
"DTO",
"created",
"for",
"a",
"JPA",
"entity"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L56-L61 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.addNestedDTO | public void addNestedDTO(JavaClass<?> entity, JavaClassSource nestedDTO)
{
DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
dtoPair.nestedDTO = nestedDTO;
dtos.put(entity, dtoPair);
} | java | public void addNestedDTO(JavaClass<?> entity, JavaClassSource nestedDTO)
{
DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
dtoPair.nestedDTO = nestedDTO;
dtos.put(entity, dtoPair);
} | [
"public",
"void",
"addNestedDTO",
"(",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"JavaClassSource",
"nestedDTO",
")",
"{",
"DTOPair",
"dtoPair",
"=",
"dtos",
".",
"containsKey",
"(",
"entity",
")",
"?",
"dtos",
".",
"get",
"(",
"entity",
")",
":",
"new"... | Registers the nested DTO created for a JPA entity
@param entity The JPA entity
@param nestedDTO The nested DTO created for the JPA entity | [
"Registers",
"the",
"nested",
"DTO",
"created",
"for",
"a",
"JPA",
"entity"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L69-L74 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.containsDTOFor | public boolean containsDTOFor(JavaClass<?> entity, boolean root)
{
if (dtos.get(entity) == null)
{
return false;
}
return (root ? (dtos.get(entity).rootDTO != null) : (dtos.get(entity).nestedDTO != null));
} | java | public boolean containsDTOFor(JavaClass<?> entity, boolean root)
{
if (dtos.get(entity) == null)
{
return false;
}
return (root ? (dtos.get(entity).rootDTO != null) : (dtos.get(entity).nestedDTO != null));
} | [
"public",
"boolean",
"containsDTOFor",
"(",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"boolean",
"root",
")",
"{",
"if",
"(",
"dtos",
".",
"get",
"(",
"entity",
")",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"root",
"?",
... | Indicates whether a DTO is found in the underlying collection or not.
@param entity The JPA entity for which DTOs may have been created
@param root Toplevel/Root or nested DTO?
@return <code>true</code> if a DTO at the desired level (root/nested) for the provided entity was found in the
collection | [
"Indicates",
"whether",
"a",
"DTO",
"is",
"found",
"in",
"the",
"underlying",
"collection",
"or",
"not",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L84-L91 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.getDTOFor | public JavaClassSource getDTOFor(JavaClass<?> entity, boolean root)
{
if (dtos.get(entity) == null)
{
return null;
}
return root ? (dtos.get(entity).rootDTO) : (dtos.get(entity).nestedDTO);
} | java | public JavaClassSource getDTOFor(JavaClass<?> entity, boolean root)
{
if (dtos.get(entity) == null)
{
return null;
}
return root ? (dtos.get(entity).rootDTO) : (dtos.get(entity).nestedDTO);
} | [
"public",
"JavaClassSource",
"getDTOFor",
"(",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"boolean",
"root",
")",
"{",
"if",
"(",
"dtos",
".",
"get",
"(",
"entity",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"root",
"?",
"(",
... | Retrieves the DTO created for the JPA entity, depending on whether a top level or nested DTO was requested as the
return value.
@param entity The JPA entity for which the DTOs may have been created
@param root True, if the root/toplevel DTO should be returned. False if nested DTOs are to be returned.
@return The root ... | [
"Retrieves",
"the",
"DTO",
"created",
"for",
"the",
"JPA",
"entity",
"depending",
"on",
"whether",
"a",
"top",
"level",
"or",
"nested",
"DTO",
"was",
"requested",
"as",
"the",
"return",
"value",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L101-L108 | train |
forge/core | shell/impl/src/main/java/org/jboss/forge/addon/shell/aesh/ShellSingleCommand.java | ShellSingleCommand.promptRequiredMissingValues | @Override
public boolean promptRequiredMissingValues(ShellImpl shell) throws InterruptedException
{
Map<String, InputComponent<?, ?>> inputs = getController().getInputs();
if (hasMissingRequiredInputValues(inputs.values()))
{
UIOutput output = shell.getOutput();
if (!getContext... | java | @Override
public boolean promptRequiredMissingValues(ShellImpl shell) throws InterruptedException
{
Map<String, InputComponent<?, ?>> inputs = getController().getInputs();
if (hasMissingRequiredInputValues(inputs.values()))
{
UIOutput output = shell.getOutput();
if (!getContext... | [
"@",
"Override",
"public",
"boolean",
"promptRequiredMissingValues",
"(",
"ShellImpl",
"shell",
")",
"throws",
"InterruptedException",
"{",
"Map",
"<",
"String",
",",
"InputComponent",
"<",
"?",
",",
"?",
">",
">",
"inputs",
"=",
"getController",
"(",
")",
"."... | Prompts for required missing values | [
"Prompts",
"for",
"required",
"missing",
"values"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/shell/impl/src/main/java/org/jboss/forge/addon/shell/aesh/ShellSingleCommand.java#L56-L72 | train |
forge/core | projects/api/src/main/java/org/jboss/forge/addon/projects/ui/AbstractProjectCommand.java | AbstractProjectCommand.filterValueChoicesFromStack | protected <T extends ProjectFacet> boolean filterValueChoicesFromStack(Project project, UISelectOne<T> select)
{
boolean result = true;
Optional<Stack> stackOptional = project.getStack();
// Filtering only supported facets
if (stackOptional.isPresent())
{
Stack stack = stackOpt... | java | protected <T extends ProjectFacet> boolean filterValueChoicesFromStack(Project project, UISelectOne<T> select)
{
boolean result = true;
Optional<Stack> stackOptional = project.getStack();
// Filtering only supported facets
if (stackOptional.isPresent())
{
Stack stack = stackOpt... | [
"protected",
"<",
"T",
"extends",
"ProjectFacet",
">",
"boolean",
"filterValueChoicesFromStack",
"(",
"Project",
"project",
",",
"UISelectOne",
"<",
"T",
">",
"select",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"Optional",
"<",
"Stack",
">",
"stackOptio... | Filters the given value choices according the current enabled stack
@param select the {@link SelectComponent} containing the value choices to be filtered
@return <code>true</code> if it should be displayed in the UI | [
"Filters",
"the",
"given",
"value",
"choices",
"according",
"the",
"current",
"enabled",
"stack"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/projects/api/src/main/java/org/jboss/forge/addon/projects/ui/AbstractProjectCommand.java#L102-L129 | train |
forge/core | facets/api/src/main/java/org/jboss/forge/addon/facets/AbstractFaceted.java | AbstractFaceted.safeGetFacet | @SuppressWarnings("unchecked")
private <F extends FACETTYPE> F safeGetFacet(Class<F> type)
{
for (FACETTYPE facet : facets)
{
if (type.isInstance(facet))
{
return (F) facet;
}
}
return null;
} | java | @SuppressWarnings("unchecked")
private <F extends FACETTYPE> F safeGetFacet(Class<F> type)
{
for (FACETTYPE facet : facets)
{
if (type.isInstance(facet))
{
return (F) facet;
}
}
return null;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"F",
"extends",
"FACETTYPE",
">",
"F",
"safeGetFacet",
"(",
"Class",
"<",
"F",
">",
"type",
")",
"{",
"for",
"(",
"FACETTYPE",
"facet",
":",
"facets",
")",
"{",
"if",
"(",
"type",
".",... | Returns the installed facet that is an instance of the provided type argument, null otherwise.
It does not throw any exception
@param type the facet type
@return the Facet if found, otherwise, null | [
"Returns",
"the",
"installed",
"facet",
"that",
"is",
"an",
"instance",
"of",
"the",
"provided",
"type",
"argument",
"null",
"otherwise",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/facets/api/src/main/java/org/jboss/forge/addon/facets/AbstractFaceted.java#L140-L152 | train |
forge/core | convert/api/src/main/java/org/jboss/forge/addon/convert/CompositeConverter.java | CompositeConverter.convert | @SuppressWarnings("unchecked")
@Override
public Object convert(Object source)
{
Object value = source;
for (Converter<Object, Object> converter : converters)
{
if (converter != null)
{
value = converter.convert(value);
}
}
return value;
} | java | @SuppressWarnings("unchecked")
@Override
public Object convert(Object source)
{
Object value = source;
for (Converter<Object, Object> converter : converters)
{
if (converter != null)
{
value = converter.convert(value);
}
}
return value;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"Object",
"convert",
"(",
"Object",
"source",
")",
"{",
"Object",
"value",
"=",
"source",
";",
"for",
"(",
"Converter",
"<",
"Object",
",",
"Object",
">",
"converter",
":",
"con... | This method always returns the last object converted from the list | [
"This",
"method",
"always",
"returns",
"the",
"last",
"object",
"converted",
"from",
"the",
"list"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/convert/api/src/main/java/org/jboss/forge/addon/convert/CompositeConverter.java#L39-L52 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/faces/AbstractFacesFacetImpl.java | AbstractFacesFacetImpl.buildFacesViewId | private String buildFacesViewId(final String servletMapping, final String resourcePath)
{
for (String suffix : getFacesSuffixes())
{
if (resourcePath.endsWith(suffix))
{
StringBuffer result = new StringBuffer();
Map<Pattern, String> patterns = new HashMap<>();
... | java | private String buildFacesViewId(final String servletMapping, final String resourcePath)
{
for (String suffix : getFacesSuffixes())
{
if (resourcePath.endsWith(suffix))
{
StringBuffer result = new StringBuffer();
Map<Pattern, String> patterns = new HashMap<>();
... | [
"private",
"String",
"buildFacesViewId",
"(",
"final",
"String",
"servletMapping",
",",
"final",
"String",
"resourcePath",
")",
"{",
"for",
"(",
"String",
"suffix",
":",
"getFacesSuffixes",
"(",
")",
")",
"{",
"if",
"(",
"resourcePath",
".",
"endsWith",
"(",
... | Build a Faces view ID for the given resource path, return null if not mapped by Faces Servlet | [
"Build",
"a",
"Faces",
"view",
"ID",
"for",
"the",
"given",
"resource",
"path",
"return",
"null",
"if",
"not",
"mapped",
"by",
"Faces",
"Servlet"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/faces/AbstractFacesFacetImpl.java#L392-L433 | train |
forge/core | database-tools/impl/src/main/java/org/jboss/forge/addon/database/tools/connections/ConnectionProfileManagerImpl.java | ConnectionProfileManagerImpl.encodePassword | protected String encodePassword(String password)
{
StringBuilder result = new StringBuilder();
if (password != null)
{
for (int i = 0; i < password.length(); i++)
{
int c = password.charAt(i);
c ^= 0xdfaa;
result.append(Integer.toHexString(c));
... | java | protected String encodePassword(String password)
{
StringBuilder result = new StringBuilder();
if (password != null)
{
for (int i = 0; i < password.length(); i++)
{
int c = password.charAt(i);
c ^= 0xdfaa;
result.append(Integer.toHexString(c));
... | [
"protected",
"String",
"encodePassword",
"(",
"String",
"password",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"password",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"passwo... | Copied from com.intellij.openapi.util.PasswordUtil.java | [
"Copied",
"from",
"com",
".",
"intellij",
".",
"openapi",
".",
"util",
".",
"PasswordUtil",
".",
"java"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/database-tools/impl/src/main/java/org/jboss/forge/addon/database/tools/connections/ConnectionProfileManagerImpl.java#L99-L112 | train |
forge/core | maven/api/src/main/java/org/jboss/forge/addon/maven/archetype/SimpleNamespaceContext.java | SimpleNamespaceContext.registerMapping | public void registerMapping(String prefix, String namespaceURI)
{
prefix2Ns.put(prefix, namespaceURI);
ns2Prefix.put(namespaceURI, prefix);
} | java | public void registerMapping(String prefix, String namespaceURI)
{
prefix2Ns.put(prefix, namespaceURI);
ns2Prefix.put(namespaceURI, prefix);
} | [
"public",
"void",
"registerMapping",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"{",
"prefix2Ns",
".",
"put",
"(",
"prefix",
",",
"namespaceURI",
")",
";",
"ns2Prefix",
".",
"put",
"(",
"namespaceURI",
",",
"prefix",
")",
";",
"}"
] | Registers prefix - namespace URI mapping
@param prefix
@param namespaceURI | [
"Registers",
"prefix",
"-",
"namespace",
"URI",
"mapping"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/api/src/main/java/org/jboss/forge/addon/maven/archetype/SimpleNamespaceContext.java#L57-L61 | train |
forge/core | dependencies/api/src/main/java/org/jboss/forge/addon/dependencies/collection/DependencyNodeUtil.java | DependencyNodeUtil.prettyPrint | public static CharSequence prettyPrint(DependencyNode root)
{
StringBuilder sb = new StringBuilder();
prettyPrint(root, new Predicate<DependencyNode>()
{
@Override
public boolean accept(DependencyNode node)
{
return true;
}
}, sb, 0);
retu... | java | public static CharSequence prettyPrint(DependencyNode root)
{
StringBuilder sb = new StringBuilder();
prettyPrint(root, new Predicate<DependencyNode>()
{
@Override
public boolean accept(DependencyNode node)
{
return true;
}
}, sb, 0);
retu... | [
"public",
"static",
"CharSequence",
"prettyPrint",
"(",
"DependencyNode",
"root",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"prettyPrint",
"(",
"root",
",",
"new",
"Predicate",
"<",
"DependencyNode",
">",
"(",
")",
"{",
"@"... | Prints a tree-like structure for this object
@param root
@return | [
"Prints",
"a",
"tree",
"-",
"like",
"structure",
"for",
"this",
"object"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/dependencies/api/src/main/java/org/jboss/forge/addon/dependencies/collection/DependencyNodeUtil.java#L123-L135 | train |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/ui/AbstractEnablementCDICommand.java | AbstractEnablementCDICommand.initializeEnablementUI | protected void initializeEnablementUI(UIBuilder builder) {
enabled.setEnabled(hasEnablement());
if (getSelectedProject(builder).hasFacet(CDIFacet_1_1.class))
{
priority.setEnabled(hasEnablement());
builder.add(priority);
}
else
{
priority.setEnabled(false);... | java | protected void initializeEnablementUI(UIBuilder builder) {
enabled.setEnabled(hasEnablement());
if (getSelectedProject(builder).hasFacet(CDIFacet_1_1.class))
{
priority.setEnabled(hasEnablement());
builder.add(priority);
}
else
{
priority.setEnabled(false);... | [
"protected",
"void",
"initializeEnablementUI",
"(",
"UIBuilder",
"builder",
")",
"{",
"enabled",
".",
"setEnabled",
"(",
"hasEnablement",
"(",
")",
")",
";",
"if",
"(",
"getSelectedProject",
"(",
"builder",
")",
".",
"hasFacet",
"(",
"CDIFacet_1_1",
".",
"clas... | Note that enablement should be initialized last | [
"Note",
"that",
"enablement",
"should",
"be",
"initialized",
"last"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/ui/AbstractEnablementCDICommand.java#L45-L57 | train |
forge/core | shell/impl/src/main/java/org/jboss/forge/addon/shell/util/ShellUtil.java | ShellUtil.colorizeResource | public static String colorizeResource(FileResource<?> resource)
{
String name = resource.getName();
if (resource.isDirectory())
{
name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
}
else if (resource.isExecutable())
{
name ... | java | public static String colorizeResource(FileResource<?> resource)
{
String name = resource.getName();
if (resource.isDirectory())
{
name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
}
else if (resource.isExecutable())
{
name ... | [
"public",
"static",
"String",
"colorizeResource",
"(",
"FileResource",
"<",
"?",
">",
"resource",
")",
"{",
"String",
"name",
"=",
"resource",
".",
"getName",
"(",
")",
";",
"if",
"(",
"resource",
".",
"isDirectory",
"(",
")",
")",
"{",
"name",
"=",
"n... | Applies ANSI colors in a specific resource
@param resource
@return | [
"Applies",
"ANSI",
"colors",
"in",
"a",
"specific",
"resource"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/shell/impl/src/main/java/org/jboss/forge/addon/shell/util/ShellUtil.java#L64-L76 | train |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/metawidget/widgetbuilder/EntityWidgetBuilder.java | EntityWidgetBuilder.addColumnComponents | @Override
protected void addColumnComponents(HtmlDataTable dataTable, Map<String, String> attributes, NodeList elements,
StaticXmlMetawidget metawidget)
{
super.addColumnComponents(dataTable, attributes, elements, metawidget);
if (dataTable.getChildren().isEmpty())
{
return... | java | @Override
protected void addColumnComponents(HtmlDataTable dataTable, Map<String, String> attributes, NodeList elements,
StaticXmlMetawidget metawidget)
{
super.addColumnComponents(dataTable, attributes, elements, metawidget);
if (dataTable.getChildren().isEmpty())
{
return... | [
"@",
"Override",
"protected",
"void",
"addColumnComponents",
"(",
"HtmlDataTable",
"dataTable",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
",",
"NodeList",
"elements",
",",
"StaticXmlMetawidget",
"metawidget",
")",
"{",
"super",
".",
"addColumnCo... | Overridden to add a 'remove' column. | [
"Overridden",
"to",
"add",
"a",
"remove",
"column",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/metawidget/widgetbuilder/EntityWidgetBuilder.java#L432-L504 | train |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java | FacesScaffoldProvider.generateNavigation | protected Resource<?> generateNavigation(final String targetDir)
throws IOException
{
WebResourcesFacet web = this.project.getFacet(WebResourcesFacet.class);
HtmlTag unorderedList = new HtmlTag("ul");
ResourceFilter filter = new ResourceFilter()
{
@Override
publ... | java | protected Resource<?> generateNavigation(final String targetDir)
throws IOException
{
WebResourcesFacet web = this.project.getFacet(WebResourcesFacet.class);
HtmlTag unorderedList = new HtmlTag("ul");
ResourceFilter filter = new ResourceFilter()
{
@Override
publ... | [
"protected",
"Resource",
"<",
"?",
">",
"generateNavigation",
"(",
"final",
"String",
"targetDir",
")",
"throws",
"IOException",
"{",
"WebResourcesFacet",
"web",
"=",
"this",
".",
"project",
".",
"getFacet",
"(",
"WebResourcesFacet",
".",
"class",
")",
";",
"H... | Generates the navigation menu based on scaffolded entities. | [
"Generates",
"the",
"navigation",
"menu",
"based",
"on",
"scaffolded",
"entities",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L587-L647 | train |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java | FacesScaffoldProvider.parseNamespaces | protected Map<String, String> parseNamespaces(final String template)
{
Map<String, String> namespaces = CollectionUtils.newHashMap();
Document document = XmlUtils.documentFromString(template);
Element element = document.getDocumentElement();
NamedNodeMap attributes = element.getAttributes();
... | java | protected Map<String, String> parseNamespaces(final String template)
{
Map<String, String> namespaces = CollectionUtils.newHashMap();
Document document = XmlUtils.documentFromString(template);
Element element = document.getDocumentElement();
NamedNodeMap attributes = element.getAttributes();
... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"parseNamespaces",
"(",
"final",
"String",
"template",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"namespaces",
"=",
"CollectionUtils",
".",
"newHashMap",
"(",
")",
";",
"Document",
"document",
... | Parses the given XML and determines what namespaces it already declares. These are later removed from the list of
namespaces that Metawidget introduces. | [
"Parses",
"the",
"given",
"XML",
"and",
"determines",
"what",
"namespaces",
"it",
"already",
"declares",
".",
"These",
"are",
"later",
"removed",
"from",
"the",
"list",
"of",
"namespaces",
"that",
"Metawidget",
"introduces",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L653-L675 | train |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java | FacesScaffoldProvider.parseIndent | protected int parseIndent(final String template, final String indentOf)
{
int indent = 0;
int indexOf = template.indexOf(indentOf);
while ((indexOf >= 0) && (template.charAt(indexOf) != '\n'))
{
if (template.charAt(indexOf) == '\t')
{
indent++;
}
... | java | protected int parseIndent(final String template, final String indentOf)
{
int indent = 0;
int indexOf = template.indexOf(indentOf);
while ((indexOf >= 0) && (template.charAt(indexOf) != '\n'))
{
if (template.charAt(indexOf) == '\t')
{
indent++;
}
... | [
"protected",
"int",
"parseIndent",
"(",
"final",
"String",
"template",
",",
"final",
"String",
"indentOf",
")",
"{",
"int",
"indent",
"=",
"0",
";",
"int",
"indexOf",
"=",
"template",
".",
"indexOf",
"(",
"indentOf",
")",
";",
"while",
"(",
"(",
"indexOf... | Parses the given XML and determines the indent of the given String namespaces that Metawidget introduces. | [
"Parses",
"the",
"given",
"XML",
"and",
"determines",
"the",
"indent",
"of",
"the",
"given",
"String",
"namespaces",
"that",
"Metawidget",
"introduces",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L680-L696 | train |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java | FacesScaffoldProvider.writeEntityMetawidget | protected void writeEntityMetawidget(final Map<Object, Object> context, final int entityMetawidgetIndent,
final Map<String, String> existingNamespaces)
{
StringWriter stringWriter = new StringWriter();
this.entityMetawidget.write(stringWriter, entityMetawidgetIndent);
context.put("metaw... | java | protected void writeEntityMetawidget(final Map<Object, Object> context, final int entityMetawidgetIndent,
final Map<String, String> existingNamespaces)
{
StringWriter stringWriter = new StringWriter();
this.entityMetawidget.write(stringWriter, entityMetawidgetIndent);
context.put("metaw... | [
"protected",
"void",
"writeEntityMetawidget",
"(",
"final",
"Map",
"<",
"Object",
",",
"Object",
">",
"context",
",",
"final",
"int",
"entityMetawidgetIndent",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"existingNamespaces",
")",
"{",
"StringWriter"... | Writes the entity Metawidget and its namespaces into the given context. | [
"Writes",
"the",
"entity",
"Metawidget",
"and",
"its",
"namespaces",
"into",
"the",
"given",
"context",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L845-L855 | train |
forge/core | javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java | FacesScaffoldProvider.writeSearchAndBeanMetawidget | protected void writeSearchAndBeanMetawidget(final Map<Object, Object> context, final int searchMetawidgetIndent,
final int beanMetawidgetIndent,
final Map<String, String> existingNamespaces)
{
StringWriter stringWriter = new StringWriter();
this.searchMetawidget.write(stringWriter... | java | protected void writeSearchAndBeanMetawidget(final Map<Object, Object> context, final int searchMetawidgetIndent,
final int beanMetawidgetIndent,
final Map<String, String> existingNamespaces)
{
StringWriter stringWriter = new StringWriter();
this.searchMetawidget.write(stringWriter... | [
"protected",
"void",
"writeSearchAndBeanMetawidget",
"(",
"final",
"Map",
"<",
"Object",
",",
"Object",
">",
"context",
",",
"final",
"int",
"searchMetawidgetIndent",
",",
"final",
"int",
"beanMetawidgetIndent",
",",
"final",
"Map",
"<",
"String",
",",
"String",
... | Writes the search Metawidget, the bean Metawidget and their namespaces into the given context. | [
"Writes",
"the",
"search",
"Metawidget",
"the",
"bean",
"Metawidget",
"and",
"their",
"namespaces",
"into",
"the",
"given",
"context",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/scaffold-faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L860-L876 | train |
forge/core | convert/impl/src/main/java/org/jboss/forge/addon/convert/impl/ConverterFactoryImpl.java | ConverterFactoryImpl.areTypesAssignable | private boolean areTypesAssignable(Class<?> source, Class<?> target)
{
if (target.isAssignableFrom(source))
{
return true;
}
else if (!source.isPrimitive() && !target.isPrimitive())
{
return false;
}
else if (source.isPrimitive())
{
// source... | java | private boolean areTypesAssignable(Class<?> source, Class<?> target)
{
if (target.isAssignableFrom(source))
{
return true;
}
else if (!source.isPrimitive() && !target.isPrimitive())
{
return false;
}
else if (source.isPrimitive())
{
// source... | [
"private",
"boolean",
"areTypesAssignable",
"(",
"Class",
"<",
"?",
">",
"source",
",",
"Class",
"<",
"?",
">",
"target",
")",
"{",
"if",
"(",
"target",
".",
"isAssignableFrom",
"(",
"source",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
... | Check if the parameters are primitive and if they can be assignable | [
"Check",
"if",
"the",
"parameters",
"are",
"primitive",
"and",
"if",
"they",
"can",
"be",
"assignable"
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/convert/impl/src/main/java/org/jboss/forge/addon/convert/impl/ConverterFactoryImpl.java#L107-L127 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.findAndReplaceProperties | @SuppressWarnings("unchecked")
protected Element findAndReplaceProperties(Counter counter, Element parent, String name, Map props)
{
boolean shouldExist = (props != null) && !props.isEmpty();
Element element = updateElement(counter, parent, name, shouldExist);
if (shouldExist)
{
I... | java | @SuppressWarnings("unchecked")
protected Element findAndReplaceProperties(Counter counter, Element parent, String name, Map props)
{
boolean shouldExist = (props != null) && !props.isEmpty();
Element element = updateElement(counter, parent, name, shouldExist);
if (shouldExist)
{
I... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Element",
"findAndReplaceProperties",
"(",
"Counter",
"counter",
",",
"Element",
"parent",
",",
"String",
"name",
",",
"Map",
"props",
")",
"{",
"boolean",
"shouldExist",
"=",
"(",
"props",
"!=",
... | Method findAndReplaceProperties.
@param counter
@param props
@param name
@param parent | [
"Method",
"findAndReplaceProperties",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L167-L195 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.findAndReplaceSimpleElement | protected Element findAndReplaceSimpleElement(Counter counter, Element parent, String name, String text,
String defaultValue)
{
if ((defaultValue != null) && (text != null) && defaultValue.equals(text))
{
Element element = parent.getChild(name, parent.getNamespace());
// if ... | java | protected Element findAndReplaceSimpleElement(Counter counter, Element parent, String name, String text,
String defaultValue)
{
if ((defaultValue != null) && (text != null) && defaultValue.equals(text))
{
Element element = parent.getChild(name, parent.getNamespace());
// if ... | [
"protected",
"Element",
"findAndReplaceSimpleElement",
"(",
"Counter",
"counter",
",",
"Element",
"parent",
",",
"String",
"name",
",",
"String",
"text",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"(",
"defaultValue",
"!=",
"null",
")",
"&&",
"(",
"... | Method findAndReplaceSimpleElement.
@param counter
@param defaultValue
@param text
@param name
@param parent | [
"Method",
"findAndReplaceSimpleElement",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L206-L227 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.findAndReplaceSimpleLists | protected Element findAndReplaceSimpleLists(Counter counter, Element parent, java.util.Collection list,
String parentName, String childName)
{
boolean shouldExist = (list != null) && (list.size() > 0);
Element element = updateElement(counter, parent, parentName, shouldExist);
if (should... | java | protected Element findAndReplaceSimpleLists(Counter counter, Element parent, java.util.Collection list,
String parentName, String childName)
{
boolean shouldExist = (list != null) && (list.size() > 0);
Element element = updateElement(counter, parent, parentName, shouldExist);
if (should... | [
"protected",
"Element",
"findAndReplaceSimpleLists",
"(",
"Counter",
"counter",
",",
"Element",
"parent",
",",
"java",
".",
"util",
".",
"Collection",
"list",
",",
"String",
"parentName",
",",
"String",
"childName",
")",
"{",
"boolean",
"shouldExist",
"=",
"(",
... | Method findAndReplaceSimpleLists.
@param counter
@param childName
@param parentName
@param list
@param parent | [
"Method",
"findAndReplaceSimpleLists",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L239-L284 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.findAndReplaceXpp3DOM | protected Element findAndReplaceXpp3DOM(Counter counter, Element parent, String name, Xpp3Dom dom)
{
boolean shouldExist = (dom != null) && ((dom.getChildCount() > 0) || (dom.getValue() != null));
Element element = updateElement(counter, parent, name, shouldExist);
if (shouldExist)
{
... | java | protected Element findAndReplaceXpp3DOM(Counter counter, Element parent, String name, Xpp3Dom dom)
{
boolean shouldExist = (dom != null) && ((dom.getChildCount() > 0) || (dom.getValue() != null));
Element element = updateElement(counter, parent, name, shouldExist);
if (shouldExist)
{
... | [
"protected",
"Element",
"findAndReplaceXpp3DOM",
"(",
"Counter",
"counter",
",",
"Element",
"parent",
",",
"String",
"name",
",",
"Xpp3Dom",
"dom",
")",
"{",
"boolean",
"shouldExist",
"=",
"(",
"dom",
"!=",
"null",
")",
"&&",
"(",
"(",
"dom",
".",
"getChil... | Method findAndReplaceXpp3DOM.
@param counter
@param dom
@param name
@param parent | [
"Method",
"findAndReplaceXpp3DOM",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L296-L305 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.insertAtPreferredLocation | protected void insertAtPreferredLocation(Element parent, Element child, Counter counter)
{
int contentIndex = 0;
int elementCounter = 0;
Iterator it = parent.getContent().iterator();
Text lastText = null;
int offset = 0;
while (it.hasNext() && (elementCounter <= counter.getCurrent... | java | protected void insertAtPreferredLocation(Element parent, Element child, Counter counter)
{
int contentIndex = 0;
int elementCounter = 0;
Iterator it = parent.getContent().iterator();
Text lastText = null;
int offset = 0;
while (it.hasNext() && (elementCounter <= counter.getCurrent... | [
"protected",
"void",
"insertAtPreferredLocation",
"(",
"Element",
"parent",
",",
"Element",
"child",
",",
"Counter",
"counter",
")",
"{",
"int",
"contentIndex",
"=",
"0",
";",
"int",
"elementCounter",
"=",
"0",
";",
"Iterator",
"it",
"=",
"parent",
".",
"get... | Method insertAtPreferredLocation.
@param parent
@param counter
@param child | [
"Method",
"insertAtPreferredLocation",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L314-L357 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.iterateContributor | protected void iterateContributor(Counter counter, Element parent, java.util.Collection list,
java.lang.String parentTag, java.lang.String childTag)
{
boolean shouldExist = (list != null) && (list.size() > 0);
Element element = updateElement(counter, parent, parentTag, shouldExist);
if ... | java | protected void iterateContributor(Counter counter, Element parent, java.util.Collection list,
java.lang.String parentTag, java.lang.String childTag)
{
boolean shouldExist = (list != null) && (list.size() > 0);
Element element = updateElement(counter, parent, parentTag, shouldExist);
if ... | [
"protected",
"void",
"iterateContributor",
"(",
"Counter",
"counter",
",",
"Element",
"parent",
",",
"java",
".",
"util",
".",
"Collection",
"list",
",",
"java",
".",
"lang",
".",
"String",
"parentTag",
",",
"java",
".",
"lang",
".",
"String",
"childTag",
... | Method iterateContributor.
@param counter
@param childTag
@param parentTag
@param list
@param parent | [
"Method",
"iterateContributor",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L368-L412 | train |
forge/core | maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java | MavenJDOMWriter.replaceXpp3DOM | @SuppressWarnings("unchecked")
protected void replaceXpp3DOM(final Element parent, final Xpp3Dom parentDom, final Counter counter)
{
if (parentDom.getChildCount() > 0)
{
Xpp3Dom[] childs = parentDom.getChildren();
Collection<Xpp3Dom> domChilds = new ArrayList<>();
for (int i... | java | @SuppressWarnings("unchecked")
protected void replaceXpp3DOM(final Element parent, final Xpp3Dom parentDom, final Counter counter)
{
if (parentDom.getChildCount() > 0)
{
Xpp3Dom[] childs = parentDom.getChildren();
Collection<Xpp3Dom> domChilds = new ArrayList<>();
for (int i... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"replaceXpp3DOM",
"(",
"final",
"Element",
"parent",
",",
"final",
"Xpp3Dom",
"parentDom",
",",
"final",
"Counter",
"counter",
")",
"{",
"if",
"(",
"parentDom",
".",
"getChildCount",
"(",
... | Method replaceXpp3DOM.
@param parent
@param counter
@param parentDom | [
"Method",
"replaceXpp3DOM",
"."
] | e140eb03bbe2b3409478ad70c86c3edbef6d9a0c | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java#L1221-L1278 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.