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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignMask.java | DesignMask.update | public void update() {
boolean shouldShow = shouldShow();
if (visible != shouldShow) {
visible = shouldShow;
BaseUIComponent target = element.getMaskTarget();
if (visible) {
Menupopup contextMenu = ElementUI.getDesignContextMenu(target);
String displayName = element.getDisplayName();
target.addMask(displayName, contextMenu);
} else {
target.removeMask();
}
}
} | java | public void update() {
boolean shouldShow = shouldShow();
if (visible != shouldShow) {
visible = shouldShow;
BaseUIComponent target = element.getMaskTarget();
if (visible) {
Menupopup contextMenu = ElementUI.getDesignContextMenu(target);
String displayName = element.getDisplayName();
target.addMask(displayName, contextMenu);
} else {
target.removeMask();
}
}
} | [
"public",
"void",
"update",
"(",
")",
"{",
"boolean",
"shouldShow",
"=",
"shouldShow",
"(",
")",
";",
"if",
"(",
"visible",
"!=",
"shouldShow",
")",
"{",
"visible",
"=",
"shouldShow",
";",
"BaseUIComponent",
"target",
"=",
"element",
".",
"getMaskTarget",
... | Show or hide the design mode mask. | [
"Show",
"or",
"hide",
"the",
"design",
"mode",
"mask",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignMask.java#L79-L94 | train |
tomdcc/sham | sham-core/src/main/java/org/shamdata/image/FileSystemImagePicker.java | FileSystemImagePicker.toURL | @Override
protected URL toURL(String filename) {
try {
return new File(filename).toURI().toURL();
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
} | java | @Override
protected URL toURL(String filename) {
try {
return new File(filename).toURI().toURL();
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
} | [
"@",
"Override",
"protected",
"URL",
"toURL",
"(",
"String",
"filename",
")",
"{",
"try",
"{",
"return",
"new",
"File",
"(",
"filename",
")",
".",
"toURI",
"(",
")",
".",
"toURL",
"(",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"... | Returns a file URL pointing to the given file
@param filename path to the file
@return a file URL poiting to the file | [
"Returns",
"a",
"file",
"URL",
"pointing",
"to",
"the",
"given",
"file"
] | 33ede5e7130888736d6c84368e16a56e9e31e033 | https://github.com/tomdcc/sham/blob/33ede5e7130888736d6c84368e16a56e9e31e033/sham-core/src/main/java/org/shamdata/image/FileSystemImagePicker.java#L44-L51 | train |
mgormley/prim | src/main/java_generated/edu/jhu/prim/map/IntFloatHashMap.java | IntFloatHashMap.putAndGet | public float putAndGet(final int key, final float value) {
int index = findInsertionIndex(key);
float previous = missingEntries;
boolean newMapping = true;
if (index < 0) {
index = changeIndexSign(index);
previous = values[index];
newMapping = false;
}
keys[index] = key;
states[index] = FULL;
values[index] = value;
if (newMapping) {
++size;
if (shouldGrowTable()) {
growTable();
}
++count;
}
return previous;
} | java | public float putAndGet(final int key, final float value) {
int index = findInsertionIndex(key);
float previous = missingEntries;
boolean newMapping = true;
if (index < 0) {
index = changeIndexSign(index);
previous = values[index];
newMapping = false;
}
keys[index] = key;
states[index] = FULL;
values[index] = value;
if (newMapping) {
++size;
if (shouldGrowTable()) {
growTable();
}
++count;
}
return previous;
} | [
"public",
"float",
"putAndGet",
"(",
"final",
"int",
"key",
",",
"final",
"float",
"value",
")",
"{",
"int",
"index",
"=",
"findInsertionIndex",
"(",
"key",
")",
";",
"float",
"previous",
"=",
"missingEntries",
";",
"boolean",
"newMapping",
"=",
"true",
";... | Put a value associated with a key in the map.
@param key key to which value is associated
@param value value to put in the map
@return previous value associated with the key | [
"Put",
"a",
"value",
"associated",
"with",
"a",
"key",
"in",
"the",
"map",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/map/IntFloatHashMap.java#L452-L472 | train |
mgormley/prim | src/main/java_generated/edu/jhu/prim/map/IntFloatHashMap.java | IntFloatHashMap.growTable | private void growTable() {
final int oldLength = states.length;
final int[] oldKeys = keys;
final float[] oldValues = values;
final byte[] oldStates = states;
final int newLength = RESIZE_MULTIPLIER * oldLength;
final int[] newKeys = new int[newLength];
final float[] newValues = new float[newLength];
final byte[] newStates = new byte[newLength];
final int newMask = newLength - 1;
for (int i = 0; i < oldLength; ++i) {
if (oldStates[i] == FULL) {
final int key = oldKeys[i];
final int index = findInsertionIndex(newKeys, newStates, key, newMask);
newKeys[index] = key;
newValues[index] = oldValues[i];
newStates[index] = FULL;
}
}
mask = newMask;
keys = newKeys;
values = newValues;
states = newStates;
} | java | private void growTable() {
final int oldLength = states.length;
final int[] oldKeys = keys;
final float[] oldValues = values;
final byte[] oldStates = states;
final int newLength = RESIZE_MULTIPLIER * oldLength;
final int[] newKeys = new int[newLength];
final float[] newValues = new float[newLength];
final byte[] newStates = new byte[newLength];
final int newMask = newLength - 1;
for (int i = 0; i < oldLength; ++i) {
if (oldStates[i] == FULL) {
final int key = oldKeys[i];
final int index = findInsertionIndex(newKeys, newStates, key, newMask);
newKeys[index] = key;
newValues[index] = oldValues[i];
newStates[index] = FULL;
}
}
mask = newMask;
keys = newKeys;
values = newValues;
states = newStates;
} | [
"private",
"void",
"growTable",
"(",
")",
"{",
"final",
"int",
"oldLength",
"=",
"states",
".",
"length",
";",
"final",
"int",
"[",
"]",
"oldKeys",
"=",
"keys",
";",
"final",
"float",
"[",
"]",
"oldValues",
"=",
"values",
";",
"final",
"byte",
"[",
"... | Grow the tables. | [
"Grow",
"the",
"tables",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/map/IntFloatHashMap.java#L507-L534 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java | DomainFactoryRegistry.newObject | public static <T> T newObject(Class<T> clazz) {
return getFactory(clazz).newObject(clazz);
} | java | public static <T> T newObject(Class<T> clazz) {
return getFactory(clazz).newObject(clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"newObject",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"getFactory",
"(",
"clazz",
")",
".",
"newObject",
"(",
"clazz",
")",
";",
"}"
] | Creates a new instance of an object of this domain.
@param <T> Class of domain object.
@param clazz Class of object to create.
@return The new domain object instance. | [
"Creates",
"a",
"new",
"instance",
"of",
"an",
"object",
"of",
"this",
"domain",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java#L52-L54 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java | DomainFactoryRegistry.fetchObject | public static <T> T fetchObject(Class<T> clazz, String id) {
return getFactory(clazz).fetchObject(clazz, id);
} | java | public static <T> T fetchObject(Class<T> clazz, String id) {
return getFactory(clazz).fetchObject(clazz, id);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fetchObject",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"id",
")",
"{",
"return",
"getFactory",
"(",
"clazz",
")",
".",
"fetchObject",
"(",
"clazz",
",",
"id",
")",
";",
"}"
] | Fetches an object, identified by its unique id, from the underlying data store.
@param <T> Class of domain object.
@param clazz Class of object to create.
@param id Unique id of the object.
@return The requested object. | [
"Fetches",
"an",
"object",
"identified",
"by",
"its",
"unique",
"id",
"from",
"the",
"underlying",
"data",
"store",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java#L64-L66 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java | DomainFactoryRegistry.fetchObjects | public static <T> List<T> fetchObjects(Class<T> clazz, String[] ids) {
return getFactory(clazz).fetchObjects(clazz, ids);
} | java | public static <T> List<T> fetchObjects(Class<T> clazz, String[] ids) {
return getFactory(clazz).fetchObjects(clazz, ids);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"fetchObjects",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"[",
"]",
"ids",
")",
"{",
"return",
"getFactory",
"(",
"clazz",
")",
".",
"fetchObjects",
"(",
"clazz",
",",
"ids",
")",... | Fetches multiple domain objects as specified by an array of identifier values.
@param <T> Class of domain object.
@param clazz Class of object to create.
@param ids An array of unique identifiers.
@return A list of domain objects in the same order as requested in the ids parameter. | [
"Fetches",
"multiple",
"domain",
"objects",
"as",
"specified",
"by",
"an",
"array",
"of",
"identifier",
"values",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java#L76-L78 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java | DomainFactoryRegistry.getFactory | @SuppressWarnings("unchecked")
public static <T> IDomainFactory<T> getFactory(Class<T> clazz) {
for (IDomainFactory<?> factory : instance) {
String alias = factory.getAlias(clazz);
if (alias != null) {
return (IDomainFactory<T>) factory;
}
}
throw new IllegalArgumentException("Domain class has no registered factory: " + clazz.getName());
} | java | @SuppressWarnings("unchecked")
public static <T> IDomainFactory<T> getFactory(Class<T> clazz) {
for (IDomainFactory<?> factory : instance) {
String alias = factory.getAlias(clazz);
if (alias != null) {
return (IDomainFactory<T>) factory;
}
}
throw new IllegalArgumentException("Domain class has no registered factory: " + clazz.getName());
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"IDomainFactory",
"<",
"T",
">",
"getFactory",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"for",
"(",
"IDomainFactory",
"<",
"?",
">",
"factory",
":",
"instance",... | Returns a domain factory for the specified class.
@param <T> Class of domain object.
@param clazz Class of object created by factory.
@return A domain object factory. | [
"Returns",
"a",
"domain",
"factory",
"for",
"the",
"specified",
"class",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/domain/DomainFactoryRegistry.java#L87-L98 | train |
mgormley/prim | src/main/java/edu/jhu/prim/Primitives.java | Primitives.compare | public static int compare(float a, float b, float delta) {
if (equals(a, b, delta)) {
return 0;
}
return Float.compare(a, b);
} | java | public static int compare(float a, float b, float delta) {
if (equals(a, b, delta)) {
return 0;
}
return Float.compare(a, b);
} | [
"public",
"static",
"int",
"compare",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"delta",
")",
"{",
"if",
"(",
"equals",
"(",
"a",
",",
"b",
",",
"delta",
")",
")",
"{",
"return",
"0",
";",
"}",
"return",
"Float",
".",
"compare",
"(",
... | Compares two float values up to some delta.
@return The value 0 if a equals b, a value greater than 0 if if a > b, and a value less than 0 if a < b. | [
"Compares",
"two",
"float",
"values",
"up",
"to",
"some",
"delta",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/Primitives.java#L191-L196 | train |
mgormley/prim | src/main/java_generated/edu/jhu/prim/arrays/ShortArrays.java | ShortArrays.countCommon | public static short countCommon(short[] indices1, short[] indices2) {
short numCommonIndices = 0;
int i = 0;
int j = 0;
while (i < indices1.length && j < indices2.length) {
if (indices1[i] < indices2[j]) {
i++;
} else if (indices2[j] < indices1[i]) {
j++;
} else {
numCommonIndices++;
// Equal indices.
i++;
j++;
}
}
for (; i < indices1.length; i++) {
numCommonIndices++;
}
for (; j < indices2.length; j++) {
numCommonIndices++;
}
return numCommonIndices;
} | java | public static short countCommon(short[] indices1, short[] indices2) {
short numCommonIndices = 0;
int i = 0;
int j = 0;
while (i < indices1.length && j < indices2.length) {
if (indices1[i] < indices2[j]) {
i++;
} else if (indices2[j] < indices1[i]) {
j++;
} else {
numCommonIndices++;
// Equal indices.
i++;
j++;
}
}
for (; i < indices1.length; i++) {
numCommonIndices++;
}
for (; j < indices2.length; j++) {
numCommonIndices++;
}
return numCommonIndices;
} | [
"public",
"static",
"short",
"countCommon",
"(",
"short",
"[",
"]",
"indices1",
",",
"short",
"[",
"]",
"indices2",
")",
"{",
"short",
"numCommonIndices",
"=",
"0",
";",
"int",
"i",
"=",
"0",
";",
"int",
"j",
"=",
"0",
";",
"while",
"(",
"i",
"<",
... | Counts the number of indices that appear in both arrays.
@param indices1 Sorted array of indices.
@param indices2 Sorted array of indices. | [
"Counts",
"the",
"number",
"of",
"indices",
"that",
"appear",
"in",
"both",
"arrays",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/arrays/ShortArrays.java#L215-L238 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRSF424BaseGenerator.java | RRSF424BaseGenerator.isSponsorInHierarchy | public boolean isSponsorInHierarchy(DevelopmentProposalContract sponsorable, String sponsorHierarchy,String level1) {
return sponsorHierarchyService.isSponsorInHierarchy(sponsorable.getSponsor().getSponsorCode(), sponsorHierarchy, 1, level1);
} | java | public boolean isSponsorInHierarchy(DevelopmentProposalContract sponsorable, String sponsorHierarchy,String level1) {
return sponsorHierarchyService.isSponsorInHierarchy(sponsorable.getSponsor().getSponsorCode(), sponsorHierarchy, 1, level1);
} | [
"public",
"boolean",
"isSponsorInHierarchy",
"(",
"DevelopmentProposalContract",
"sponsorable",
",",
"String",
"sponsorHierarchy",
",",
"String",
"level1",
")",
"{",
"return",
"sponsorHierarchyService",
".",
"isSponsorInHierarchy",
"(",
"sponsorable",
".",
"getSponsor",
"... | This method tests whether a document's sponsor is in a given sponsor hierarchy. | [
"This",
"method",
"tests",
"whether",
"a",
"document",
"s",
"sponsor",
"is",
"in",
"a",
"given",
"sponsor",
"hierarchy",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRSF424BaseGenerator.java#L156-L158 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRSF424BaseGenerator.java | RRSF424BaseGenerator.getSubmissionType | public Map<String, String> getSubmissionType(ProposalDevelopmentDocumentContract pdDoc) {
Map<String, String> submissionInfo = new HashMap<>();
S2sOpportunityContract opportunity = pdDoc.getDevelopmentProposal().getS2sOpportunity();
if (opportunity != null) {
if (opportunity.getS2sSubmissionType() != null) {
String submissionTypeCode = opportunity.getS2sSubmissionType().getCode();
String submissionTypeDescription = opportunity.getS2sSubmissionType().getDescription();
submissionInfo.put(SUBMISSION_TYPE_CODE, submissionTypeCode);
submissionInfo.put(SUBMISSION_TYPE_DESCRIPTION, submissionTypeDescription);
}
if (opportunity.getS2sRevisionType() != null) {
String revisionCode = opportunity.getS2sRevisionType().getCode();
submissionInfo.put(KEY_REVISION_CODE, revisionCode);
}
if (opportunity.getRevisionOtherDescription() != null) {
submissionInfo.put(KEY_REVISION_OTHER_DESCRIPTION, opportunity.getRevisionOtherDescription());
}
}
return submissionInfo;
} | java | public Map<String, String> getSubmissionType(ProposalDevelopmentDocumentContract pdDoc) {
Map<String, String> submissionInfo = new HashMap<>();
S2sOpportunityContract opportunity = pdDoc.getDevelopmentProposal().getS2sOpportunity();
if (opportunity != null) {
if (opportunity.getS2sSubmissionType() != null) {
String submissionTypeCode = opportunity.getS2sSubmissionType().getCode();
String submissionTypeDescription = opportunity.getS2sSubmissionType().getDescription();
submissionInfo.put(SUBMISSION_TYPE_CODE, submissionTypeCode);
submissionInfo.put(SUBMISSION_TYPE_DESCRIPTION, submissionTypeDescription);
}
if (opportunity.getS2sRevisionType() != null) {
String revisionCode = opportunity.getS2sRevisionType().getCode();
submissionInfo.put(KEY_REVISION_CODE, revisionCode);
}
if (opportunity.getRevisionOtherDescription() != null) {
submissionInfo.put(KEY_REVISION_OTHER_DESCRIPTION, opportunity.getRevisionOtherDescription());
}
}
return submissionInfo;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getSubmissionType",
"(",
"ProposalDevelopmentDocumentContract",
"pdDoc",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"submissionInfo",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"S2sOpportunityContrac... | This method creates and returns Map of submission details like submission type, description and Revision code
@param pdDoc Proposal Development Document.
@return Map<String, String> Map of submission details. | [
"This",
"method",
"creates",
"and",
"returns",
"Map",
"of",
"submission",
"details",
"like",
"submission",
"type",
"description",
"and",
"Revision",
"code"
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRSF424BaseGenerator.java#L166-L187 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java | RRBudgetV1_1Generator.getRRBudget | private RRBudgetDocument getRRBudget() {
deleteAutoGenNarratives();
RRBudgetDocument rrBudgetDocument = RRBudgetDocument.Factory
.newInstance();
RRBudget rrBudget = RRBudget.Factory.newInstance();
rrBudget.setFormVersion(FormVersion.v1_1.getVersion());
if (pdDoc.getDevelopmentProposal().getApplicantOrganization() != null) {
rrBudget.setDUNSID(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getDunsNumber());
rrBudget.setOrganizationName(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getOrganizationName());
}
rrBudget.setBudgetType(BudgetTypeDataType.PROJECT);
// Set default values for mandatory fields
rrBudget.setBudgetYear1(BudgetYear1DataType.Factory.newInstance());
List<BudgetPeriodDto> budgetperiodList;
BudgetSummaryDto budgetSummary = null;
try {
validateBudgetForForm(pdDoc);
budgetperiodList = s2sBudgetCalculatorService
.getBudgetPeriods(pdDoc);
budgetSummary = s2sBudgetCalculatorService.getBudgetInfo(pdDoc,budgetperiodList);
} catch (S2SException e) {
LOG.error(e.getMessage(), e);
return rrBudgetDocument;
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetYear1DataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P2.getNum()) {
rrBudget
.setBudgetYear2(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P3.getNum()) {
rrBudget
.setBudgetYear3(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P4.getNum()) {
rrBudget
.setBudgetYear4(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P5.getNum()) {
rrBudget
.setBudgetYear5(getBudgetYearDataType(budgetPeriodData));
}
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetJustificationAttachment(rrBudget.getBudgetYear1()));
}
}
rrBudget.setBudgetSummary(getBudgetSummary(budgetSummary));
rrBudgetDocument.setRRBudget(rrBudget);
return rrBudgetDocument;
} | java | private RRBudgetDocument getRRBudget() {
deleteAutoGenNarratives();
RRBudgetDocument rrBudgetDocument = RRBudgetDocument.Factory
.newInstance();
RRBudget rrBudget = RRBudget.Factory.newInstance();
rrBudget.setFormVersion(FormVersion.v1_1.getVersion());
if (pdDoc.getDevelopmentProposal().getApplicantOrganization() != null) {
rrBudget.setDUNSID(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getDunsNumber());
rrBudget.setOrganizationName(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getOrganizationName());
}
rrBudget.setBudgetType(BudgetTypeDataType.PROJECT);
// Set default values for mandatory fields
rrBudget.setBudgetYear1(BudgetYear1DataType.Factory.newInstance());
List<BudgetPeriodDto> budgetperiodList;
BudgetSummaryDto budgetSummary = null;
try {
validateBudgetForForm(pdDoc);
budgetperiodList = s2sBudgetCalculatorService
.getBudgetPeriods(pdDoc);
budgetSummary = s2sBudgetCalculatorService.getBudgetInfo(pdDoc,budgetperiodList);
} catch (S2SException e) {
LOG.error(e.getMessage(), e);
return rrBudgetDocument;
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetYear1DataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P2.getNum()) {
rrBudget
.setBudgetYear2(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P3.getNum()) {
rrBudget
.setBudgetYear3(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P4.getNum()) {
rrBudget
.setBudgetYear4(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P5.getNum()) {
rrBudget
.setBudgetYear5(getBudgetYearDataType(budgetPeriodData));
}
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetJustificationAttachment(rrBudget.getBudgetYear1()));
}
}
rrBudget.setBudgetSummary(getBudgetSummary(budgetSummary));
rrBudgetDocument.setRRBudget(rrBudget);
return rrBudgetDocument;
} | [
"private",
"RRBudgetDocument",
"getRRBudget",
"(",
")",
"{",
"deleteAutoGenNarratives",
"(",
")",
";",
"RRBudgetDocument",
"rrBudgetDocument",
"=",
"RRBudgetDocument",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"RRBudget",
"rrBudget",
"=",
"RRBudget",
".",
... | This method returns RRBudgetDocument object based on proposal development
document which contains the informations such as
DUNSID,OrganizationName,BudgetType,BudgetYear and BudgetSummary.
@return rrBudgetDocument {@link XmlObject} of type RRBudgetDocument. | [
"This",
"method",
"returns",
"RRBudgetDocument",
"object",
"based",
"on",
"proposal",
"development",
"document",
"which",
"contains",
"the",
"informations",
"such",
"as",
"DUNSID",
"OrganizationName",
"BudgetType",
"BudgetYear",
"and",
"BudgetSummary",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java#L99-L157 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java | RRBudgetV1_1Generator.getBudgetYear1DataType | private BudgetYear1DataType getBudgetYear1DataType(
BudgetPeriodDto periodInfo) {
BudgetYear1DataType budgetYear = BudgetYear1DataType.Factory
.newInstance();
if (periodInfo != null) {
budgetYear.setBudgetPeriodStartDate(s2SDateTimeService
.convertDateToCalendar(periodInfo.getStartDate()));
budgetYear.setBudgetPeriodEndDate(s2SDateTimeService
.convertDateToCalendar(periodInfo.getEndDate()));
BudgetPeriod.Enum budgetPeriod = BudgetPeriod.Enum
.forInt(periodInfo.getBudgetPeriod());
budgetYear.setBudgetPeriod(budgetPeriod);
budgetYear.setKeyPersons(getKeyPersons(periodInfo));
budgetYear.setOtherPersonnel(getOtherPersonnel(periodInfo));
if (periodInfo.getTotalCompensation() != null) {
budgetYear.setTotalCompensation(periodInfo
.getTotalCompensation().bigDecimalValue());
}
budgetYear.setEquipment(getEquipment(periodInfo));
budgetYear.setTravel(getTravel(periodInfo));
budgetYear
.setParticipantTraineeSupportCosts(getParticipantTraineeSupportCosts(periodInfo));
budgetYear.setOtherDirectCosts(getOtherDirectCosts(periodInfo));
budgetYear.setDirectCosts(periodInfo.getDirectCostsTotal()
.bigDecimalValue());
IndirectCosts indirectCosts = getIndirectCosts(periodInfo);
if (indirectCosts != null) {
budgetYear.setIndirectCosts(indirectCosts);
budgetYear.setTotalCosts(periodInfo.getDirectCostsTotal().bigDecimalValue().add(indirectCosts.getTotalIndirectCosts()));
}else{
budgetYear.setTotalCosts(periodInfo.getDirectCostsTotal().bigDecimalValue());
}
budgetYear.setCognizantFederalAgency(periodInfo
.getCognizantFedAgency());
}
return budgetYear;
} | java | private BudgetYear1DataType getBudgetYear1DataType(
BudgetPeriodDto periodInfo) {
BudgetYear1DataType budgetYear = BudgetYear1DataType.Factory
.newInstance();
if (periodInfo != null) {
budgetYear.setBudgetPeriodStartDate(s2SDateTimeService
.convertDateToCalendar(periodInfo.getStartDate()));
budgetYear.setBudgetPeriodEndDate(s2SDateTimeService
.convertDateToCalendar(periodInfo.getEndDate()));
BudgetPeriod.Enum budgetPeriod = BudgetPeriod.Enum
.forInt(periodInfo.getBudgetPeriod());
budgetYear.setBudgetPeriod(budgetPeriod);
budgetYear.setKeyPersons(getKeyPersons(periodInfo));
budgetYear.setOtherPersonnel(getOtherPersonnel(periodInfo));
if (periodInfo.getTotalCompensation() != null) {
budgetYear.setTotalCompensation(periodInfo
.getTotalCompensation().bigDecimalValue());
}
budgetYear.setEquipment(getEquipment(periodInfo));
budgetYear.setTravel(getTravel(periodInfo));
budgetYear
.setParticipantTraineeSupportCosts(getParticipantTraineeSupportCosts(periodInfo));
budgetYear.setOtherDirectCosts(getOtherDirectCosts(periodInfo));
budgetYear.setDirectCosts(periodInfo.getDirectCostsTotal()
.bigDecimalValue());
IndirectCosts indirectCosts = getIndirectCosts(periodInfo);
if (indirectCosts != null) {
budgetYear.setIndirectCosts(indirectCosts);
budgetYear.setTotalCosts(periodInfo.getDirectCostsTotal().bigDecimalValue().add(indirectCosts.getTotalIndirectCosts()));
}else{
budgetYear.setTotalCosts(periodInfo.getDirectCostsTotal().bigDecimalValue());
}
budgetYear.setCognizantFederalAgency(periodInfo
.getCognizantFedAgency());
}
return budgetYear;
} | [
"private",
"BudgetYear1DataType",
"getBudgetYear1DataType",
"(",
"BudgetPeriodDto",
"periodInfo",
")",
"{",
"BudgetYear1DataType",
"budgetYear",
"=",
"BudgetYear1DataType",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"if",
"(",
"periodInfo",
"!=",
"null",
")",
... | This method gets BudgetYear1DataType details like
BudgetPeriodStartDate,BudgetPeriodEndDate,BudgetPeriod
KeyPersons,OtherPersonnel,TotalCompensation,Equipment,ParticipantTraineeSupportCosts,Travel,OtherDirectCosts
DirectCosts,IndirectCosts,CognizantFederalAgency,TotalCosts
@param periodInfo
(BudgetPeriodInfo) budget summary entry.
@return BudgetYear1DataType corresponding to the BudgetSummaryInfo
object. | [
"This",
"method",
"gets",
"BudgetYear1DataType",
"details",
"like",
"BudgetPeriodStartDate",
"BudgetPeriodEndDate",
"BudgetPeriod",
"KeyPersons",
"OtherPersonnel",
"TotalCompensation",
"Equipment",
"ParticipantTraineeSupportCosts",
"Travel",
"OtherDirectCosts",
"DirectCosts",
"Indi... | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java#L170-L207 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java | RRBudgetV1_1Generator.getCumulativeEquipments | private CumulativeEquipments getCumulativeEquipments(
BudgetSummaryDto budgetSummaryData) {
CumulativeEquipments cumulativeEquipments = CumulativeEquipments.Factory
.newInstance();
if (budgetSummaryData != null
&& budgetSummaryData.getCumEquipmentFunds() != null) {
cumulativeEquipments
.setCumulativeTotalFundsRequestedEquipment(budgetSummaryData
.getCumEquipmentFunds().bigDecimalValue());
}
return cumulativeEquipments;
} | java | private CumulativeEquipments getCumulativeEquipments(
BudgetSummaryDto budgetSummaryData) {
CumulativeEquipments cumulativeEquipments = CumulativeEquipments.Factory
.newInstance();
if (budgetSummaryData != null
&& budgetSummaryData.getCumEquipmentFunds() != null) {
cumulativeEquipments
.setCumulativeTotalFundsRequestedEquipment(budgetSummaryData
.getCumEquipmentFunds().bigDecimalValue());
}
return cumulativeEquipments;
} | [
"private",
"CumulativeEquipments",
"getCumulativeEquipments",
"(",
"BudgetSummaryDto",
"budgetSummaryData",
")",
"{",
"CumulativeEquipments",
"cumulativeEquipments",
"=",
"CumulativeEquipments",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"if",
"(",
"budgetSummaryDat... | This method gets CumulativeEquipments information
CumulativeTotalFundsRequestedEquipment based on BudgetSummaryInfo for the
form RRBudget.
@param budgetSummaryData
(BudgetSummaryInfo) budget summary entry.
@return CumulativeEquipments details corresponding to the
BudgetSummaryInfo object. | [
"This",
"method",
"gets",
"CumulativeEquipments",
"information",
"CumulativeTotalFundsRequestedEquipment",
"based",
"on",
"BudgetSummaryInfo",
"for",
"the",
"form",
"RRBudget",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java#L357-L369 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java | RRBudgetV1_1Generator.getCumulativeOtherDirect | private CumulativeOtherDirect getCumulativeOtherDirect(
BudgetSummaryDto budgetSummaryData) {
CumulativeOtherDirect cumulativeOtherDirect = CumulativeOtherDirect.Factory
.newInstance();
cumulativeOtherDirect
.setCumulativeTotalFundsRequestedOtherDirectCosts(BigDecimal.ZERO);
if (budgetSummaryData != null
&& budgetSummaryData.getOtherDirectCosts() != null) {
for (OtherDirectCostInfoDto cumOtherDirect : budgetSummaryData
.getOtherDirectCosts()) {
cumulativeOtherDirect
.setCumulativeTotalFundsRequestedOtherDirectCosts(cumOtherDirect
.gettotalOtherDirect().bigDecimalValue());
if (cumOtherDirect.getmaterials() != null) {
cumulativeOtherDirect
.setCumulativeMaterialAndSupplies(cumOtherDirect
.getmaterials().bigDecimalValue());
}
if (cumOtherDirect.getpublications() != null) {
cumulativeOtherDirect
.setCumulativePublicationCosts(cumOtherDirect
.getpublications().bigDecimalValue());
}
if (cumOtherDirect.getConsultants() != null) {
cumulativeOtherDirect
.setCumulativeConsultantServices(cumOtherDirect
.getConsultants().bigDecimalValue());
}
if (cumOtherDirect.getcomputer() != null) {
cumulativeOtherDirect
.setCumulativeADPComputerServices(cumOtherDirect
.getcomputer().bigDecimalValue());
}
if (cumOtherDirect.getsubAwards() != null) {
cumulativeOtherDirect
.setCumulativeSubawardConsortiumContractualCosts(cumOtherDirect
.getsubAwards().bigDecimalValue());
}
if (cumOtherDirect.getEquipRental() != null) {
cumulativeOtherDirect
.setCumulativeEquipmentFacilityRentalFees(cumOtherDirect
.getEquipRental().bigDecimalValue());
}
if (cumOtherDirect.getAlterations() != null) {
cumulativeOtherDirect
.setCumulativeAlterationsAndRenovations(cumOtherDirect
.getAlterations().bigDecimalValue());
}
if (cumOtherDirect.getOtherCosts().size() > 0) {
cumulativeOtherDirect
.setCumulativeOther1DirectCost(new BigDecimal(
cumOtherDirect.getOtherCosts().get(0).get(
CostConstants.KEY_COST)));
}
}
}
return cumulativeOtherDirect;
} | java | private CumulativeOtherDirect getCumulativeOtherDirect(
BudgetSummaryDto budgetSummaryData) {
CumulativeOtherDirect cumulativeOtherDirect = CumulativeOtherDirect.Factory
.newInstance();
cumulativeOtherDirect
.setCumulativeTotalFundsRequestedOtherDirectCosts(BigDecimal.ZERO);
if (budgetSummaryData != null
&& budgetSummaryData.getOtherDirectCosts() != null) {
for (OtherDirectCostInfoDto cumOtherDirect : budgetSummaryData
.getOtherDirectCosts()) {
cumulativeOtherDirect
.setCumulativeTotalFundsRequestedOtherDirectCosts(cumOtherDirect
.gettotalOtherDirect().bigDecimalValue());
if (cumOtherDirect.getmaterials() != null) {
cumulativeOtherDirect
.setCumulativeMaterialAndSupplies(cumOtherDirect
.getmaterials().bigDecimalValue());
}
if (cumOtherDirect.getpublications() != null) {
cumulativeOtherDirect
.setCumulativePublicationCosts(cumOtherDirect
.getpublications().bigDecimalValue());
}
if (cumOtherDirect.getConsultants() != null) {
cumulativeOtherDirect
.setCumulativeConsultantServices(cumOtherDirect
.getConsultants().bigDecimalValue());
}
if (cumOtherDirect.getcomputer() != null) {
cumulativeOtherDirect
.setCumulativeADPComputerServices(cumOtherDirect
.getcomputer().bigDecimalValue());
}
if (cumOtherDirect.getsubAwards() != null) {
cumulativeOtherDirect
.setCumulativeSubawardConsortiumContractualCosts(cumOtherDirect
.getsubAwards().bigDecimalValue());
}
if (cumOtherDirect.getEquipRental() != null) {
cumulativeOtherDirect
.setCumulativeEquipmentFacilityRentalFees(cumOtherDirect
.getEquipRental().bigDecimalValue());
}
if (cumOtherDirect.getAlterations() != null) {
cumulativeOtherDirect
.setCumulativeAlterationsAndRenovations(cumOtherDirect
.getAlterations().bigDecimalValue());
}
if (cumOtherDirect.getOtherCosts().size() > 0) {
cumulativeOtherDirect
.setCumulativeOther1DirectCost(new BigDecimal(
cumOtherDirect.getOtherCosts().get(0).get(
CostConstants.KEY_COST)));
}
}
}
return cumulativeOtherDirect;
} | [
"private",
"CumulativeOtherDirect",
"getCumulativeOtherDirect",
"(",
"BudgetSummaryDto",
"budgetSummaryData",
")",
"{",
"CumulativeOtherDirect",
"cumulativeOtherDirect",
"=",
"CumulativeOtherDirect",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"cumulativeOtherDirect",
... | This method gets CumulativeOtherDirectCost
details,CumulativeMaterialAndSupplies,CumulativePublicationCosts,
CumulativeConsultantServices,CumulativeADPComputerServices,CumulativeSubawardConsortiumContractualCosts
CumulativeEquipmentFacilityRentalFees,CumulativeAlterationsAndRenovations
and CumulativeOther1DirectCost based on BudgetSummaryInfo for the
RRBudget.
@param budgetSummaryData
(BudgetSummaryInfo) budget summary entry.
@return CumulativeOtherDirect details corresponding to the
BudgetSummaryInfo object. | [
"This",
"method",
"gets",
"CumulativeOtherDirectCost",
"details",
"CumulativeMaterialAndSupplies",
"CumulativePublicationCosts",
"CumulativeConsultantServices",
"CumulativeADPComputerServices",
"CumulativeSubawardConsortiumContractualCosts",
"CumulativeEquipmentFacilityRentalFees",
"Cumulative... | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java#L467-L524 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java | RRBudgetV1_1Generator.getOtherDirectCosts | private OtherDirectCosts getOtherDirectCosts(BudgetPeriodDto periodInfo) {
OtherDirectCosts otherDirectCosts = OtherDirectCosts.Factory
.newInstance();
if (periodInfo != null && periodInfo.getOtherDirectCosts().size() > 0) {
if (periodInfo.getOtherDirectCosts().get(0).getpublications() != null) {
otherDirectCosts.setPublicationCosts(periodInfo
.getOtherDirectCosts().get(0).getpublications()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getmaterials() != null) {
otherDirectCosts.setMaterialsSupplies(periodInfo
.getOtherDirectCosts().get(0).getmaterials()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getConsultants() != null) {
otherDirectCosts.setConsultantServices(periodInfo
.getOtherDirectCosts().get(0).getConsultants()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getcomputer() != null) {
otherDirectCosts.setADPComputerServices(periodInfo
.getOtherDirectCosts().get(0).getcomputer()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getsubAwards() != null) {
otherDirectCosts
.setSubawardConsortiumContractualCosts(periodInfo
.getOtherDirectCosts().get(0).getsubAwards()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getAlterations() != null) {
otherDirectCosts.setAlterationsRenovations(periodInfo
.getOtherDirectCosts().get(0).getAlterations()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getEquipRental() != null) {
otherDirectCosts.setEquipmentRentalFee(periodInfo
.getOtherDirectCosts().get(0).getEquipRental()
.bigDecimalValue());
}
otherDirectCosts
.setOthers(getOthersForOtherDirectCosts(periodInfo));
if (periodInfo.getOtherDirectCosts().get(0).gettotalOtherDirect() != null) {
otherDirectCosts.setTotalOtherDirectCost(periodInfo
.getOtherDirectCosts().get(0).gettotalOtherDirect()
.bigDecimalValue());
}
}
return otherDirectCosts;
} | java | private OtherDirectCosts getOtherDirectCosts(BudgetPeriodDto periodInfo) {
OtherDirectCosts otherDirectCosts = OtherDirectCosts.Factory
.newInstance();
if (periodInfo != null && periodInfo.getOtherDirectCosts().size() > 0) {
if (periodInfo.getOtherDirectCosts().get(0).getpublications() != null) {
otherDirectCosts.setPublicationCosts(periodInfo
.getOtherDirectCosts().get(0).getpublications()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getmaterials() != null) {
otherDirectCosts.setMaterialsSupplies(periodInfo
.getOtherDirectCosts().get(0).getmaterials()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getConsultants() != null) {
otherDirectCosts.setConsultantServices(periodInfo
.getOtherDirectCosts().get(0).getConsultants()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getcomputer() != null) {
otherDirectCosts.setADPComputerServices(periodInfo
.getOtherDirectCosts().get(0).getcomputer()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getsubAwards() != null) {
otherDirectCosts
.setSubawardConsortiumContractualCosts(periodInfo
.getOtherDirectCosts().get(0).getsubAwards()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getAlterations() != null) {
otherDirectCosts.setAlterationsRenovations(periodInfo
.getOtherDirectCosts().get(0).getAlterations()
.bigDecimalValue());
}
if (periodInfo.getOtherDirectCosts().get(0).getEquipRental() != null) {
otherDirectCosts.setEquipmentRentalFee(periodInfo
.getOtherDirectCosts().get(0).getEquipRental()
.bigDecimalValue());
}
otherDirectCosts
.setOthers(getOthersForOtherDirectCosts(periodInfo));
if (periodInfo.getOtherDirectCosts().get(0).gettotalOtherDirect() != null) {
otherDirectCosts.setTotalOtherDirectCost(periodInfo
.getOtherDirectCosts().get(0).gettotalOtherDirect()
.bigDecimalValue());
}
}
return otherDirectCosts;
} | [
"private",
"OtherDirectCosts",
"getOtherDirectCosts",
"(",
"BudgetPeriodDto",
"periodInfo",
")",
"{",
"OtherDirectCosts",
"otherDirectCosts",
"=",
"OtherDirectCosts",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"if",
"(",
"periodInfo",
"!=",
"null",
"&&",
"pe... | This method gets OtherDirectCosts details such as
PublicationCosts,MaterialsSupplies,ConsultantServices,
ADPComputerServices,SubawardConsortiumContractualCosts,EquipmentRentalFee,AlterationsRenovations
and TotalOtherDirectCost in BudgetYearDataType based on BudgetPeriodInfo
for the RRBudget.
@param periodInfo
(BudgetPeriodInfo) budget period entry.
@return OtherDirectCosts corresponding to the BudgetPeriodInfo object. | [
"This",
"method",
"gets",
"OtherDirectCosts",
"details",
"such",
"as",
"PublicationCosts",
"MaterialsSupplies",
"ConsultantServices",
"ADPComputerServices",
"SubawardConsortiumContractualCosts",
"EquipmentRentalFee",
"AlterationsRenovations",
"and",
"TotalOtherDirectCost",
"in",
"B... | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java#L605-L655 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java | RRBudgetV1_1Generator.getOthersForOtherDirectCosts | private Others getOthersForOtherDirectCosts(BudgetPeriodDto periodInfo) {
Others others = Others.Factory.newInstance();
if (periodInfo != null && periodInfo.getOtherDirectCosts() != null) {
Others.Other otherArray[] = new Others.Other[periodInfo
.getOtherDirectCosts().size()];
int Otherscount = 0;
for (OtherDirectCostInfoDto otherDirectCostInfo : periodInfo
.getOtherDirectCosts()) {
Others.Other other = Others.Other.Factory.newInstance();
if (otherDirectCostInfo.getOtherCosts() != null
&& otherDirectCostInfo.getOtherCosts().size() > 0) {
other
.setCost(new BigDecimal(otherDirectCostInfo
.getOtherCosts().get(0).get(
CostConstants.KEY_COST)));
}
other.setDescription(OTHERCOST_DESCRIPTION);
otherArray[Otherscount] = other;
Otherscount++;
}
others.setOtherArray(otherArray);
}
return others;
} | java | private Others getOthersForOtherDirectCosts(BudgetPeriodDto periodInfo) {
Others others = Others.Factory.newInstance();
if (periodInfo != null && periodInfo.getOtherDirectCosts() != null) {
Others.Other otherArray[] = new Others.Other[periodInfo
.getOtherDirectCosts().size()];
int Otherscount = 0;
for (OtherDirectCostInfoDto otherDirectCostInfo : periodInfo
.getOtherDirectCosts()) {
Others.Other other = Others.Other.Factory.newInstance();
if (otherDirectCostInfo.getOtherCosts() != null
&& otherDirectCostInfo.getOtherCosts().size() > 0) {
other
.setCost(new BigDecimal(otherDirectCostInfo
.getOtherCosts().get(0).get(
CostConstants.KEY_COST)));
}
other.setDescription(OTHERCOST_DESCRIPTION);
otherArray[Otherscount] = other;
Otherscount++;
}
others.setOtherArray(otherArray);
}
return others;
} | [
"private",
"Others",
"getOthersForOtherDirectCosts",
"(",
"BudgetPeriodDto",
"periodInfo",
")",
"{",
"Others",
"others",
"=",
"Others",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"if",
"(",
"periodInfo",
"!=",
"null",
"&&",
"periodInfo",
".",
"getOtherDi... | This method is to get Other type description and total cost
OtherDirectCosts details in BudgetYearDataType based on BudgetPeriodInfo
for the RRBudget.
@param periodInfo
(BudgetPeriodInfo) budget period entry.
@return Other others for other direct costs corresponding to the
BudgetPeriodInfo object. | [
"This",
"method",
"is",
"to",
"get",
"Other",
"type",
"description",
"and",
"total",
"cost",
"OtherDirectCosts",
"details",
"in",
"BudgetYearDataType",
"based",
"on",
"BudgetPeriodInfo",
"for",
"the",
"RRBudget",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_1Generator.java#L726-L750 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java | EventUtil.status | public static void status(String statusText) {
try {
getEventManager().fireLocalEvent(STATUS_EVENT, statusText == null ? "" : statusText);
} catch (Throwable e) {
log.error(e);
}
} | java | public static void status(String statusText) {
try {
getEventManager().fireLocalEvent(STATUS_EVENT, statusText == null ? "" : statusText);
} catch (Throwable e) {
log.error(e);
}
} | [
"public",
"static",
"void",
"status",
"(",
"String",
"statusText",
")",
"{",
"try",
"{",
"getEventManager",
"(",
")",
".",
"fireLocalEvent",
"(",
"STATUS_EVENT",
",",
"statusText",
"==",
"null",
"?",
"\"\"",
":",
"statusText",
")",
";",
"}",
"catch",
"(",
... | Fires a generic event of type STATUS to update any object that subscribes to it.
@param statusText Text associated with the status change. | [
"Fires",
"a",
"generic",
"event",
"of",
"type",
"STATUS",
"to",
"update",
"any",
"object",
"that",
"subscribes",
"to",
"it",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java#L67-L73 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java | EventUtil.ping | public static void ping(String responseEvent, List<PingFilter> filters, Recipient... recipients) {
IEventManager eventManager = getEventManager();
IGlobalEventDispatcher ged = ((ILocalEventDispatcher) eventManager).getGlobalEventDispatcher();
if (ged != null) {
ged.Ping(responseEvent, filters, recipients);
}
} | java | public static void ping(String responseEvent, List<PingFilter> filters, Recipient... recipients) {
IEventManager eventManager = getEventManager();
IGlobalEventDispatcher ged = ((ILocalEventDispatcher) eventManager).getGlobalEventDispatcher();
if (ged != null) {
ged.Ping(responseEvent, filters, recipients);
}
} | [
"public",
"static",
"void",
"ping",
"(",
"String",
"responseEvent",
",",
"List",
"<",
"PingFilter",
">",
"filters",
",",
"Recipient",
"...",
"recipients",
")",
"{",
"IEventManager",
"eventManager",
"=",
"getEventManager",
"(",
")",
";",
"IGlobalEventDispatcher",
... | Fires a ping request to specified or all recipients.
@param responseEvent Event to use for response.
@param filters Response filters (null for none).
@param recipients The list of ping recipients (or none for all recipients). | [
"Fires",
"a",
"ping",
"request",
"to",
"specified",
"or",
"all",
"recipients",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java#L82-L89 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java | EventUtil.getChannelName | public static String getChannelName(String eventName) {
return eventName == null ? null : EVENT_PREFIX + eventName.split("\\.", 2)[0];
} | java | public static String getChannelName(String eventName) {
return eventName == null ? null : EVENT_PREFIX + eventName.split("\\.", 2)[0];
} | [
"public",
"static",
"String",
"getChannelName",
"(",
"String",
"eventName",
")",
"{",
"return",
"eventName",
"==",
"null",
"?",
"null",
":",
"EVENT_PREFIX",
"+",
"eventName",
".",
"split",
"(",
"\"\\\\.\"",
",",
"2",
")",
"[",
"0",
"]",
";",
"}"
] | Returns the messaging channel name from the event name.
@param eventName The event name.
@return The channel name. | [
"Returns",
"the",
"messaging",
"channel",
"name",
"from",
"the",
"event",
"name",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java#L97-L99 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java | EventUtil.getEventName | public static String getEventName(String channelName) {
int i = channelName.indexOf(EVENT_PREFIX);
return i < 0 ? channelName : channelName.substring(i + EVENT_PREFIX.length());
} | java | public static String getEventName(String channelName) {
int i = channelName.indexOf(EVENT_PREFIX);
return i < 0 ? channelName : channelName.substring(i + EVENT_PREFIX.length());
} | [
"public",
"static",
"String",
"getEventName",
"(",
"String",
"channelName",
")",
"{",
"int",
"i",
"=",
"channelName",
".",
"indexOf",
"(",
"EVENT_PREFIX",
")",
";",
"return",
"i",
"<",
"0",
"?",
"channelName",
":",
"channelName",
".",
"substring",
"(",
"i"... | Returns the event name from the channel name.
@param channelName The channel name.
@return The event name. | [
"Returns",
"the",
"event",
"name",
"from",
"the",
"channel",
"name",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventUtil.java#L107-L110 | train |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.mockup/src/main/java/org/carewebframework/plugin/mockup/MainController.java | MainController.refresh | @Override
public void refresh() {
String url = mockupTypes.getUrl(mockupType);
if (mockupId == null || url == null) {
iframe.setSrc(null);
return;
}
iframe.setSrc(String.format(url, mockupId, System.currentTimeMillis()));
} | java | @Override
public void refresh() {
String url = mockupTypes.getUrl(mockupType);
if (mockupId == null || url == null) {
iframe.setSrc(null);
return;
}
iframe.setSrc(String.format(url, mockupId, System.currentTimeMillis()));
} | [
"@",
"Override",
"public",
"void",
"refresh",
"(",
")",
"{",
"String",
"url",
"=",
"mockupTypes",
".",
"getUrl",
"(",
"mockupType",
")",
";",
"if",
"(",
"mockupId",
"==",
"null",
"||",
"url",
"==",
"null",
")",
"{",
"iframe",
".",
"setSrc",
"(",
"nul... | Refreshes the iframe content. | [
"Refreshes",
"the",
"iframe",
"content",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.mockup/src/main/java/org/carewebframework/plugin/mockup/MainController.java#L66-L76 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginResourceHelp.java | PluginResourceHelp.getPath | public String getPath() {
if (path == null) {
HelpModule module = HelpModule.getModule(id);
path = module == null ? "" : module.getTitle();
}
return path;
} | java | public String getPath() {
if (path == null) {
HelpModule module = HelpModule.getModule(id);
path = module == null ? "" : module.getTitle();
}
return path;
} | [
"public",
"String",
"getPath",
"(",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"HelpModule",
"module",
"=",
"HelpModule",
".",
"getModule",
"(",
"id",
")",
";",
"path",
"=",
"module",
"==",
"null",
"?",
"\"\"",
":",
"module",
".",
"getTitle... | Returns the path that determines where the associated menu item will appear under the help
submenu. If this value has not been explicitly set, and a help module has been specified, its
value will be determined from the help module.
@return The path that determines where the associated menu item will appear under the help
submenu. A menu hierarchy can be specified by separating levels with backslash
characters. | [
"Returns",
"the",
"path",
"that",
"determines",
"where",
"the",
"associated",
"menu",
"item",
"will",
"appear",
"under",
"the",
"help",
"submenu",
".",
"If",
"this",
"value",
"has",
"not",
"been",
"explicitly",
"set",
"and",
"a",
"help",
"module",
"has",
"... | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginResourceHelp.java#L71-L78 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginResourceHelp.java | PluginResourceHelp.getAction | public String getAction() {
if (action == null) {
HelpModule module = HelpModule.getModule(id);
action = module == null ? ""
: "groovy:" + CareWebUtil.class.getName() + ".showHelpTopic(\"" + id + "\",\""
+ (topic == null ? "" : topic) + "\",\"" + module.getTitle() + "\");";
}
return action;
} | java | public String getAction() {
if (action == null) {
HelpModule module = HelpModule.getModule(id);
action = module == null ? ""
: "groovy:" + CareWebUtil.class.getName() + ".showHelpTopic(\"" + id + "\",\""
+ (topic == null ? "" : topic) + "\",\"" + module.getTitle() + "\");";
}
return action;
} | [
"public",
"String",
"getAction",
"(",
")",
"{",
"if",
"(",
"action",
"==",
"null",
")",
"{",
"HelpModule",
"module",
"=",
"HelpModule",
".",
"getModule",
"(",
"id",
")",
";",
"action",
"=",
"module",
"==",
"null",
"?",
"\"\"",
":",
"\"groovy:\"",
"+",
... | Returns the action that will be invoked when the associated menu item is clicked. For
externally derived help content, this value must be explicitly set. Otherwise, it will be
determined automatically from the specified help module.
@return The action to be invoked to display the help content. This may be a url or a groovy
script action. | [
"Returns",
"the",
"action",
"that",
"will",
"be",
"invoked",
"when",
"the",
"associated",
"menu",
"item",
"is",
"clicked",
".",
"For",
"externally",
"derived",
"help",
"content",
"this",
"value",
"must",
"be",
"explicitly",
"set",
".",
"Otherwise",
"it",
"wi... | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginResourceHelp.java#L100-L109 | train |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java | AppContextFinder.createAppContext | public static ApplicationContext createAppContext(Page page) {
XmlWebApplicationContext appContext = new FrameworkAppContext();
new AppContextInitializer(page).initialize(appContext);
appContext.refresh();
return appContext;
} | java | public static ApplicationContext createAppContext(Page page) {
XmlWebApplicationContext appContext = new FrameworkAppContext();
new AppContextInitializer(page).initialize(appContext);
appContext.refresh();
return appContext;
} | [
"public",
"static",
"ApplicationContext",
"createAppContext",
"(",
"Page",
"page",
")",
"{",
"XmlWebApplicationContext",
"appContext",
"=",
"new",
"FrameworkAppContext",
"(",
")",
";",
"new",
"AppContextInitializer",
"(",
"page",
")",
".",
"initialize",
"(",
"appCon... | Creates an application context as a child of the root application context and associates it
with the specified page. In this way, any objects managed by the root application context are
available to the framework context.
@param page Page for which application context is being created.
@return New application context | [
"Creates",
"an",
"application",
"context",
"as",
"a",
"child",
"of",
"the",
"root",
"application",
"context",
"and",
"associates",
"it",
"with",
"the",
"specified",
"page",
".",
"In",
"this",
"way",
"any",
"objects",
"managed",
"by",
"the",
"root",
"applicat... | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java#L57-L62 | train |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java | AppContextFinder.destroyAppContext | public static void destroyAppContext(Page page) {
XmlWebApplicationContext appContext = getAppContext(page);
if (appContext != null) {
appContext.close();
}
} | java | public static void destroyAppContext(Page page) {
XmlWebApplicationContext appContext = getAppContext(page);
if (appContext != null) {
appContext.close();
}
} | [
"public",
"static",
"void",
"destroyAppContext",
"(",
"Page",
"page",
")",
"{",
"XmlWebApplicationContext",
"appContext",
"=",
"getAppContext",
"(",
"page",
")",
";",
"if",
"(",
"appContext",
"!=",
"null",
")",
"{",
"appContext",
".",
"close",
"(",
")",
";",... | Destroys the application context associated with the specified page.
@param page Page instance | [
"Destroys",
"the",
"application",
"context",
"associated",
"with",
"the",
"specified",
"page",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java#L76-L82 | train |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java | AppContextFinder.getChildAppContext | @Override
public ApplicationContext getChildAppContext() {
ApplicationContext appContext = getAppContext(ExecutionContext.getPage());
return appContext == null ? getRootAppContext() : appContext;
} | java | @Override
public ApplicationContext getChildAppContext() {
ApplicationContext appContext = getAppContext(ExecutionContext.getPage());
return appContext == null ? getRootAppContext() : appContext;
} | [
"@",
"Override",
"public",
"ApplicationContext",
"getChildAppContext",
"(",
")",
"{",
"ApplicationContext",
"appContext",
"=",
"getAppContext",
"(",
"ExecutionContext",
".",
"getPage",
"(",
")",
")",
";",
"return",
"appContext",
"==",
"null",
"?",
"getRootAppContext... | Returns the application context for the current scope. If no page exists or no application
context is associated with the page, looks for an application context registered to the
current thread. Failing that, returns the root application context.
@see org.carewebframework.api.spring.IAppContextFinder#getChildAppContext()
@return An application context. | [
"Returns",
"the",
"application",
"context",
"for",
"the",
"current",
"scope",
".",
"If",
"no",
"page",
"exists",
"or",
"no",
"application",
"context",
"is",
"associated",
"with",
"the",
"page",
"looks",
"for",
"an",
"application",
"context",
"registered",
"to"... | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java#L92-L96 | train |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java | AppContextFinder.getAppContext | public static XmlWebApplicationContext getAppContext(Page page) {
return page == null ? null : (XmlWebApplicationContext) page.getAttribute(APP_CONTEXT_ATTRIB);
} | java | public static XmlWebApplicationContext getAppContext(Page page) {
return page == null ? null : (XmlWebApplicationContext) page.getAttribute(APP_CONTEXT_ATTRIB);
} | [
"public",
"static",
"XmlWebApplicationContext",
"getAppContext",
"(",
"Page",
"page",
")",
"{",
"return",
"page",
"==",
"null",
"?",
"null",
":",
"(",
"XmlWebApplicationContext",
")",
"page",
".",
"getAttribute",
"(",
"APP_CONTEXT_ATTRIB",
")",
";",
"}"
] | Returns the application context associated with the given page.
@param page Page instance.
@return Application context associated with the page. | [
"Returns",
"the",
"application",
"context",
"associated",
"with",
"the",
"given",
"page",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/spring/AppContextFinder.java#L104-L106 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.firstUpper | private String firstUpper(String value) {
return value == null ? null : value.substring(0, 1).toUpperCase() + value.substring(1);
} | java | private String firstUpper(String value) {
return value == null ? null : value.substring(0, 1).toUpperCase() + value.substring(1);
} | [
"private",
"String",
"firstUpper",
"(",
"String",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"null",
":",
"value",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")",
"+",
"value",
".",
"substring",
"(",
"1",
")",
... | Convert first character of a string to upper case.
@param value String to convert
@return Converted string | [
"Convert",
"first",
"character",
"of",
"a",
"string",
"to",
"upper",
"case",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L166-L168 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getPropertyValue | public Object getPropertyValue(Object instance, boolean forceDirect) {
try {
if (instance == null) {
return dflt == null || !isSerializable() ? null : getPropertyType().getSerializer().deserialize(dflt);
}
if (!forceDirect && instance instanceof IPropertyAccessor) {
return ((IPropertyAccessor) instance).getPropertyValue(this);
}
Method method = PropertyUtil.findGetter(getter, instance, null);
return method == null ? null : method.invoke(instance);
} catch (Exception e) {
throw MiscUtil.toUnchecked(e);
}
} | java | public Object getPropertyValue(Object instance, boolean forceDirect) {
try {
if (instance == null) {
return dflt == null || !isSerializable() ? null : getPropertyType().getSerializer().deserialize(dflt);
}
if (!forceDirect && instance instanceof IPropertyAccessor) {
return ((IPropertyAccessor) instance).getPropertyValue(this);
}
Method method = PropertyUtil.findGetter(getter, instance, null);
return method == null ? null : method.invoke(instance);
} catch (Exception e) {
throw MiscUtil.toUnchecked(e);
}
} | [
"public",
"Object",
"getPropertyValue",
"(",
"Object",
"instance",
",",
"boolean",
"forceDirect",
")",
"{",
"try",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
"dflt",
"==",
"null",
"||",
"!",
"isSerializable",
"(",
")",
"?",
"null",
":"... | Returns the property value for a specified object instance.
@param instance The object instance.
@param forceDirect If true, a forces a direct read on the instance even if it implements
IPropertyAccessor
@return The object's property value. | [
"Returns",
"the",
"property",
"value",
"for",
"a",
"specified",
"object",
"instance",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L188-L203 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.setPropertyValue | public void setPropertyValue(Object instance, Object value, boolean forceDirect) {
try {
if (!forceDirect && instance instanceof IPropertyAccessor) {
((IPropertyAccessor) instance).setPropertyValue(this, value);
return;
}
Method method = null;
try {
method = PropertyUtil.findSetter(setter, instance, value == null ? null : value.getClass());
} catch (Exception e) {
if (value != null) {
PropertySerializer<?> serializer = getPropertyType().getSerializer();
value = value instanceof String ? serializer.deserialize((String) value) : serializer.serialize(value);
method = PropertyUtil.findSetter(setter, instance, value.getClass());
} else {
throw e;
}
}
if (method != null) {
method.invoke(instance, value);
}
} catch (Exception e) {
throw MiscUtil.toUnchecked(e);
}
} | java | public void setPropertyValue(Object instance, Object value, boolean forceDirect) {
try {
if (!forceDirect && instance instanceof IPropertyAccessor) {
((IPropertyAccessor) instance).setPropertyValue(this, value);
return;
}
Method method = null;
try {
method = PropertyUtil.findSetter(setter, instance, value == null ? null : value.getClass());
} catch (Exception e) {
if (value != null) {
PropertySerializer<?> serializer = getPropertyType().getSerializer();
value = value instanceof String ? serializer.deserialize((String) value) : serializer.serialize(value);
method = PropertyUtil.findSetter(setter, instance, value.getClass());
} else {
throw e;
}
}
if (method != null) {
method.invoke(instance, value);
}
} catch (Exception e) {
throw MiscUtil.toUnchecked(e);
}
} | [
"public",
"void",
"setPropertyValue",
"(",
"Object",
"instance",
",",
"Object",
"value",
",",
"boolean",
"forceDirect",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"forceDirect",
"&&",
"instance",
"instanceof",
"IPropertyAccessor",
")",
"{",
"(",
"(",
"IPropertyAcce... | Sets the property value for a specified object instance.
@param instance The object instance.
@param value The value to assign.
@param forceDirect If true, a forces a direct write to the instance even if it implements
IPropertyAccessor | [
"Sets",
"the",
"property",
"value",
"for",
"a",
"specified",
"object",
"instance",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L223-L250 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getConfigValueInt | public Integer getConfigValueInt(String key, Integer dflt) {
try {
return Integer.parseInt(getConfigValue(key));
} catch (Exception e) {
return dflt;
}
} | java | public Integer getConfigValueInt(String key, Integer dflt) {
try {
return Integer.parseInt(getConfigValue(key));
} catch (Exception e) {
return dflt;
}
} | [
"public",
"Integer",
"getConfigValueInt",
"(",
"String",
"key",
",",
"Integer",
"dflt",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"getConfigValue",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",... | This is a convenience method for returning a named configuration value that is expected to be
an integer.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as an integer or default value if not found or not a valid
integer. | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"returning",
"a",
"named",
"configuration",
"value",
"that",
"is",
"expected",
"to",
"be",
"an",
"integer",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L309-L315 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getConfigValueDouble | public Double getConfigValueDouble(String key, Double dflt) {
try {
return Double.parseDouble(getConfigValue(key));
} catch (Exception e) {
return dflt;
}
} | java | public Double getConfigValueDouble(String key, Double dflt) {
try {
return Double.parseDouble(getConfigValue(key));
} catch (Exception e) {
return dflt;
}
} | [
"public",
"Double",
"getConfigValueDouble",
"(",
"String",
"key",
",",
"Double",
"dflt",
")",
"{",
"try",
"{",
"return",
"Double",
".",
"parseDouble",
"(",
"getConfigValue",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"retur... | This is a convenience method for returning a named configuration value that is expected to be
a double floating point number.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as a double or default value if not found or not a valid double. | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"returning",
"a",
"named",
"configuration",
"value",
"that",
"is",
"expected",
"to",
"be",
"a",
"double",
"floating",
"point",
"number",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L325-L331 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getConfigValueBoolean | public Boolean getConfigValueBoolean(String key, Boolean dflt) {
try {
String value = getConfigValue(key);
return value == null ? dflt : Boolean.parseBoolean(value);
} catch (Exception e) {
return dflt;
}
} | java | public Boolean getConfigValueBoolean(String key, Boolean dflt) {
try {
String value = getConfigValue(key);
return value == null ? dflt : Boolean.parseBoolean(value);
} catch (Exception e) {
return dflt;
}
} | [
"public",
"Boolean",
"getConfigValueBoolean",
"(",
"String",
"key",
",",
"Boolean",
"dflt",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"getConfigValue",
"(",
"key",
")",
";",
"return",
"value",
"==",
"null",
"?",
"dflt",
":",
"Boolean",
".",
"parseBoole... | This is a convenience method for returning a named configuration value that is expected to be
a Boolean value.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as a Boolean or default value if not found or not a valid
Boolean. | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"returning",
"a",
"named",
"configuration",
"value",
"that",
"is",
"expected",
"to",
"be",
"a",
"Boolean",
"value",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L342-L349 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getConfigValueArray | public String[] getConfigValueArray(String key, String delimiter) {
return StringUtils.split(getConfigValue(key), delimiter);
} | java | public String[] getConfigValueArray(String key, String delimiter) {
return StringUtils.split(getConfigValue(key), delimiter);
} | [
"public",
"String",
"[",
"]",
"getConfigValueArray",
"(",
"String",
"key",
",",
"String",
"delimiter",
")",
"{",
"return",
"StringUtils",
".",
"split",
"(",
"getConfigValue",
"(",
"key",
")",
",",
"delimiter",
")",
";",
"}"
] | This is a convenience method for returning a named configuration value that is expected to be
a list of array elements.
@param key The configuration value's key.
@param delimiter The delimiter separating array elements.
@return The array of values. | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"returning",
"a",
"named",
"configuration",
"value",
"that",
"is",
"expected",
"to",
"be",
"a",
"list",
"of",
"array",
"elements",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L370-L372 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/DateQueryFilter.java | DateQueryFilter.include | @Override
public boolean include(T result) {
return getDateRange().inRange(DateUtil.stripTime(dateTypeExtractor.getDateByType(result, dateType)), true, true);
} | java | @Override
public boolean include(T result) {
return getDateRange().inRange(DateUtil.stripTime(dateTypeExtractor.getDateByType(result, dateType)), true, true);
} | [
"@",
"Override",
"public",
"boolean",
"include",
"(",
"T",
"result",
")",
"{",
"return",
"getDateRange",
"(",
")",
".",
"inRange",
"(",
"DateUtil",
".",
"stripTime",
"(",
"dateTypeExtractor",
".",
"getDateByType",
"(",
"result",
",",
"dateType",
")",
")",
... | Filter result based on selected date range. | [
"Filter",
"result",
"based",
"on",
"selected",
"date",
"range",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/DateQueryFilter.java#L62-L65 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.appendResponse | public static void appendResponse(StringBuilder buffer, String response) {
if (response != null && !response.isEmpty()) {
if (buffer.length() > 0) {
buffer.append("\r\n");
}
buffer.append(response);
}
} | java | public static void appendResponse(StringBuilder buffer, String response) {
if (response != null && !response.isEmpty()) {
if (buffer.length() > 0) {
buffer.append("\r\n");
}
buffer.append(response);
}
} | [
"public",
"static",
"void",
"appendResponse",
"(",
"StringBuilder",
"buffer",
",",
"String",
"response",
")",
"{",
"if",
"(",
"response",
"!=",
"null",
"&&",
"!",
"response",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"buffer",
".",
"length",
"(",
... | Accumulate response values in string buffer.
@param buffer StringBuilder to which to append response
@param response Appended to buffer | [
"Accumulate",
"response",
"values",
"in",
"string",
"buffer",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L89-L97 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.ccowJoin | public void ccowJoin() {
if (ccowIsActive()) {
return;
}
if (ccowContextManager == null && ccowEnabled) {
ccowContextManager = new CCOWContextManager();
ccowContextManager.subscribe(this);
ccowContextManager.run("CareWebFramework#", "", true, "*");
}
if (ccowContextManager != null) {
if (!ccowContextManager.isActive()) {
ccowContextManager.resume();
}
init(response -> {
if (response.rejected()) {
ccowContextManager.suspend();
}
updateCCOWStatus();
});
}
} | java | public void ccowJoin() {
if (ccowIsActive()) {
return;
}
if (ccowContextManager == null && ccowEnabled) {
ccowContextManager = new CCOWContextManager();
ccowContextManager.subscribe(this);
ccowContextManager.run("CareWebFramework#", "", true, "*");
}
if (ccowContextManager != null) {
if (!ccowContextManager.isActive()) {
ccowContextManager.resume();
}
init(response -> {
if (response.rejected()) {
ccowContextManager.suspend();
}
updateCCOWStatus();
});
}
} | [
"public",
"void",
"ccowJoin",
"(",
")",
"{",
"if",
"(",
"ccowIsActive",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"ccowContextManager",
"==",
"null",
"&&",
"ccowEnabled",
")",
"{",
"ccowContextManager",
"=",
"new",
"CCOWContextManager",
"(",
")",
... | Joins the CCOW common context, if available. | [
"Joins",
"the",
"CCOW",
"common",
"context",
"if",
"available",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L138-L162 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.init | public void init(IManagedContext<?> item, ISurveyCallback callback) {
contextItems.clear();
if (ccowIsActive()) {
contextItems.addItems(ccowContextManager.getCCOWContext());
}
if (item != null) {
initItem(item, callback);
} else {
SurveyResponse response = new SurveyResponse();
initItem(managedContexts.iterator(), response, callback);
}
} | java | public void init(IManagedContext<?> item, ISurveyCallback callback) {
contextItems.clear();
if (ccowIsActive()) {
contextItems.addItems(ccowContextManager.getCCOWContext());
}
if (item != null) {
initItem(item, callback);
} else {
SurveyResponse response = new SurveyResponse();
initItem(managedContexts.iterator(), response, callback);
}
} | [
"public",
"void",
"init",
"(",
"IManagedContext",
"<",
"?",
">",
"item",
",",
"ISurveyCallback",
"callback",
")",
"{",
"contextItems",
".",
"clear",
"(",
")",
";",
"if",
"(",
"ccowIsActive",
"(",
")",
")",
"{",
"contextItems",
".",
"addItems",
"(",
"ccow... | Initializes one or all managed contexts to their default state.
@param item Managed context to initialize or, if null, initializes all managed contexts.
@param callback Callback to report subscriber responses. | [
"Initializes",
"one",
"or",
"all",
"managed",
"contexts",
"to",
"their",
"default",
"state",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L189-L202 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.initItem | private void initItem(IManagedContext<?> item, ISurveyCallback callback) {
try {
localChangeBegin(item);
if (hasSubject(item.getContextName())) {
item.setContextItems(contextItems);
} else {
item.init();
}
localChangeEnd(item, callback);
} catch (ContextException e) {
log.error("Error initializing context.", e);
execCallback(callback, new SurveyResponse(e.toString()));
}
} | java | private void initItem(IManagedContext<?> item, ISurveyCallback callback) {
try {
localChangeBegin(item);
if (hasSubject(item.getContextName())) {
item.setContextItems(contextItems);
} else {
item.init();
}
localChangeEnd(item, callback);
} catch (ContextException e) {
log.error("Error initializing context.", e);
execCallback(callback, new SurveyResponse(e.toString()));
}
} | [
"private",
"void",
"initItem",
"(",
"IManagedContext",
"<",
"?",
">",
"item",
",",
"ISurveyCallback",
"callback",
")",
"{",
"try",
"{",
"localChangeBegin",
"(",
"item",
")",
";",
"if",
"(",
"hasSubject",
"(",
"item",
".",
"getContextName",
"(",
")",
")",
... | Initializes the managed context.
@param item Managed context to initialize.
@param callback Callback to report subscriber responses. | [
"Initializes",
"the",
"managed",
"context",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L223-L238 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.hasSubject | private boolean hasSubject(String subject) {
boolean result = false;
String s = subject + ".";
int c = s.length();
for (String propName : contextItems.getItemNames()) {
result = s.equalsIgnoreCase(propName.substring(0, c));
if (result) {
break;
}
}
return result;
} | java | private boolean hasSubject(String subject) {
boolean result = false;
String s = subject + ".";
int c = s.length();
for (String propName : contextItems.getItemNames()) {
result = s.equalsIgnoreCase(propName.substring(0, c));
if (result) {
break;
}
}
return result;
} | [
"private",
"boolean",
"hasSubject",
"(",
"String",
"subject",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"String",
"s",
"=",
"subject",
"+",
"\".\"",
";",
"int",
"c",
"=",
"s",
".",
"length",
"(",
")",
";",
"for",
"(",
"String",
"propName",
":... | Returns true if the CCOW context contains context settings pertaining to the named subject.
@param subject Name of the CCOW subject
@return True if settings for the specified subject were found. | [
"Returns",
"true",
"if",
"the",
"CCOW",
"context",
"contains",
"context",
"settings",
"pertaining",
"to",
"the",
"named",
"subject",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L246-L260 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.commitContexts | private void commitContexts(boolean accept, boolean all) {
Stack<IManagedContext<?>> stack = commitStack;
commitStack = new Stack<>();
// First, commit or cancel all pending context changes.
for (IManagedContext<?> managedContext : stack) {
if (managedContext.isPending()) {
managedContext.commit(accept);
}
}
// Then notify subscribers of the changes.
while (!stack.isEmpty()) {
stack.pop().notifySubscribers(accept, all);
}
} | java | private void commitContexts(boolean accept, boolean all) {
Stack<IManagedContext<?>> stack = commitStack;
commitStack = new Stack<>();
// First, commit or cancel all pending context changes.
for (IManagedContext<?> managedContext : stack) {
if (managedContext.isPending()) {
managedContext.commit(accept);
}
}
// Then notify subscribers of the changes.
while (!stack.isEmpty()) {
stack.pop().notifySubscribers(accept, all);
}
} | [
"private",
"void",
"commitContexts",
"(",
"boolean",
"accept",
",",
"boolean",
"all",
")",
"{",
"Stack",
"<",
"IManagedContext",
"<",
"?",
">",
">",
"stack",
"=",
"commitStack",
";",
"commitStack",
"=",
"new",
"Stack",
"<>",
"(",
")",
";",
"// First, commi... | Commit or cancel all pending context changes.
@param accept If true, pending changes are committed. If false, they are canceled.
@param all If false, only polled subscribers are notified. | [
"Commit",
"or",
"cancel",
"all",
"pending",
"context",
"changes",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L268-L281 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.setCCOWEnabled | public void setCCOWEnabled(boolean ccowEnabled) {
this.ccowEnabled = ccowEnabled;
if (!ccowEnabled && ccowContextManager != null) {
ccowContextManager.suspend();
ccowContextManager = null;
}
updateCCOWStatus();
} | java | public void setCCOWEnabled(boolean ccowEnabled) {
this.ccowEnabled = ccowEnabled;
if (!ccowEnabled && ccowContextManager != null) {
ccowContextManager.suspend();
ccowContextManager = null;
}
updateCCOWStatus();
} | [
"public",
"void",
"setCCOWEnabled",
"(",
"boolean",
"ccowEnabled",
")",
"{",
"this",
".",
"ccowEnabled",
"=",
"ccowEnabled",
";",
"if",
"(",
"!",
"ccowEnabled",
"&&",
"ccowContextManager",
"!=",
"null",
")",
"{",
"ccowContextManager",
".",
"suspend",
"(",
")",... | Enables or disables CCOW support.
@param ccowEnabled True enables CCOW support if it is available. | [
"Enables",
"or",
"disables",
"CCOW",
"support",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L351-L360 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.getMarshaledContext | public ContextItems getMarshaledContext() {
ContextItems marshaledContext = new ContextItems();
for (IManagedContext<?> managedContext : managedContexts) {
marshaledContext.addItems(managedContext.getContextItems(false));
}
return marshaledContext;
} | java | public ContextItems getMarshaledContext() {
ContextItems marshaledContext = new ContextItems();
for (IManagedContext<?> managedContext : managedContexts) {
marshaledContext.addItems(managedContext.getContextItems(false));
}
return marshaledContext;
} | [
"public",
"ContextItems",
"getMarshaledContext",
"(",
")",
"{",
"ContextItems",
"marshaledContext",
"=",
"new",
"ContextItems",
"(",
")",
";",
"for",
"(",
"IManagedContext",
"<",
"?",
">",
"managedContext",
":",
"managedContexts",
")",
"{",
"marshaledContext",
"."... | Returns the marshaled context representing the state of all shared contexts.
@return A ContextItems object representing the current state of all shared contexts. | [
"Returns",
"the",
"marshaled",
"context",
"representing",
"the",
"state",
"of",
"all",
"shared",
"contexts",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L367-L375 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.getCCOWStatus | private CCOWStatus getCCOWStatus() {
if (ccowContextManager == null) {
return ccowEnabled ? CCOWStatus.NONE : CCOWStatus.DISABLED;
} else if (ccowTransaction) {
return CCOWStatus.CHANGING;
} else {
switch (ccowContextManager.getState()) {
case csParticipating:
return CCOWStatus.JOINED;
case csSuspended:
return CCOWStatus.BROKEN;
default:
return CCOWStatus.NONE;
}
}
} | java | private CCOWStatus getCCOWStatus() {
if (ccowContextManager == null) {
return ccowEnabled ? CCOWStatus.NONE : CCOWStatus.DISABLED;
} else if (ccowTransaction) {
return CCOWStatus.CHANGING;
} else {
switch (ccowContextManager.getState()) {
case csParticipating:
return CCOWStatus.JOINED;
case csSuspended:
return CCOWStatus.BROKEN;
default:
return CCOWStatus.NONE;
}
}
} | [
"private",
"CCOWStatus",
"getCCOWStatus",
"(",
")",
"{",
"if",
"(",
"ccowContextManager",
"==",
"null",
")",
"{",
"return",
"ccowEnabled",
"?",
"CCOWStatus",
".",
"NONE",
":",
"CCOWStatus",
".",
"DISABLED",
";",
"}",
"else",
"if",
"(",
"ccowTransaction",
")"... | Returns the current status of the CCOW common context. Return values correspond to possible
states of the standard CCOW status icon.
@return Status of the CCOW common context. | [
"Returns",
"the",
"current",
"status",
"of",
"the",
"CCOW",
"common",
"context",
".",
"Return",
"values",
"correspond",
"to",
"possible",
"states",
"of",
"the",
"standard",
"CCOW",
"status",
"icon",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L383-L398 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.updateCCOWStatus | private void updateCCOWStatus() {
if (ccowEnabled && eventManager != null) {
eventManager.fireLocalEvent("CCOW", Integer.toString(getCCOWStatus().ordinal()));
}
} | java | private void updateCCOWStatus() {
if (ccowEnabled && eventManager != null) {
eventManager.fireLocalEvent("CCOW", Integer.toString(getCCOWStatus().ordinal()));
}
} | [
"private",
"void",
"updateCCOWStatus",
"(",
")",
"{",
"if",
"(",
"ccowEnabled",
"&&",
"eventManager",
"!=",
"null",
")",
"{",
"eventManager",
".",
"fireLocalEvent",
"(",
"\"CCOW\"",
",",
"Integer",
".",
"toString",
"(",
"getCCOWStatus",
"(",
")",
".",
"ordin... | Notifies subscribers of a change in the CCOW status via a generic event. | [
"Notifies",
"subscribers",
"of",
"a",
"change",
"in",
"the",
"CCOW",
"status",
"via",
"a",
"generic",
"event",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L403-L407 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.registerObject | @Override
public void registerObject(Object object) {
if (object instanceof IManagedContext) {
managedContexts.add((IManagedContext<?>) object);
}
} | java | @Override
public void registerObject(Object object) {
if (object instanceof IManagedContext) {
managedContexts.add((IManagedContext<?>) object);
}
} | [
"@",
"Override",
"public",
"void",
"registerObject",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"IManagedContext",
")",
"{",
"managedContexts",
".",
"add",
"(",
"(",
"IManagedContext",
"<",
"?",
">",
")",
"object",
")",
";",
"}",... | Register an object with the context manager if it implements the IManagedContext interface.
@param object Object to register. | [
"Register",
"an",
"object",
"with",
"the",
"context",
"manager",
"if",
"it",
"implements",
"the",
"IManagedContext",
"interface",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L418-L423 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.unregisterObject | @Override
public void unregisterObject(Object object) {
if (object instanceof IContextEvent) {
for (IManagedContext<?> managedContext : managedContexts) {
managedContext.removeSubscriber((IContextEvent) object);
}
}
if (object instanceof IManagedContext) {
managedContexts.remove(object);
}
} | java | @Override
public void unregisterObject(Object object) {
if (object instanceof IContextEvent) {
for (IManagedContext<?> managedContext : managedContexts) {
managedContext.removeSubscriber((IContextEvent) object);
}
}
if (object instanceof IManagedContext) {
managedContexts.remove(object);
}
} | [
"@",
"Override",
"public",
"void",
"unregisterObject",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"IContextEvent",
")",
"{",
"for",
"(",
"IManagedContext",
"<",
"?",
">",
"managedContext",
":",
"managedContexts",
")",
"{",
"managedCo... | Unregister an object from the context manager.
@param object Object to unregister. | [
"Unregister",
"an",
"object",
"from",
"the",
"context",
"manager",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L430-L441 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.localChangeEnd | private void localChangeEnd(IManagedContext<?> managedContext, boolean silent, boolean deferCommit,
ISurveyCallback callback) throws ContextException {
if (pendingStack.isEmpty() || pendingStack.peek() != managedContext) {
throw new ContextException("Illegal context change nesting.");
}
if (!managedContext.isPending()) {
pendingStack.pop();
return;
}
commitStack.push(managedContext);
managedContext.surveySubscribers(silent, response -> {
boolean accept = !response.rejected();
if (!accept && log.isDebugEnabled()) {
log.debug("Survey of managed context " + managedContext.getContextName() + " returned '" + response + "'.");
}
pendingStack.remove(managedContext);
if (!deferCommit && (!accept || pendingStack.isEmpty())) {
commitContexts(accept, accept);
}
execCallback(callback, response);
});
} | java | private void localChangeEnd(IManagedContext<?> managedContext, boolean silent, boolean deferCommit,
ISurveyCallback callback) throws ContextException {
if (pendingStack.isEmpty() || pendingStack.peek() != managedContext) {
throw new ContextException("Illegal context change nesting.");
}
if (!managedContext.isPending()) {
pendingStack.pop();
return;
}
commitStack.push(managedContext);
managedContext.surveySubscribers(silent, response -> {
boolean accept = !response.rejected();
if (!accept && log.isDebugEnabled()) {
log.debug("Survey of managed context " + managedContext.getContextName() + " returned '" + response + "'.");
}
pendingStack.remove(managedContext);
if (!deferCommit && (!accept || pendingStack.isEmpty())) {
commitContexts(accept, accept);
}
execCallback(callback, response);
});
} | [
"private",
"void",
"localChangeEnd",
"(",
"IManagedContext",
"<",
"?",
">",
"managedContext",
",",
"boolean",
"silent",
",",
"boolean",
"deferCommit",
",",
"ISurveyCallback",
"callback",
")",
"throws",
"ContextException",
"{",
"if",
"(",
"pendingStack",
".",
"isEm... | Commits a pending context change.
@param managedContext The managed context of interest.
@param silent If true, this is a silent context change.
@param deferCommit If true, don't commit the context change, just survey subscribers.
@param callback Callback for polling.
@throws ContextException during illegal context change nesting | [
"Commits",
"a",
"pending",
"context",
"change",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L476-L504 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.resetItem | private void resetItem(IManagedContext<?> item, boolean silent, ISurveyCallback callback) {
try {
localChangeBegin(item);
item.reset();
localChangeEnd(item, silent, true, callback);
} catch (ContextException e) {
execCallback(callback, e);
}
} | java | private void resetItem(IManagedContext<?> item, boolean silent, ISurveyCallback callback) {
try {
localChangeBegin(item);
item.reset();
localChangeEnd(item, silent, true, callback);
} catch (ContextException e) {
execCallback(callback, e);
}
} | [
"private",
"void",
"resetItem",
"(",
"IManagedContext",
"<",
"?",
">",
"item",
",",
"boolean",
"silent",
",",
"ISurveyCallback",
"callback",
")",
"{",
"try",
"{",
"localChangeBegin",
"(",
"item",
")",
";",
"item",
".",
"reset",
"(",
")",
";",
"localChangeE... | Resets the managed context.
@param item Managed context to reset.
@param silent Silent flag.
@param callback Callback for polling. | [
"Resets",
"the",
"managed",
"context",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L603-L611 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.ccowPending | @Override
public void ccowPending(CCOWContextManager sender, ContextItems contextItems) {
ccowTransaction = true;
updateCCOWStatus();
setMarshaledContext(contextItems, false, response -> {
if (response.rejected()) {
sender.setSurveyResponse(response.toString());
}
ccowTransaction = false;
updateCCOWStatus();
});
} | java | @Override
public void ccowPending(CCOWContextManager sender, ContextItems contextItems) {
ccowTransaction = true;
updateCCOWStatus();
setMarshaledContext(contextItems, false, response -> {
if (response.rejected()) {
sender.setSurveyResponse(response.toString());
}
ccowTransaction = false;
updateCCOWStatus();
});
} | [
"@",
"Override",
"public",
"void",
"ccowPending",
"(",
"CCOWContextManager",
"sender",
",",
"ContextItems",
"contextItems",
")",
"{",
"ccowTransaction",
"=",
"true",
";",
"updateCCOWStatus",
"(",
")",
";",
"setMarshaledContext",
"(",
"contextItems",
",",
"false",
... | Callback to handle a polling request from the CCOW context manager. | [
"Callback",
"to",
"handle",
"a",
"polling",
"request",
"from",
"the",
"CCOW",
"context",
"manager",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L636-L648 | train |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.ohj/src/main/java/org/carewebframework/help/ohj/HelpView.java | HelpView.initTopicTree | private void initTopicTree() {
try {
Object data = view.getViewData();
if (!(data instanceof TopicTree)) {
return;
}
TopicTree topicTree = (TopicTree) data;
HelpTopicNode baseNode;
if (helpViewType == HelpViewType.TOC) {
HelpTopic topic = new HelpTopic(null, hs.getName(), hs.getName());
baseNode = new HelpTopicNode(topic);
rootNode.addChild(baseNode);
} else {
baseNode = rootNode;
}
initTopicTree(baseNode, topicTree.getRoot());
} catch (IOException e) {
return;
}
} | java | private void initTopicTree() {
try {
Object data = view.getViewData();
if (!(data instanceof TopicTree)) {
return;
}
TopicTree topicTree = (TopicTree) data;
HelpTopicNode baseNode;
if (helpViewType == HelpViewType.TOC) {
HelpTopic topic = new HelpTopic(null, hs.getName(), hs.getName());
baseNode = new HelpTopicNode(topic);
rootNode.addChild(baseNode);
} else {
baseNode = rootNode;
}
initTopicTree(baseNode, topicTree.getRoot());
} catch (IOException e) {
return;
}
} | [
"private",
"void",
"initTopicTree",
"(",
")",
"{",
"try",
"{",
"Object",
"data",
"=",
"view",
".",
"getViewData",
"(",
")",
";",
"if",
"(",
"!",
"(",
"data",
"instanceof",
"TopicTree",
")",
")",
"{",
"return",
";",
"}",
"TopicTree",
"topicTree",
"=",
... | Initialize the topic tree. | [
"Initialize",
"the",
"topic",
"tree",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.ohj/src/main/java/org/carewebframework/help/ohj/HelpView.java#L68-L93 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java | PluginXmlParser.parseResources | private void parseResources(Element element, BeanDefinitionBuilder builder,
ManagedList<AbstractBeanDefinition> resourceList) {
NodeList resources = element.getChildNodes();
for (int i = 0; i < resources.getLength(); i++) {
Node node = resources.item(i);
if (!(node instanceof Element)) {
continue;
}
Element resource = (Element) resources.item(i);
Class<? extends IPluginResource> resourceClass = null;
switch (getResourceType(getNodeName(resource))) {
case button:
resourceClass = PluginResourceButton.class;
break;
case help:
resourceClass = PluginResourceHelp.class;
break;
case menu:
resourceClass = PluginResourceMenu.class;
break;
case property:
resourceClass = PluginResourcePropertyGroup.class;
break;
case css:
resourceClass = PluginResourceCSS.class;
break;
case bean:
resourceClass = PluginResourceBean.class;
break;
case command:
resourceClass = PluginResourceCommand.class;
break;
case action:
resourceClass = PluginResourceAction.class;
break;
}
if (resourceClass != null) {
BeanDefinitionBuilder resourceBuilder = BeanDefinitionBuilder.genericBeanDefinition(resourceClass);
addProperties(resource, resourceBuilder);
resourceList.add(resourceBuilder.getBeanDefinition());
}
}
} | java | private void parseResources(Element element, BeanDefinitionBuilder builder,
ManagedList<AbstractBeanDefinition> resourceList) {
NodeList resources = element.getChildNodes();
for (int i = 0; i < resources.getLength(); i++) {
Node node = resources.item(i);
if (!(node instanceof Element)) {
continue;
}
Element resource = (Element) resources.item(i);
Class<? extends IPluginResource> resourceClass = null;
switch (getResourceType(getNodeName(resource))) {
case button:
resourceClass = PluginResourceButton.class;
break;
case help:
resourceClass = PluginResourceHelp.class;
break;
case menu:
resourceClass = PluginResourceMenu.class;
break;
case property:
resourceClass = PluginResourcePropertyGroup.class;
break;
case css:
resourceClass = PluginResourceCSS.class;
break;
case bean:
resourceClass = PluginResourceBean.class;
break;
case command:
resourceClass = PluginResourceCommand.class;
break;
case action:
resourceClass = PluginResourceAction.class;
break;
}
if (resourceClass != null) {
BeanDefinitionBuilder resourceBuilder = BeanDefinitionBuilder.genericBeanDefinition(resourceClass);
addProperties(resource, resourceBuilder);
resourceList.add(resourceBuilder.getBeanDefinition());
}
}
} | [
"private",
"void",
"parseResources",
"(",
"Element",
"element",
",",
"BeanDefinitionBuilder",
"builder",
",",
"ManagedList",
"<",
"AbstractBeanDefinition",
">",
"resourceList",
")",
"{",
"NodeList",
"resources",
"=",
"element",
".",
"getChildNodes",
"(",
")",
";",
... | Parse the resource list.
@param element Root resource tag.
@param builder Bean definition builder.
@param resourceList List of resources to build. | [
"Parse",
"the",
"resource",
"list",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java#L116-L170 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java | PluginXmlParser.parseAuthorities | private void parseAuthorities(Element element, BeanDefinitionBuilder builder,
ManagedList<AbstractBeanDefinition> authorityList) {
NodeList authorities = element.getChildNodes();
for (int i = 0; i < authorities.getLength(); i++) {
Node node = authorities.item(i);
if (!(node instanceof Element)) {
continue;
}
Element authority = (Element) node;
BeanDefinitionBuilder authorityBuilder = BeanDefinitionBuilder
.genericBeanDefinition(PluginDefinition.Authority.class);
addProperties(authority, authorityBuilder);
authorityList.add(authorityBuilder.getBeanDefinition());
}
} | java | private void parseAuthorities(Element element, BeanDefinitionBuilder builder,
ManagedList<AbstractBeanDefinition> authorityList) {
NodeList authorities = element.getChildNodes();
for (int i = 0; i < authorities.getLength(); i++) {
Node node = authorities.item(i);
if (!(node instanceof Element)) {
continue;
}
Element authority = (Element) node;
BeanDefinitionBuilder authorityBuilder = BeanDefinitionBuilder
.genericBeanDefinition(PluginDefinition.Authority.class);
addProperties(authority, authorityBuilder);
authorityList.add(authorityBuilder.getBeanDefinition());
}
} | [
"private",
"void",
"parseAuthorities",
"(",
"Element",
"element",
",",
"BeanDefinitionBuilder",
"builder",
",",
"ManagedList",
"<",
"AbstractBeanDefinition",
">",
"authorityList",
")",
"{",
"NodeList",
"authorities",
"=",
"element",
".",
"getChildNodes",
"(",
")",
"... | Parse the authority list.
@param element Root authority tag.
@param builder Bean definition builder.
@param authorityList List of authorities to return. | [
"Parse",
"the",
"authority",
"list",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java#L179-L196 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java | PluginXmlParser.parseProperties | private void parseProperties(Element element, BeanDefinitionBuilder builder,
ManagedList<AbstractBeanDefinition> propertyList) {
NodeList properties = element.getChildNodes();
for (int i = 0; i < properties.getLength(); i++) {
Node node = properties.item(i);
if (!(node instanceof Element)) {
continue;
}
Element property = (Element) node;
BeanDefinitionBuilder propertyBuilder = BeanDefinitionBuilder.genericBeanDefinition(PropertyInfo.class);
addProperties(property, propertyBuilder);
parseConfig(property, propertyBuilder);
propertyList.add(propertyBuilder.getBeanDefinition());
}
} | java | private void parseProperties(Element element, BeanDefinitionBuilder builder,
ManagedList<AbstractBeanDefinition> propertyList) {
NodeList properties = element.getChildNodes();
for (int i = 0; i < properties.getLength(); i++) {
Node node = properties.item(i);
if (!(node instanceof Element)) {
continue;
}
Element property = (Element) node;
BeanDefinitionBuilder propertyBuilder = BeanDefinitionBuilder.genericBeanDefinition(PropertyInfo.class);
addProperties(property, propertyBuilder);
parseConfig(property, propertyBuilder);
propertyList.add(propertyBuilder.getBeanDefinition());
}
} | [
"private",
"void",
"parseProperties",
"(",
"Element",
"element",
",",
"BeanDefinitionBuilder",
"builder",
",",
"ManagedList",
"<",
"AbstractBeanDefinition",
">",
"propertyList",
")",
"{",
"NodeList",
"properties",
"=",
"element",
".",
"getChildNodes",
"(",
")",
";",... | Parse the property list.
@param element Root property tag.
@param builder Bean definition builder.
@param propertyList List of properties to return. | [
"Parse",
"the",
"property",
"list",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java#L205-L222 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java | PluginXmlParser.parseConfig | private void parseConfig(Element property, BeanDefinitionBuilder propertyBuilder) {
Element config = (Element) getTagChildren("config", property).item(0);
if (config != null) {
Properties properties = new Properties();
NodeList entries = getTagChildren("entry", config);
for (int i = 0; i < entries.getLength(); i++) {
Element entry = (Element) entries.item(i);
String key = entry.getAttribute("key");
String value = entry.getTextContent().trim();
properties.put(key, value);
}
propertyBuilder.addPropertyValue("config", properties);
}
} | java | private void parseConfig(Element property, BeanDefinitionBuilder propertyBuilder) {
Element config = (Element) getTagChildren("config", property).item(0);
if (config != null) {
Properties properties = new Properties();
NodeList entries = getTagChildren("entry", config);
for (int i = 0; i < entries.getLength(); i++) {
Element entry = (Element) entries.item(i);
String key = entry.getAttribute("key");
String value = entry.getTextContent().trim();
properties.put(key, value);
}
propertyBuilder.addPropertyValue("config", properties);
}
} | [
"private",
"void",
"parseConfig",
"(",
"Element",
"property",
",",
"BeanDefinitionBuilder",
"propertyBuilder",
")",
"{",
"Element",
"config",
"=",
"(",
"Element",
")",
"getTagChildren",
"(",
"\"config\"",
",",
"property",
")",
".",
"item",
"(",
"0",
")",
";",
... | Parses out configuration settings for current property descriptor.
@param property Root element
@param propertyBuilder Bean definition builder. | [
"Parses",
"out",
"configuration",
"settings",
"for",
"current",
"property",
"descriptor",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java#L230-L246 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java | PluginXmlParser.getResourceType | private ResourceType getResourceType(String resourceTag) {
if (resourceTag == null || !resourceTag.endsWith("-resource")) {
return ResourceType.unknown;
}
try {
return ResourceType.valueOf(resourceTag.substring(0, resourceTag.length() - 9));
} catch (Exception e) {
return ResourceType.unknown;
}
} | java | private ResourceType getResourceType(String resourceTag) {
if (resourceTag == null || !resourceTag.endsWith("-resource")) {
return ResourceType.unknown;
}
try {
return ResourceType.valueOf(resourceTag.substring(0, resourceTag.length() - 9));
} catch (Exception e) {
return ResourceType.unknown;
}
} | [
"private",
"ResourceType",
"getResourceType",
"(",
"String",
"resourceTag",
")",
"{",
"if",
"(",
"resourceTag",
"==",
"null",
"||",
"!",
"resourceTag",
".",
"endsWith",
"(",
"\"-resource\"",
")",
")",
"{",
"return",
"ResourceType",
".",
"unknown",
";",
"}",
... | Returns the ResourceType enum value corresponding to the resource tag.
@param resourceTag Tag name of resource
@return ResourceType enum. Returns an enum of unknown if tag is not a supported resource
type. | [
"Returns",
"the",
"ResourceType",
"enum",
"value",
"corresponding",
"to",
"the",
"resource",
"tag",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginXmlParser.java#L255-L265 | train |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/systemunderdevelopment/DefaultSystemUnderDevelopment.java | DefaultSystemUnderDevelopment.getFixture | public Fixture getFixture( String name, String... params ) throws Throwable
{
Type<?> type = loadType( name );
Object target = type.newInstanceUsingCoercion( params );
return new DefaultFixture( target );
} | java | public Fixture getFixture( String name, String... params ) throws Throwable
{
Type<?> type = loadType( name );
Object target = type.newInstanceUsingCoercion( params );
return new DefaultFixture( target );
} | [
"public",
"Fixture",
"getFixture",
"(",
"String",
"name",
",",
"String",
"...",
"params",
")",
"throws",
"Throwable",
"{",
"Type",
"<",
"?",
">",
"type",
"=",
"loadType",
"(",
"name",
")",
";",
"Object",
"target",
"=",
"type",
".",
"newInstanceUsingCoercio... | Creates a new instance of a fixture class using a set of parameters.
@param name the name of the class to instantiate
@param params the parameters (constructor arguments)
@return a new instance of the fixtureClass with fields populated using
Constructor
@throws Exception if any.
@throws java.lang.Throwable if any. | [
"Creates",
"a",
"new",
"instance",
"of",
"a",
"fixture",
"class",
"using",
"a",
"set",
"of",
"parameters",
"."
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/systemunderdevelopment/DefaultSystemUnderDevelopment.java#L77-L82 | train |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java | BinaryTransform.readWord | protected int readWord(InputStream inputStream) throws IOException {
byte[] bytes = new byte[2];
boolean success = inputStream.read(bytes) == 2;
return !success ? -1 : readWord(bytes, 0);
} | java | protected int readWord(InputStream inputStream) throws IOException {
byte[] bytes = new byte[2];
boolean success = inputStream.read(bytes) == 2;
return !success ? -1 : readWord(bytes, 0);
} | [
"protected",
"int",
"readWord",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"2",
"]",
";",
"boolean",
"success",
"=",
"inputStream",
".",
"read",
"(",
"bytes",
")",
"==",
"2",
... | Reads a two-byte integer from the input stream.
@param inputStream The input stream.
@return A two-byte integer value.
@throws IOException Exception while reading from input stream. | [
"Reads",
"a",
"two",
"-",
"byte",
"integer",
"from",
"the",
"input",
"stream",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java#L72-L76 | train |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java | BinaryTransform.readWord | protected int readWord(byte[] data, int offset) {
int low = data[offset] & 0xff;
int high = data[offset + 1] & 0xff;
return high << 8 | low;
} | java | protected int readWord(byte[] data, int offset) {
int low = data[offset] & 0xff;
int high = data[offset + 1] & 0xff;
return high << 8 | low;
} | [
"protected",
"int",
"readWord",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"low",
"=",
"data",
"[",
"offset",
"]",
"&",
"0xff",
";",
"int",
"high",
"=",
"data",
"[",
"offset",
"+",
"1",
"]",
"&",
"0xff",
";",
"return",
... | Reads a two-byte integer from a byte array at the specified offset.
@param data The source data.
@param offset The byte offset.
@return A two-byte integer value. | [
"Reads",
"a",
"two",
"-",
"byte",
"integer",
"from",
"a",
"byte",
"array",
"at",
"the",
"specified",
"offset",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java#L96-L100 | train |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java | BinaryTransform.getString | protected String getString(byte[] data, int offset) {
if (offset < 0) {
return "";
}
int i = offset;
while (data[i++] != 0x00) {
;
}
return getString(data, offset, i - offset - 1);
} | java | protected String getString(byte[] data, int offset) {
if (offset < 0) {
return "";
}
int i = offset;
while (data[i++] != 0x00) {
;
}
return getString(data, offset, i - offset - 1);
} | [
"protected",
"String",
"getString",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"int",
"i",
"=",
"offset",
";",
"while",
"(",
"data",
"[",
"i",
"++",
"]",
"... | Returns a string value from a zero-terminated byte array at the specified offset.
@param data The source data.
@param offset The byte offset.
@return A string. | [
"Returns",
"a",
"string",
"value",
"from",
"a",
"zero",
"-",
"terminated",
"byte",
"array",
"at",
"the",
"specified",
"offset",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java#L119-L129 | train |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java | BinaryTransform.getString | protected String getString(byte[] data, int offset, int length) {
return new String(data, offset, length, CS_WIN1252);
} | java | protected String getString(byte[] data, int offset, int length) {
return new String(data, offset, length, CS_WIN1252);
} | [
"protected",
"String",
"getString",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"return",
"new",
"String",
"(",
"data",
",",
"offset",
",",
"length",
",",
"CS_WIN1252",
")",
";",
"}"
] | Returns a string value from the byte array.
@param data The source data.
@param offset The byte offset.
@param length The string length.
@return A string | [
"Returns",
"a",
"string",
"value",
"from",
"the",
"byte",
"array",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java#L139-L141 | train |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java | BinaryTransform.loadBinaryFile | protected byte[] loadBinaryFile(String file) throws IOException {
try (InputStream is = resource.getInputStream(file)) {
return IOUtils.toByteArray(is);
}
} | java | protected byte[] loadBinaryFile(String file) throws IOException {
try (InputStream is = resource.getInputStream(file)) {
return IOUtils.toByteArray(is);
}
} | [
"protected",
"byte",
"[",
"]",
"loadBinaryFile",
"(",
"String",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"is",
"=",
"resource",
".",
"getInputStream",
"(",
"file",
")",
")",
"{",
"return",
"IOUtils",
".",
"toByteArray",
"(",
"i... | Loads the entire contents of a binary file into a byte array.
@param file The path to the binary file.
@return The contents of the input file as a byte array
@throws IOException Exception while reading from file. | [
"Loads",
"the",
"entire",
"contents",
"of",
"a",
"binary",
"file",
"into",
"a",
"byte",
"array",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java#L150-L154 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryUtil.java | QueryUtil.abortResult | public static <T> IQueryResult<T> abortResult(String reason) {
return packageResult(null, CompletionStatus.ABORTED,
reason == null ? null : Collections.singletonMap("reason", (Object) reason));
} | java | public static <T> IQueryResult<T> abortResult(String reason) {
return packageResult(null, CompletionStatus.ABORTED,
reason == null ? null : Collections.singletonMap("reason", (Object) reason));
} | [
"public",
"static",
"<",
"T",
">",
"IQueryResult",
"<",
"T",
">",
"abortResult",
"(",
"String",
"reason",
")",
"{",
"return",
"packageResult",
"(",
"null",
",",
"CompletionStatus",
".",
"ABORTED",
",",
"reason",
"==",
"null",
"?",
"null",
":",
"Collections... | Returns a query result for an aborted operation.
@param <T> Class of query result.
@param reason Optional reason for the aborted operation.
@return Query result. | [
"Returns",
"a",
"query",
"result",
"for",
"an",
"aborted",
"operation",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryUtil.java#L79-L82 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryUtil.java | QueryUtil.errorResult | public static <T> IQueryResult<T> errorResult(Throwable exception) {
return packageResult(null, CompletionStatus.ERROR,
exception == null ? null : Collections.singletonMap("exception", (Object) exception));
} | java | public static <T> IQueryResult<T> errorResult(Throwable exception) {
return packageResult(null, CompletionStatus.ERROR,
exception == null ? null : Collections.singletonMap("exception", (Object) exception));
} | [
"public",
"static",
"<",
"T",
">",
"IQueryResult",
"<",
"T",
">",
"errorResult",
"(",
"Throwable",
"exception",
")",
"{",
"return",
"packageResult",
"(",
"null",
",",
"CompletionStatus",
".",
"ERROR",
",",
"exception",
"==",
"null",
"?",
"null",
":",
"Coll... | Returns a query result for an error.
@param <T> Class of query result.
@param exception The exception being reported.
@return Query result. | [
"Returns",
"a",
"query",
"result",
"for",
"an",
"error",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryUtil.java#L91-L94 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryFilterSet.java | QueryFilterSet.filter | public List<T> filter(List<T> results) {
if (filters.isEmpty() || results == null) {
return results;
}
List<T> include = new ArrayList<>();
for (T result : results) {
if (include(result)) {
include.add(result);
}
}
return results.size() == include.size() ? results : include;
} | java | public List<T> filter(List<T> results) {
if (filters.isEmpty() || results == null) {
return results;
}
List<T> include = new ArrayList<>();
for (T result : results) {
if (include(result)) {
include.add(result);
}
}
return results.size() == include.size() ? results : include;
} | [
"public",
"List",
"<",
"T",
">",
"filter",
"(",
"List",
"<",
"T",
">",
"results",
")",
"{",
"if",
"(",
"filters",
".",
"isEmpty",
"(",
")",
"||",
"results",
"==",
"null",
")",
"{",
"return",
"results",
";",
"}",
"List",
"<",
"T",
">",
"include",
... | Filters a list of results based on the member filters.
@param results Result list to filter.
@return The filtered list. Note that if no results are filtered, the original list is
returned. | [
"Filters",
"a",
"list",
"of",
"results",
"based",
"on",
"the",
"member",
"filters",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryFilterSet.java#L108-L122 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementTabPane.java | ElementTabPane.updateVisibility | @Override
protected void updateVisibility(boolean visible, boolean activated) {
tab.setVisible(visible);
tab.setSelected(visible && activated);
} | java | @Override
protected void updateVisibility(boolean visible, boolean activated) {
tab.setVisible(visible);
tab.setSelected(visible && activated);
} | [
"@",
"Override",
"protected",
"void",
"updateVisibility",
"(",
"boolean",
"visible",
",",
"boolean",
"activated",
")",
"{",
"tab",
".",
"setVisible",
"(",
"visible",
")",
";",
"tab",
".",
"setSelected",
"(",
"visible",
"&&",
"activated",
")",
";",
"}"
] | Sets the visibility and selection state of the tab. | [
"Sets",
"the",
"visibility",
"and",
"selection",
"state",
"of",
"the",
"tab",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementTabPane.java#L72-L76 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyTypeRegistry.java | PropertyTypeRegistry.init | private void init() {
add("text", PropertySerializer.STRING, PropertyEditorText.class);
add("color", PropertySerializer.STRING, PropertyEditorColor.class);
add("choice", PropertySerializer.STRING, PropertyEditorChoiceList.class);
add("action", PropertySerializer.STRING, PropertyEditorAction.class);
add("icon", PropertySerializer.STRING, PropertyEditorIcon.class);
add("integer", PropertySerializer.INTEGER, PropertyEditorInteger.class);
add("double", PropertySerializer.DOUBLE, PropertyEditorDouble.class);
add("boolean", PropertySerializer.BOOLEAN, PropertyEditorBoolean.class);
add("date", PropertySerializer.DATE, PropertyEditorDate.class);
} | java | private void init() {
add("text", PropertySerializer.STRING, PropertyEditorText.class);
add("color", PropertySerializer.STRING, PropertyEditorColor.class);
add("choice", PropertySerializer.STRING, PropertyEditorChoiceList.class);
add("action", PropertySerializer.STRING, PropertyEditorAction.class);
add("icon", PropertySerializer.STRING, PropertyEditorIcon.class);
add("integer", PropertySerializer.INTEGER, PropertyEditorInteger.class);
add("double", PropertySerializer.DOUBLE, PropertyEditorDouble.class);
add("boolean", PropertySerializer.BOOLEAN, PropertyEditorBoolean.class);
add("date", PropertySerializer.DATE, PropertyEditorDate.class);
} | [
"private",
"void",
"init",
"(",
")",
"{",
"add",
"(",
"\"text\"",
",",
"PropertySerializer",
".",
"STRING",
",",
"PropertyEditorText",
".",
"class",
")",
";",
"add",
"(",
"\"color\"",
",",
"PropertySerializer",
".",
"STRING",
",",
"PropertyEditorColor",
".",
... | Add built-in property types. | [
"Add",
"built",
"-",
"in",
"property",
"types",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyTypeRegistry.java#L103-L113 | train |
SpartaTech/sparta-spring-web-utils | src/main/java/org/sparta/springwebutils/RequestUtils.java | RequestUtils.computeInputParatemeter | private void computeInputParatemeter(final EntryPoint entryPoint, final String[] parameterNames, final Set<Class<?>> consolidatedTypeBlacklist,
final Set<String> consolidatedNameBlacklist, MethodParameter methodParameter) {
// If the type is part of the blacklist, we discard it
if (consolidatedTypeBlacklist.contains(methodParameter.getParameterType())) {
LOGGER.debug("Ignoring parameter type [{}]. It is on the blacklist.", methodParameter.getParameterType());
return;
}
// If we have a simple parameter type (primitives, wrappers, collections, arrays of primitives), we just get the name and we are done
if (ExternalEntryPointHelper.isSimpleRequestParameter(methodParameter.getParameterType())) {
// We need to look for @RequestParam in order to define its name
final String parameterRealName = parameterNames[methodParameter.getParameterIndex()];
LOGGER.debug("Parameter Real Name [{}]", parameterRealName);
// If the real name is part of the blacklist, we don't need to go any further
if (consolidatedNameBlacklist.contains(parameterRealName)) {
LOGGER.debug("Ignoring parameter name [{}]. It is on the blacklist.", parameterRealName);
return;
}
final EntryPointParameter entryPointParameter = new EntryPointParameter();
entryPointParameter.setName(parameterRealName);
entryPointParameter.setType(methodParameter.getParameterType());
// Look for a change of names and the required attribute, true by default
if (methodParameter.hasParameterAnnotation(RequestParam.class)) {
final RequestParam requestParam = methodParameter.getParameterAnnotation(RequestParam.class);
final String definedName = StringUtils.trimToEmpty(requestParam.value());
// If the defined name is part of the blacklist, we don't need to go any further
if (consolidatedNameBlacklist.contains(definedName)) {
LOGGER.debug("Ignoring parameter @RequestParam defined name [{}]. It is on the blacklist.", definedName);
return;
}
entryPointParameter.setName(StringUtils.isNotBlank(definedName) ? definedName : entryPointParameter.getName());
entryPointParameter.setRequired(requestParam.required());
entryPointParameter.setDefaultValue(StringUtils.equals(ValueConstants.DEFAULT_NONE, requestParam.defaultValue()) ? "" : requestParam.defaultValue());
}
entryPoint.getParameters().add(entryPointParameter);
} else if (!methodParameter.getParameterType().isArray()) {
// Here we have an object, that we need to deep dive and get all its attributes, object arrays are not supported
entryPoint.getParameters().addAll(ExternalEntryPointHelper.getInternalEntryPointParametersRecursively(methodParameter.getParameterType(), consolidatedTypeBlacklist, consolidatedNameBlacklist, maxDeepLevel));
}
} | java | private void computeInputParatemeter(final EntryPoint entryPoint, final String[] parameterNames, final Set<Class<?>> consolidatedTypeBlacklist,
final Set<String> consolidatedNameBlacklist, MethodParameter methodParameter) {
// If the type is part of the blacklist, we discard it
if (consolidatedTypeBlacklist.contains(methodParameter.getParameterType())) {
LOGGER.debug("Ignoring parameter type [{}]. It is on the blacklist.", methodParameter.getParameterType());
return;
}
// If we have a simple parameter type (primitives, wrappers, collections, arrays of primitives), we just get the name and we are done
if (ExternalEntryPointHelper.isSimpleRequestParameter(methodParameter.getParameterType())) {
// We need to look for @RequestParam in order to define its name
final String parameterRealName = parameterNames[methodParameter.getParameterIndex()];
LOGGER.debug("Parameter Real Name [{}]", parameterRealName);
// If the real name is part of the blacklist, we don't need to go any further
if (consolidatedNameBlacklist.contains(parameterRealName)) {
LOGGER.debug("Ignoring parameter name [{}]. It is on the blacklist.", parameterRealName);
return;
}
final EntryPointParameter entryPointParameter = new EntryPointParameter();
entryPointParameter.setName(parameterRealName);
entryPointParameter.setType(methodParameter.getParameterType());
// Look for a change of names and the required attribute, true by default
if (methodParameter.hasParameterAnnotation(RequestParam.class)) {
final RequestParam requestParam = methodParameter.getParameterAnnotation(RequestParam.class);
final String definedName = StringUtils.trimToEmpty(requestParam.value());
// If the defined name is part of the blacklist, we don't need to go any further
if (consolidatedNameBlacklist.contains(definedName)) {
LOGGER.debug("Ignoring parameter @RequestParam defined name [{}]. It is on the blacklist.", definedName);
return;
}
entryPointParameter.setName(StringUtils.isNotBlank(definedName) ? definedName : entryPointParameter.getName());
entryPointParameter.setRequired(requestParam.required());
entryPointParameter.setDefaultValue(StringUtils.equals(ValueConstants.DEFAULT_NONE, requestParam.defaultValue()) ? "" : requestParam.defaultValue());
}
entryPoint.getParameters().add(entryPointParameter);
} else if (!methodParameter.getParameterType().isArray()) {
// Here we have an object, that we need to deep dive and get all its attributes, object arrays are not supported
entryPoint.getParameters().addAll(ExternalEntryPointHelper.getInternalEntryPointParametersRecursively(methodParameter.getParameterType(), consolidatedTypeBlacklist, consolidatedNameBlacklist, maxDeepLevel));
}
} | [
"private",
"void",
"computeInputParatemeter",
"(",
"final",
"EntryPoint",
"entryPoint",
",",
"final",
"String",
"[",
"]",
"parameterNames",
",",
"final",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"consolidatedTypeBlacklist",
",",
"final",
"Set",
"<",
"String",
... | Checks whether or not the supplied parameter should be part of the response or not. It adds to the entry point, if necessary.
@param entryPoint
@param parameterNames
@param consolidatedTypeBlacklist
@param consolidatedNameBlacklist
@param methodParameter | [
"Checks",
"whether",
"or",
"not",
"the",
"supplied",
"parameter",
"should",
"be",
"part",
"of",
"the",
"response",
"or",
"not",
".",
"It",
"adds",
"to",
"the",
"entry",
"point",
"if",
"necessary",
"."
] | f5382474d46a6048d58707fc64e7936277e8b2ce | https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/RequestUtils.java#L147-L193 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java | PropertyUtil.findSetter | public static Method findSetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
return findMethod(methodName, instance, valueClass, true);
} | java | public static Method findSetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
return findMethod(methodName, instance, valueClass, true);
} | [
"public",
"static",
"Method",
"findSetter",
"(",
"String",
"methodName",
",",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"valueClass",
")",
"throws",
"NoSuchMethodException",
"{",
"return",
"findMethod",
"(",
"methodName",
",",
"instance",
",",
"valueCla... | Returns the requested setter method from an object instance.
@param methodName Name of the setter method.
@param instance Object instance to search.
@param valueClass The setter parameter type (null if don't care).
@return The setter method.
@throws NoSuchMethodException If method was not found. | [
"Returns",
"the",
"requested",
"setter",
"method",
"from",
"an",
"object",
"instance",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java#L46-L48 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java | PropertyUtil.findGetter | public static Method findGetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
return findMethod(methodName, instance, valueClass, false);
} | java | public static Method findGetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
return findMethod(methodName, instance, valueClass, false);
} | [
"public",
"static",
"Method",
"findGetter",
"(",
"String",
"methodName",
",",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"valueClass",
")",
"throws",
"NoSuchMethodException",
"{",
"return",
"findMethod",
"(",
"methodName",
",",
"instance",
",",
"valueCla... | Returns the requested getter method from an object instance.
@param methodName Name of the getter method.
@param instance Object instance to search.
@param valueClass The return value type (null if don't care).
@return The getter method.
@throws NoSuchMethodException If method was not found. | [
"Returns",
"the",
"requested",
"getter",
"method",
"from",
"an",
"object",
"instance",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java#L59-L61 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java | PropertyUtil.findMethod | private static Method findMethod(String methodName, Object instance, Class<?> valueClass, boolean setter)
throws NoSuchMethodException {
if (methodName == null) {
return null;
}
int paramCount = setter ? 1 : 0;
for (Method method : instance.getClass().getMethods()) {
if (method.getName().equals(methodName) && method.getParameterTypes().length == paramCount) {
Class<?> targetClass = setter ? method.getParameterTypes()[0] : method.getReturnType();
if (valueClass == null || TypeUtils.isAssignable(targetClass, valueClass)) {
return method;
}
}
}
throw new NoSuchMethodException("Compatible method not found: " + methodName);
} | java | private static Method findMethod(String methodName, Object instance, Class<?> valueClass, boolean setter)
throws NoSuchMethodException {
if (methodName == null) {
return null;
}
int paramCount = setter ? 1 : 0;
for (Method method : instance.getClass().getMethods()) {
if (method.getName().equals(methodName) && method.getParameterTypes().length == paramCount) {
Class<?> targetClass = setter ? method.getParameterTypes()[0] : method.getReturnType();
if (valueClass == null || TypeUtils.isAssignable(targetClass, valueClass)) {
return method;
}
}
}
throw new NoSuchMethodException("Compatible method not found: " + methodName);
} | [
"private",
"static",
"Method",
"findMethod",
"(",
"String",
"methodName",
",",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"valueClass",
",",
"boolean",
"setter",
")",
"throws",
"NoSuchMethodException",
"{",
"if",
"(",
"methodName",
"==",
"null",
")",
... | Returns the requested method from an object instance.
@param methodName Name of the setter method.
@param instance Object instance to search.
@param valueClass The desired property return type (null if don't care).
@param setter If true, search for setter method signature. If false, getter method signature.
@return The requested method.
@throws NoSuchMethodException If method was not found. | [
"Returns",
"the",
"requested",
"method",
"from",
"an",
"object",
"instance",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java#L73-L93 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/PHS398ModularBudgetBaseGenerator.java | PHS398ModularBudgetBaseGenerator.getTotalCost | protected ScaleTwoDecimal getTotalCost(BudgetModularContract budgetModular) {
ScaleTwoDecimal totalCost = ScaleTwoDecimal.ZERO;
if (budgetModular.getTotalDirectCost() != null) {
totalCost = budgetModular.getTotalDirectCost();
}
for (BudgetModularIdcContract budgetModularIdc : budgetModular
.getBudgetModularIdcs()) {
if (budgetModularIdc.getFundsRequested() != null) {
totalCost = totalCost.add(budgetModularIdc.getFundsRequested());
}
}
return totalCost;
} | java | protected ScaleTwoDecimal getTotalCost(BudgetModularContract budgetModular) {
ScaleTwoDecimal totalCost = ScaleTwoDecimal.ZERO;
if (budgetModular.getTotalDirectCost() != null) {
totalCost = budgetModular.getTotalDirectCost();
}
for (BudgetModularIdcContract budgetModularIdc : budgetModular
.getBudgetModularIdcs()) {
if (budgetModularIdc.getFundsRequested() != null) {
totalCost = totalCost.add(budgetModularIdc.getFundsRequested());
}
}
return totalCost;
} | [
"protected",
"ScaleTwoDecimal",
"getTotalCost",
"(",
"BudgetModularContract",
"budgetModular",
")",
"{",
"ScaleTwoDecimal",
"totalCost",
"=",
"ScaleTwoDecimal",
".",
"ZERO",
";",
"if",
"(",
"budgetModular",
".",
"getTotalDirectCost",
"(",
")",
"!=",
"null",
")",
"{"... | This method is used to get total cost as sum of totalDirectCost and total
sum of fundRequested.
@return totalCost | [
"This",
"method",
"is",
"used",
"to",
"get",
"total",
"cost",
"as",
"sum",
"of",
"totalDirectCost",
"and",
"total",
"sum",
"of",
"fundRequested",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/PHS398ModularBudgetBaseGenerator.java#L64-L76 | train |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/PHS398ModularBudgetBaseGenerator.java | PHS398ModularBudgetBaseGenerator.getCognizantFederalAgency | protected String getCognizantFederalAgency(RolodexContract rolodex) {
StringBuilder agency = new StringBuilder();
if(rolodex.getOrganization()!=null){
agency.append(rolodex.getOrganization());
}agency.append(COMMA_SEPERATOR);
if(rolodex.getFirstName()!=null){
agency.append(rolodex.getFirstName());
}agency.append(EMPTY_STRING);
if(rolodex.getLastName()!=null){
agency.append(rolodex.getLastName());
}agency.append(EMPTY_STRING);
if(rolodex.getPhoneNumber()!=null){
agency.append(rolodex.getPhoneNumber());
}return agency.toString();
} | java | protected String getCognizantFederalAgency(RolodexContract rolodex) {
StringBuilder agency = new StringBuilder();
if(rolodex.getOrganization()!=null){
agency.append(rolodex.getOrganization());
}agency.append(COMMA_SEPERATOR);
if(rolodex.getFirstName()!=null){
agency.append(rolodex.getFirstName());
}agency.append(EMPTY_STRING);
if(rolodex.getLastName()!=null){
agency.append(rolodex.getLastName());
}agency.append(EMPTY_STRING);
if(rolodex.getPhoneNumber()!=null){
agency.append(rolodex.getPhoneNumber());
}return agency.toString();
} | [
"protected",
"String",
"getCognizantFederalAgency",
"(",
"RolodexContract",
"rolodex",
")",
"{",
"StringBuilder",
"agency",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"rolodex",
".",
"getOrganization",
"(",
")",
"!=",
"null",
")",
"{",
"agency",
".... | This method is used to get rolodex Organization FirstName, LastName and
PhoneNumber as a single string
@return String | [
"This",
"method",
"is",
"used",
"to",
"get",
"rolodex",
"Organization",
"FirstName",
"LastName",
"and",
"PhoneNumber",
"as",
"a",
"single",
"string"
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/PHS398ModularBudgetBaseGenerator.java#L83-L97 | train |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/HelpProcessor.java | HelpProcessor.transform | @Override
public boolean transform(IResource resource) throws Exception {
String path = resource.getSourcePath();
if (path.startsWith("META-INF/")) {
return false;
}
if (hsFile == null && loader.isHelpSetFile(path)) {
hsFile = getResourceBase() + resource.getTargetPath();
}
return super.transform(resource);
} | java | @Override
public boolean transform(IResource resource) throws Exception {
String path = resource.getSourcePath();
if (path.startsWith("META-INF/")) {
return false;
}
if (hsFile == null && loader.isHelpSetFile(path)) {
hsFile = getResourceBase() + resource.getTargetPath();
}
return super.transform(resource);
} | [
"@",
"Override",
"public",
"boolean",
"transform",
"(",
"IResource",
"resource",
")",
"throws",
"Exception",
"{",
"String",
"path",
"=",
"resource",
".",
"getSourcePath",
"(",
")",
";",
"if",
"(",
"path",
".",
"startsWith",
"(",
"\"META-INF/\"",
")",
")",
... | Excludes resources under the META-INF folder and checks the resource against the help set
pattern, saving a path reference if it matches. | [
"Excludes",
"resources",
"under",
"the",
"META",
"-",
"INF",
"folder",
"and",
"checks",
"the",
"resource",
"against",
"the",
"help",
"set",
"pattern",
"saving",
"a",
"path",
"reference",
"if",
"it",
"matches",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/HelpProcessor.java#L75-L88 | train |
avarabyeu/jashing | extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVcsModule.java | AbstractVcsModule.loadConfiguration | @Provides
public VCSConfiguration loadConfiguration(Gson gson) {
try {
URL resource = ResourceUtils.getResourceAsURL(VCS_CONFIG_JSON);
if (null == resource) {
throw new IncorrectConfigurationException("Unable to find VCS configuration");
}
return gson.fromJson(Resources.asCharSource(resource, Charsets.UTF_8).openStream(),
VCSConfiguration.class);
} catch (IOException e) {
throw new IncorrectConfigurationException("Unable to read VCS configuration", e);
}
} | java | @Provides
public VCSConfiguration loadConfiguration(Gson gson) {
try {
URL resource = ResourceUtils.getResourceAsURL(VCS_CONFIG_JSON);
if (null == resource) {
throw new IncorrectConfigurationException("Unable to find VCS configuration");
}
return gson.fromJson(Resources.asCharSource(resource, Charsets.UTF_8).openStream(),
VCSConfiguration.class);
} catch (IOException e) {
throw new IncorrectConfigurationException("Unable to read VCS configuration", e);
}
} | [
"@",
"Provides",
"public",
"VCSConfiguration",
"loadConfiguration",
"(",
"Gson",
"gson",
")",
"{",
"try",
"{",
"URL",
"resource",
"=",
"ResourceUtils",
".",
"getResourceAsURL",
"(",
"VCS_CONFIG_JSON",
")",
";",
"if",
"(",
"null",
"==",
"resource",
")",
"{",
... | Loads VCS configuration
@param gson GSON for deserialization
@return Loaded configuration | [
"Loads",
"VCS",
"configuration"
] | fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8 | https://github.com/avarabyeu/jashing/blob/fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8/extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVcsModule.java#L52-L64 | train |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/KafkaQueue.java | KafkaQueue.takeFromQueue | protected IQueueMessage<ID, DATA> takeFromQueue() {
KafkaMessage kMsg = kafkaClient.consumeMessage(consumerGroupId, true, topicName, 1000,
TimeUnit.MILLISECONDS);
return kMsg != null ? deserialize(kMsg.content()) : null;
} | java | protected IQueueMessage<ID, DATA> takeFromQueue() {
KafkaMessage kMsg = kafkaClient.consumeMessage(consumerGroupId, true, topicName, 1000,
TimeUnit.MILLISECONDS);
return kMsg != null ? deserialize(kMsg.content()) : null;
} | [
"protected",
"IQueueMessage",
"<",
"ID",
",",
"DATA",
">",
"takeFromQueue",
"(",
")",
"{",
"KafkaMessage",
"kMsg",
"=",
"kafkaClient",
".",
"consumeMessage",
"(",
"consumerGroupId",
",",
"true",
",",
"topicName",
",",
"1000",
",",
"TimeUnit",
".",
"MILLISECOND... | Takes a message from Kafka queue.
@return
@since 0.3.3 | [
"Takes",
"a",
"message",
"from",
"Kafka",
"queue",
"."
] | b20776850d23111d3d71fc8ed6023c590bc3621f | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/KafkaQueue.java#L261-L265 | train |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java | ChatService.createSessionListener | public ParticipantListener createSessionListener(String sessionId, ISessionUpdate callback) {
return SessionService.create(self, sessionId, eventManager, callback);
} | java | public ParticipantListener createSessionListener(String sessionId, ISessionUpdate callback) {
return SessionService.create(self, sessionId, eventManager, callback);
} | [
"public",
"ParticipantListener",
"createSessionListener",
"(",
"String",
"sessionId",
",",
"ISessionUpdate",
"callback",
")",
"{",
"return",
"SessionService",
".",
"create",
"(",
"self",
",",
"sessionId",
",",
"eventManager",
",",
"callback",
")",
";",
"}"
] | Creates a session listener.
@param sessionId Chat session identifier.
@param callback The callback interface to invoke when a session update event has been
received.
@return The newly created session listener. | [
"Creates",
"a",
"session",
"listener",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java#L166-L168 | train |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java | ChatService.createSession | public void createSession(String sessionId) {
boolean newSession = sessionId == null;
sessionId = newSession ? newSessionId() : sessionId;
SessionController controller = sessions.get(sessionId);
if (controller == null) {
controller = SessionController.create(sessionId, newSession);
sessions.put(sessionId, controller);
}
} | java | public void createSession(String sessionId) {
boolean newSession = sessionId == null;
sessionId = newSession ? newSessionId() : sessionId;
SessionController controller = sessions.get(sessionId);
if (controller == null) {
controller = SessionController.create(sessionId, newSession);
sessions.put(sessionId, controller);
}
} | [
"public",
"void",
"createSession",
"(",
"String",
"sessionId",
")",
"{",
"boolean",
"newSession",
"=",
"sessionId",
"==",
"null",
";",
"sessionId",
"=",
"newSession",
"?",
"newSessionId",
"(",
")",
":",
"sessionId",
";",
"SessionController",
"controller",
"=",
... | Creates a new session with the specified session id.
@param sessionId The session id to associate with the new session. | [
"Creates",
"a",
"new",
"session",
"with",
"the",
"specified",
"session",
"id",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java#L201-L210 | train |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java | ChatService.setActive | public void setActive(boolean active) {
if (this.active != active) {
this.active = active;
inviteListener.setActive(active);
acceptListener.setActive(active);
participants.clear();
participants.add(self);
participantListener.setActive(active);
}
} | java | public void setActive(boolean active) {
if (this.active != active) {
this.active = active;
inviteListener.setActive(active);
acceptListener.setActive(active);
participants.clear();
participants.add(self);
participantListener.setActive(active);
}
} | [
"public",
"void",
"setActive",
"(",
"boolean",
"active",
")",
"{",
"if",
"(",
"this",
".",
"active",
"!=",
"active",
")",
"{",
"this",
".",
"active",
"=",
"active",
";",
"inviteListener",
".",
"setActive",
"(",
"active",
")",
";",
"acceptListener",
".",
... | Sets the listening state of the service. When set to false, the service stops listening to
all events.
@param active The active state. | [
"Sets",
"the",
"listening",
"state",
"of",
"the",
"service",
".",
"When",
"set",
"to",
"false",
"the",
"service",
"stops",
"listening",
"to",
"all",
"events",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java#L245-L254 | train |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java | ChatService.invite | public void invite(String sessionId, Collection<IPublisherInfo> invitees, boolean cancel) {
if (invitees == null || invitees.isEmpty()) {
return;
}
List<Recipient> recipients = new ArrayList<>();
for (IPublisherInfo invitee : invitees) {
recipients.add(new Recipient(RecipientType.SESSION, invitee.getSessionId()));
}
String eventData = sessionId + (cancel ? "" : "^" + self.getUserName());
Recipient[] recips = new Recipient[recipients.size()];
eventManager.fireRemoteEvent(EVENT_INVITE, eventData, recipients.toArray(recips));
} | java | public void invite(String sessionId, Collection<IPublisherInfo> invitees, boolean cancel) {
if (invitees == null || invitees.isEmpty()) {
return;
}
List<Recipient> recipients = new ArrayList<>();
for (IPublisherInfo invitee : invitees) {
recipients.add(new Recipient(RecipientType.SESSION, invitee.getSessionId()));
}
String eventData = sessionId + (cancel ? "" : "^" + self.getUserName());
Recipient[] recips = new Recipient[recipients.size()];
eventManager.fireRemoteEvent(EVENT_INVITE, eventData, recipients.toArray(recips));
} | [
"public",
"void",
"invite",
"(",
"String",
"sessionId",
",",
"Collection",
"<",
"IPublisherInfo",
">",
"invitees",
",",
"boolean",
"cancel",
")",
"{",
"if",
"(",
"invitees",
"==",
"null",
"||",
"invitees",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";... | Sends an invitation request to the specified invitees.
@param sessionId The id of the chat session making the invitation.
@param invitees The list of invitees. This will be used to constraint delivery of the
invitation event to only those subscribers.
@param cancel If true, invitees are sent a cancellation instead. | [
"Sends",
"an",
"invitation",
"request",
"to",
"the",
"specified",
"invitees",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java#L273-L287 | train |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/PropertiesIO.java | PropertiesIO.store | public static void store(String absolutePath, Properties configs) throws IOException {
OutputStream outStream = null;
try {
outStream = new FileOutputStream(new File(absolutePath));
configs.store(outStream, null);
} finally {
try {
if (outStream != null) {
outStream.close();
}
} catch (IOException ignore) {
// do nothing.
}
}
} | java | public static void store(String absolutePath, Properties configs) throws IOException {
OutputStream outStream = null;
try {
outStream = new FileOutputStream(new File(absolutePath));
configs.store(outStream, null);
} finally {
try {
if (outStream != null) {
outStream.close();
}
} catch (IOException ignore) {
// do nothing.
}
}
} | [
"public",
"static",
"void",
"store",
"(",
"String",
"absolutePath",
",",
"Properties",
"configs",
")",
"throws",
"IOException",
"{",
"OutputStream",
"outStream",
"=",
"null",
";",
"try",
"{",
"outStream",
"=",
"new",
"FileOutputStream",
"(",
"new",
"File",
"("... | Write into properties file.
@param absolutePath absolute path in file system.
@param configs all configs to write.
@throws java.io.IOException | [
"Write",
"into",
"properties",
"file",
"."
] | 4f2bf3f36df10195a978f122ed682ba1eb0462b5 | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/PropertiesIO.java#L88-L102 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebStartup.java | CareWebStartup.registerObject | @Override
public void registerObject(Object object) {
if (object instanceof ICareWebStartup) {
startupRoutines.add((ICareWebStartup) object);
}
} | java | @Override
public void registerObject(Object object) {
if (object instanceof ICareWebStartup) {
startupRoutines.add((ICareWebStartup) object);
}
} | [
"@",
"Override",
"public",
"void",
"registerObject",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"ICareWebStartup",
")",
"{",
"startupRoutines",
".",
"add",
"(",
"(",
"ICareWebStartup",
")",
"object",
")",
";",
"}",
"}"
] | Register a startup routine. | [
"Register",
"a",
"startup",
"routine",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebStartup.java#L49-L54 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebStartup.java | CareWebStartup.execute | public void execute() {
List<ICareWebStartup> temp = new ArrayList<>(startupRoutines);
for (ICareWebStartup startupRoutine : temp) {
try {
if (startupRoutine.execute()) {
unregisterObject(startupRoutine);
}
} catch (Throwable t) {
log.error("Error executing startup routine.", t);
unregisterObject(startupRoutine);
}
}
} | java | public void execute() {
List<ICareWebStartup> temp = new ArrayList<>(startupRoutines);
for (ICareWebStartup startupRoutine : temp) {
try {
if (startupRoutine.execute()) {
unregisterObject(startupRoutine);
}
} catch (Throwable t) {
log.error("Error executing startup routine.", t);
unregisterObject(startupRoutine);
}
}
} | [
"public",
"void",
"execute",
"(",
")",
"{",
"List",
"<",
"ICareWebStartup",
">",
"temp",
"=",
"new",
"ArrayList",
"<>",
"(",
"startupRoutines",
")",
";",
"for",
"(",
"ICareWebStartup",
"startupRoutine",
":",
"temp",
")",
"{",
"try",
"{",
"if",
"(",
"star... | Execute registered startup routines. | [
"Execute",
"registered",
"startup",
"routines",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebStartup.java#L69-L82 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementImage.java | ElementImage.setStretch | public void setStretch(boolean stretch) {
this.stretch = stretch;
image.setWidth(stretch ? "100%" : null);
image.setHeight(stretch ? "100%" : null);
} | java | public void setStretch(boolean stretch) {
this.stretch = stretch;
image.setWidth(stretch ? "100%" : null);
image.setHeight(stretch ? "100%" : null);
} | [
"public",
"void",
"setStretch",
"(",
"boolean",
"stretch",
")",
"{",
"this",
".",
"stretch",
"=",
"stretch",
";",
"image",
".",
"setWidth",
"(",
"stretch",
"?",
"\"100%\"",
":",
"null",
")",
";",
"image",
".",
"setHeight",
"(",
"stretch",
"?",
"\"100%\""... | Sets whether or not to stretch the image to fill its parent.
@param stretch Stretch setting. | [
"Sets",
"whether",
"or",
"not",
"to",
"stretch",
"the",
"image",
"to",
"fill",
"its",
"parent",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementImage.java#L86-L90 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java | SpringUtil.getBean | public static <T> T getBean(Class<T> clazz) {
ApplicationContext appContext = getAppContext();
try {
return appContext == null ? null : appContext.getBean(clazz);
} catch (Exception e) {
return null;
}
} | java | public static <T> T getBean(Class<T> clazz) {
ApplicationContext appContext = getAppContext();
try {
return appContext == null ? null : appContext.getBean(clazz);
} catch (Exception e) {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getBean",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"ApplicationContext",
"appContext",
"=",
"getAppContext",
"(",
")",
";",
"try",
"{",
"return",
"appContext",
"==",
"null",
"?",
"null",
":",
"appContext",
... | Return the bean of the specified class.
@param <T> The requested class.
@param clazz The bean class.
@return The requested bean instance, or null if not found. | [
"Return",
"the",
"bean",
"of",
"the",
"specified",
"class",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java#L119-L127 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java | SpringUtil.getProperty | public static String getProperty(String name) {
if (propertyProvider == null) {
initPropertyProvider();
}
return propertyProvider.getProperty(name);
} | java | public static String getProperty(String name) {
if (propertyProvider == null) {
initPropertyProvider();
}
return propertyProvider.getProperty(name);
} | [
"public",
"static",
"String",
"getProperty",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"propertyProvider",
"==",
"null",
")",
"{",
"initPropertyProvider",
"(",
")",
";",
"}",
"return",
"propertyProvider",
".",
"getProperty",
"(",
"name",
")",
";",
"}"
] | Returns a property value from the application context.
@param name Property name.
@return Property value, or null if not found. | [
"Returns",
"a",
"property",
"value",
"from",
"the",
"application",
"context",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java#L135-L141 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java | SpringUtil.getResource | public static Resource getResource(String location) {
Resource resource = resolver.getResource(location);
return resource.exists() ? resource : null;
} | java | public static Resource getResource(String location) {
Resource resource = resolver.getResource(location);
return resource.exists() ? resource : null;
} | [
"public",
"static",
"Resource",
"getResource",
"(",
"String",
"location",
")",
"{",
"Resource",
"resource",
"=",
"resolver",
".",
"getResource",
"(",
"location",
")",
";",
"return",
"resource",
".",
"exists",
"(",
")",
"?",
"resource",
":",
"null",
";",
"}... | Returns the resource at the specified location. Supports classpath references.
@param location The resource location.
@return The corresponding resource, or null if one does not exist. | [
"Returns",
"the",
"resource",
"at",
"the",
"specified",
"location",
".",
"Supports",
"classpath",
"references",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java#L155-L158 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java | SpringUtil.getResources | public static Resource[] getResources(String locationPattern) {
try {
return resolver.getResources(locationPattern);
} catch (IOException e) {
throw MiscUtil.toUnchecked(e);
}
} | java | public static Resource[] getResources(String locationPattern) {
try {
return resolver.getResources(locationPattern);
} catch (IOException e) {
throw MiscUtil.toUnchecked(e);
}
} | [
"public",
"static",
"Resource",
"[",
"]",
"getResources",
"(",
"String",
"locationPattern",
")",
"{",
"try",
"{",
"return",
"resolver",
".",
"getResources",
"(",
"locationPattern",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"MiscUtil... | Returns an array of resources matching the location pattern.
@param locationPattern The location pattern. Supports classpath references.
@return Array of matching resources. | [
"Returns",
"an",
"array",
"of",
"resources",
"matching",
"the",
"location",
"pattern",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java#L166-L172 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java | CareWebUtil.setShell | protected static void setShell(CareWebShell shell) {
if (getShell() != null) {
throw new RuntimeException("A CareWeb shell instance has already been registered.");
}
ExecutionContext.getPage().setAttribute(Constants.SHELL_INSTANCE, shell);
} | java | protected static void setShell(CareWebShell shell) {
if (getShell() != null) {
throw new RuntimeException("A CareWeb shell instance has already been registered.");
}
ExecutionContext.getPage().setAttribute(Constants.SHELL_INSTANCE, shell);
} | [
"protected",
"static",
"void",
"setShell",
"(",
"CareWebShell",
"shell",
")",
"{",
"if",
"(",
"getShell",
"(",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"A CareWeb shell instance has already been registered.\"",
")",
";",
"}",
"Execut... | Sets the active instance of the CareWeb shell. An exception is raised if an active instance
has already been set.
@param shell Shell to become the active instance. | [
"Sets",
"the",
"active",
"instance",
"of",
"the",
"CareWeb",
"shell",
".",
"An",
"exception",
"is",
"raised",
"if",
"an",
"active",
"instance",
"has",
"already",
"been",
"set",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java#L62-L68 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java | CareWebUtil.showMessage | public static void showMessage(String message, String caption) {
getShell().getMessageWindow().showMessage(message, caption);
} | java | public static void showMessage(String message, String caption) {
getShell().getMessageWindow().showMessage(message, caption);
} | [
"public",
"static",
"void",
"showMessage",
"(",
"String",
"message",
",",
"String",
"caption",
")",
"{",
"getShell",
"(",
")",
".",
"getMessageWindow",
"(",
")",
".",
"showMessage",
"(",
"message",
",",
"caption",
")",
";",
"}"
] | Sends an informational message for display by desktop.
@param message Text of the message.
@param caption Optional caption text. | [
"Sends",
"an",
"informational",
"message",
"for",
"display",
"by",
"desktop",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java#L83-L85 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java | CareWebUtil.showHelpTopic | public static void showHelpTopic(String module, String topic, String label) {
getShell().getHelpViewer();
HelpUtil.show(module, topic, label);
} | java | public static void showHelpTopic(String module, String topic, String label) {
getShell().getHelpViewer();
HelpUtil.show(module, topic, label);
} | [
"public",
"static",
"void",
"showHelpTopic",
"(",
"String",
"module",
",",
"String",
"topic",
",",
"String",
"label",
")",
"{",
"getShell",
"(",
")",
".",
"getHelpViewer",
"(",
")",
";",
"HelpUtil",
".",
"show",
"(",
"module",
",",
"topic",
",",
"label",... | Shows help topic in help viewer.
@param module The id of the help module.
@param topic The id of the desired topic.
@param label The label to display for the topic. | [
"Shows",
"help",
"topic",
"in",
"help",
"viewer",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java#L111-L114 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/SecurityUtil.java | SecurityUtil.getUrlMapping | public static String getUrlMapping(String url, Map<String, String> urlMappings) {
if (urlMappings != null) {
for (String pattern : urlMappings.keySet()) {
if (urlMatcher.match(pattern, url)) {
return urlMappings.get(pattern);
}
}
}
return null;
} | java | public static String getUrlMapping(String url, Map<String, String> urlMappings) {
if (urlMappings != null) {
for (String pattern : urlMappings.keySet()) {
if (urlMatcher.match(pattern, url)) {
return urlMappings.get(pattern);
}
}
}
return null;
} | [
"public",
"static",
"String",
"getUrlMapping",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"urlMappings",
")",
"{",
"if",
"(",
"urlMappings",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"pattern",
":",
"urlMappings",
".",
"keyS... | Returns the target of a url pattern mapping.
@param url Ant-style url pattern
@param urlMappings Map of url pattern mappings
@return String mapped to pattern, or null if none. | [
"Returns",
"the",
"target",
"of",
"a",
"url",
"pattern",
"mapping",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/SecurityUtil.java#L156-L166 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/SecurityUtil.java | SecurityUtil.generateRandomPassword | public static String generateRandomPassword(int minLength, int maxLength, String[] constraints) {
if (constraints == null || constraints.length == 0 || minLength <= 0 || maxLength < minLength) {
throw new IllegalArgumentException();
}
int pwdLength = RandomUtils.nextInt(maxLength - minLength + 1) + minLength;
int[] min = new int[constraints.length];
String[] chars = new String[constraints.length];
char[] pwd = new char[pwdLength];
int totalRequired = 0;
for (int i = 0; i < constraints.length; i++) {
String[] pcs = constraints[i].split("\\,", 2);
min[i] = Integer.parseInt(pcs[0]);
chars[i] = pcs[1];
totalRequired += min[i];
}
if (totalRequired > maxLength) {
throw new IllegalArgumentException("Maximum length and constraints in conflict.");
}
int grp = 0;
while (pwdLength-- > 0) {
if (min[grp] <= 0) {
grp = totalRequired > 0 ? grp + 1 : RandomUtils.nextInt(constraints.length);
}
int i = RandomUtils.nextInt(pwd.length);
while (pwd[i] != 0) {
i = ++i % pwd.length;
}
pwd[i] = chars[grp].charAt(RandomUtils.nextInt(chars[grp].length()));
min[grp]--;
totalRequired--;
}
return new String(pwd);
} | java | public static String generateRandomPassword(int minLength, int maxLength, String[] constraints) {
if (constraints == null || constraints.length == 0 || minLength <= 0 || maxLength < minLength) {
throw new IllegalArgumentException();
}
int pwdLength = RandomUtils.nextInt(maxLength - minLength + 1) + minLength;
int[] min = new int[constraints.length];
String[] chars = new String[constraints.length];
char[] pwd = new char[pwdLength];
int totalRequired = 0;
for (int i = 0; i < constraints.length; i++) {
String[] pcs = constraints[i].split("\\,", 2);
min[i] = Integer.parseInt(pcs[0]);
chars[i] = pcs[1];
totalRequired += min[i];
}
if (totalRequired > maxLength) {
throw new IllegalArgumentException("Maximum length and constraints in conflict.");
}
int grp = 0;
while (pwdLength-- > 0) {
if (min[grp] <= 0) {
grp = totalRequired > 0 ? grp + 1 : RandomUtils.nextInt(constraints.length);
}
int i = RandomUtils.nextInt(pwd.length);
while (pwd[i] != 0) {
i = ++i % pwd.length;
}
pwd[i] = chars[grp].charAt(RandomUtils.nextInt(chars[grp].length()));
min[grp]--;
totalRequired--;
}
return new String(pwd);
} | [
"public",
"static",
"String",
"generateRandomPassword",
"(",
"int",
"minLength",
",",
"int",
"maxLength",
",",
"String",
"[",
"]",
"constraints",
")",
"{",
"if",
"(",
"constraints",
"==",
"null",
"||",
"constraints",
".",
"length",
"==",
"0",
"||",
"minLengt... | Generates a random password within the specified parameters.
@param minLength Minimum password length.
@param maxLength Maximum password length.
@param constraints Password constraints. This is an array of character groups, each of the
format <br>
<code>[minimum required occurrences],[string of characters in group]</code>
@return A random password. | [
"Generates",
"a",
"random",
"password",
"within",
"the",
"specified",
"parameters",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/SecurityUtil.java#L178-L219 | train |
kuali/kc-s2sgen | coeus-s2sgen-api/src/main/java/org/kuali/coeus/s2sgen/api/core/S2SException.java | S2SException.getMessageWithParams | public String[] getMessageWithParams() {
String[] messageWithParams = new String[getParams().length+1];
messageWithParams[0]=errorMessage;
System.arraycopy(params, 0, messageWithParams, 1, messageWithParams.length - 1);
return messageWithParams;
} | java | public String[] getMessageWithParams() {
String[] messageWithParams = new String[getParams().length+1];
messageWithParams[0]=errorMessage;
System.arraycopy(params, 0, messageWithParams, 1, messageWithParams.length - 1);
return messageWithParams;
} | [
"public",
"String",
"[",
"]",
"getMessageWithParams",
"(",
")",
"{",
"String",
"[",
"]",
"messageWithParams",
"=",
"new",
"String",
"[",
"getParams",
"(",
")",
".",
"length",
"+",
"1",
"]",
";",
"messageWithParams",
"[",
"0",
"]",
"=",
"errorMessage",
";... | This method returns the message as the first element followed by all params.
@return message and parameters in an array. | [
"This",
"method",
"returns",
"the",
"message",
"as",
"the",
"first",
"element",
"followed",
"by",
"all",
"params",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-api/src/main/java/org/kuali/coeus/s2sgen/api/core/S2SException.java#L78-L83 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java | LayoutService.validateName | @Override
public boolean validateName(String name) {
return name != null && !name.isEmpty() && StringUtils.isAlphanumericSpace(name.replace('_', ' '));
} | java | @Override
public boolean validateName(String name) {
return name != null && !name.isEmpty() && StringUtils.isAlphanumericSpace(name.replace('_', ' '));
} | [
"@",
"Override",
"public",
"boolean",
"validateName",
"(",
"String",
"name",
")",
"{",
"return",
"name",
"!=",
"null",
"&&",
"!",
"name",
".",
"isEmpty",
"(",
")",
"&&",
"StringUtils",
".",
"isAlphanumericSpace",
"(",
"name",
".",
"replace",
"(",
"'",
"'... | Validates a layout name.
@param name Layout name to validate.
@return True if the name is valid. | [
"Validates",
"a",
"layout",
"name",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java#L57-L60 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java | LayoutService.layoutExists | @Override
public boolean layoutExists(LayoutIdentifier layout) {
return getLayouts(layout.shared).contains(layout.name);
} | java | @Override
public boolean layoutExists(LayoutIdentifier layout) {
return getLayouts(layout.shared).contains(layout.name);
} | [
"@",
"Override",
"public",
"boolean",
"layoutExists",
"(",
"LayoutIdentifier",
"layout",
")",
"{",
"return",
"getLayouts",
"(",
"layout",
".",
"shared",
")",
".",
"contains",
"(",
"layout",
".",
"name",
")",
";",
"}"
] | Returns true if the specified layout exists.
@param layout The layout identifier.
@return True if layout exists. | [
"Returns",
"true",
"if",
"the",
"specified",
"layout",
"exists",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java#L68-L71 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java | LayoutService.saveLayout | @Override
public void saveLayout(LayoutIdentifier layout, String content) {
propertyService.saveValue(getPropertyName(layout.shared), layout.name, layout.shared, content);
} | java | @Override
public void saveLayout(LayoutIdentifier layout, String content) {
propertyService.saveValue(getPropertyName(layout.shared), layout.name, layout.shared, content);
} | [
"@",
"Override",
"public",
"void",
"saveLayout",
"(",
"LayoutIdentifier",
"layout",
",",
"String",
"content",
")",
"{",
"propertyService",
".",
"saveValue",
"(",
"getPropertyName",
"(",
"layout",
".",
"shared",
")",
",",
"layout",
".",
"name",
",",
"layout",
... | Saves a layout with the specified name and content.
@param layout The layout identifier.
@param content The layout content. | [
"Saves",
"a",
"layout",
"with",
"the",
"specified",
"name",
"and",
"content",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java#L79-L82 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java | LayoutService.renameLayout | @Override
public void renameLayout(LayoutIdentifier layout, String newName) {
String text = getLayoutContent(layout);
saveLayout(new LayoutIdentifier(newName, layout.shared), text);
deleteLayout(layout);
} | java | @Override
public void renameLayout(LayoutIdentifier layout, String newName) {
String text = getLayoutContent(layout);
saveLayout(new LayoutIdentifier(newName, layout.shared), text);
deleteLayout(layout);
} | [
"@",
"Override",
"public",
"void",
"renameLayout",
"(",
"LayoutIdentifier",
"layout",
",",
"String",
"newName",
")",
"{",
"String",
"text",
"=",
"getLayoutContent",
"(",
"layout",
")",
";",
"saveLayout",
"(",
"new",
"LayoutIdentifier",
"(",
"newName",
",",
"la... | Rename a layout.
@param layout The original layout identifier.
@param newName The new layout name. | [
"Rename",
"a",
"layout",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java#L90-L95 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.