id
int32 0
165k
| repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
list | docstring
stringlengths 3
16k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 105
339
|
|---|---|---|---|---|---|---|---|---|---|---|---|
152,400
|
krotscheck/data-file-reader
|
data-file-reader-csv/src/main/java/net/krotscheck/dfr/csv/CSVDataEncoder.java
|
CSVDataEncoder.buildCsvSchema
|
public CsvSchema buildCsvSchema(final Map<String, Object> row) {
CsvSchema.Builder builder = CsvSchema.builder();
Set<String> fields = row.keySet();
for (String field : fields) {
builder.addColumn(field);
}
return builder.build();
}
|
java
|
public CsvSchema buildCsvSchema(final Map<String, Object> row) {
CsvSchema.Builder builder = CsvSchema.builder();
Set<String> fields = row.keySet();
for (String field : fields) {
builder.addColumn(field);
}
return builder.build();
}
|
[
"public",
"CsvSchema",
"buildCsvSchema",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"row",
")",
"{",
"CsvSchema",
".",
"Builder",
"builder",
"=",
"CsvSchema",
".",
"builder",
"(",
")",
";",
"Set",
"<",
"String",
">",
"fields",
"=",
"row",
".",
"keySet",
"(",
")",
";",
"for",
"(",
"String",
"field",
":",
"fields",
")",
"{",
"builder",
".",
"addColumn",
"(",
"field",
")",
";",
"}",
"return",
"builder",
".",
"build",
"(",
")",
";",
"}"
] |
Extrapolate the CSV columns from the row keys.
@param row A row.
@return A constructed CSV schema.
|
[
"Extrapolate",
"the",
"CSV",
"columns",
"from",
"the",
"row",
"keys",
"."
] |
b9a85bd07dc9f9b8291ffbfb6945443d96371811
|
https://github.com/krotscheck/data-file-reader/blob/b9a85bd07dc9f9b8291ffbfb6945443d96371811/data-file-reader-csv/src/main/java/net/krotscheck/dfr/csv/CSVDataEncoder.java#L77-L86
|
152,401
|
Multifarious/MacroManager
|
src/main/java/com/fasterxml/mama/balancing/CountBalancingPolicy.java
|
CountBalancingPolicy.getMaxToClaim
|
public int getMaxToClaim(int nodeCount) {
synchronized (cluster.allWorkUnits) {
final int total = cluster.allWorkUnits.size();
if (total <= 1) {
return total;
}
return (int) Math.ceil(total / (double) nodeCount);
}
}
|
java
|
public int getMaxToClaim(int nodeCount) {
synchronized (cluster.allWorkUnits) {
final int total = cluster.allWorkUnits.size();
if (total <= 1) {
return total;
}
return (int) Math.ceil(total / (double) nodeCount);
}
}
|
[
"public",
"int",
"getMaxToClaim",
"(",
"int",
"nodeCount",
")",
"{",
"synchronized",
"(",
"cluster",
".",
"allWorkUnits",
")",
"{",
"final",
"int",
"total",
"=",
"cluster",
".",
"allWorkUnits",
".",
"size",
"(",
")",
";",
"if",
"(",
"total",
"<=",
"1",
")",
"{",
"return",
"total",
";",
"}",
"return",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"total",
"/",
"(",
"double",
")",
"nodeCount",
")",
";",
"}",
"}"
] |
Determines the maximum number of work units the policy should attempt to claim.
|
[
"Determines",
"the",
"maximum",
"number",
"of",
"work",
"units",
"the",
"policy",
"should",
"attempt",
"to",
"claim",
"."
] |
559785839981f460aaeba3c3fddff7fb667d9581
|
https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/CountBalancingPolicy.java#L68-L76
|
152,402
|
tvesalainen/util
|
util/src/main/java/org/vesalainen/math/MoreMath.java
|
MoreMath.integral
|
public static double integral(DoubleUnaryOperator f, double x1, double x2, int points)
{
double delta = (x2-x1)/points;
double delta2 = delta/2.0;
double sum = 0;
double y1 = f.applyAsDouble(x1);
double y2;
for (int ii=1;ii<=points;ii++)
{
x1 += delta;
y2 = f.applyAsDouble(x1);
sum += (y1+y2)*delta2;
y1 = y2;
}
return sum;
}
|
java
|
public static double integral(DoubleUnaryOperator f, double x1, double x2, int points)
{
double delta = (x2-x1)/points;
double delta2 = delta/2.0;
double sum = 0;
double y1 = f.applyAsDouble(x1);
double y2;
for (int ii=1;ii<=points;ii++)
{
x1 += delta;
y2 = f.applyAsDouble(x1);
sum += (y1+y2)*delta2;
y1 = y2;
}
return sum;
}
|
[
"public",
"static",
"double",
"integral",
"(",
"DoubleUnaryOperator",
"f",
",",
"double",
"x1",
",",
"double",
"x2",
",",
"int",
"points",
")",
"{",
"double",
"delta",
"=",
"(",
"x2",
"-",
"x1",
")",
"/",
"points",
";",
"double",
"delta2",
"=",
"delta",
"/",
"2.0",
";",
"double",
"sum",
"=",
"0",
";",
"double",
"y1",
"=",
"f",
".",
"applyAsDouble",
"(",
"x1",
")",
";",
"double",
"y2",
";",
"for",
"(",
"int",
"ii",
"=",
"1",
";",
"ii",
"<=",
"points",
";",
"ii",
"++",
")",
"{",
"x1",
"+=",
"delta",
";",
"y2",
"=",
"f",
".",
"applyAsDouble",
"(",
"x1",
")",
";",
"sum",
"+=",
"(",
"y1",
"+",
"y2",
")",
"*",
"delta2",
";",
"y1",
"=",
"y2",
";",
"}",
"return",
"sum",
";",
"}"
] |
Returns numerical integral between x1 and x2
@param x1
@param x2
@param points
@return
|
[
"Returns",
"numerical",
"integral",
"between",
"x1",
"and",
"x2"
] |
bba7a44689f638ffabc8be40a75bdc9a33676433
|
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/MoreMath.java#L43-L58
|
152,403
|
tvesalainen/util
|
util/src/main/java/org/vesalainen/math/MoreMath.java
|
MoreMath.dx
|
public static DoubleBinaryOperator dx(DoubleBinaryOperator f)
{
return (x,y)->
{
double h = x != 0.0 ? SQRT_EPSILON*x : SQRT_EPSILON;
double h2 = 2.0*h;
double y1 = -f.applyAsDouble(x+h2, y);
double y2 = 8.0*f.applyAsDouble(x+h, y);
double y3 = -8.0*f.applyAsDouble(x-h, y);
double y4 = f.applyAsDouble(x-h2, y);
return (y1+y2+y3+y4)/(12.0*h);
};
}
|
java
|
public static DoubleBinaryOperator dx(DoubleBinaryOperator f)
{
return (x,y)->
{
double h = x != 0.0 ? SQRT_EPSILON*x : SQRT_EPSILON;
double h2 = 2.0*h;
double y1 = -f.applyAsDouble(x+h2, y);
double y2 = 8.0*f.applyAsDouble(x+h, y);
double y3 = -8.0*f.applyAsDouble(x-h, y);
double y4 = f.applyAsDouble(x-h2, y);
return (y1+y2+y3+y4)/(12.0*h);
};
}
|
[
"public",
"static",
"DoubleBinaryOperator",
"dx",
"(",
"DoubleBinaryOperator",
"f",
")",
"{",
"return",
"(",
"x",
",",
"y",
")",
"->",
"{",
"double",
"h",
"=",
"x",
"!=",
"0.0",
"?",
"SQRT_EPSILON",
"*",
"x",
":",
"SQRT_EPSILON",
";",
"double",
"h2",
"=",
"2.0",
"*",
"h",
";",
"double",
"y1",
"=",
"-",
"f",
".",
"applyAsDouble",
"(",
"x",
"+",
"h2",
",",
"y",
")",
";",
"double",
"y2",
"=",
"8.0",
"*",
"f",
".",
"applyAsDouble",
"(",
"x",
"+",
"h",
",",
"y",
")",
";",
"double",
"y3",
"=",
"-",
"8.0",
"*",
"f",
".",
"applyAsDouble",
"(",
"x",
"-",
"h",
",",
"y",
")",
";",
"double",
"y4",
"=",
"f",
".",
"applyAsDouble",
"(",
"x",
"-",
"h2",
",",
"y",
")",
";",
"return",
"(",
"y1",
"+",
"y2",
"+",
"y3",
"+",
"y4",
")",
"/",
"(",
"12.0",
"*",
"h",
")",
";",
"}",
";",
"}"
] |
Return partial derivative x
@param f
@return
|
[
"Return",
"partial",
"derivative",
"x"
] |
bba7a44689f638ffabc8be40a75bdc9a33676433
|
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/MoreMath.java#L74-L86
|
152,404
|
tvesalainen/util
|
util/src/main/java/org/vesalainen/math/MoreMath.java
|
MoreMath.gradient
|
public static DoubleBinaryMatrix gradient(DoubleTransform t)
{
return new DoubleBinaryMatrix(2,
MoreMath.dx(t.fx()),
MoreMath.dy(t.fx()),
MoreMath.dx(t.fy()),
MoreMath.dy(t.fy())
);
}
|
java
|
public static DoubleBinaryMatrix gradient(DoubleTransform t)
{
return new DoubleBinaryMatrix(2,
MoreMath.dx(t.fx()),
MoreMath.dy(t.fx()),
MoreMath.dx(t.fy()),
MoreMath.dy(t.fy())
);
}
|
[
"public",
"static",
"DoubleBinaryMatrix",
"gradient",
"(",
"DoubleTransform",
"t",
")",
"{",
"return",
"new",
"DoubleBinaryMatrix",
"(",
"2",
",",
"MoreMath",
".",
"dx",
"(",
"t",
".",
"fx",
"(",
")",
")",
",",
"MoreMath",
".",
"dy",
"(",
"t",
".",
"fx",
"(",
")",
")",
",",
"MoreMath",
".",
"dx",
"(",
"t",
".",
"fy",
"(",
")",
")",
",",
"MoreMath",
".",
"dy",
"(",
"t",
".",
"fy",
"(",
")",
")",
")",
";",
"}"
] |
Returns Jacobian matrix
@return
|
[
"Returns",
"Jacobian",
"matrix"
] |
bba7a44689f638ffabc8be40a75bdc9a33676433
|
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/MoreMath.java#L109-L117
|
152,405
|
js-lib-com/commons
|
src/main/java/js/converter/ClassConverter.java
|
ClassConverter.asObject
|
@Override
public <T> T asObject(String string, Class<T> valueType) {
// at this point value type is a class
if (string.isEmpty())
return null;
// uses this library Classes#forName instead of Java standard Class#forName
// first uses current thread context loader whereas the second uses library loader
// as a consequence classes defined by web app could not be found if use Java standard Class#forName
try {
return (T) Classes.forName(string);
} catch (NoSuchBeingException e) {
log.warn("Class |%s| not found. Class converter force return value to null.", string);
return null;
}
}
|
java
|
@Override
public <T> T asObject(String string, Class<T> valueType) {
// at this point value type is a class
if (string.isEmpty())
return null;
// uses this library Classes#forName instead of Java standard Class#forName
// first uses current thread context loader whereas the second uses library loader
// as a consequence classes defined by web app could not be found if use Java standard Class#forName
try {
return (T) Classes.forName(string);
} catch (NoSuchBeingException e) {
log.warn("Class |%s| not found. Class converter force return value to null.", string);
return null;
}
}
|
[
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"{",
"// at this point value type is a class\r",
"if",
"(",
"string",
".",
"isEmpty",
"(",
")",
")",
"return",
"null",
";",
"// uses this library Classes#forName instead of Java standard Class#forName\r",
"// first uses current thread context loader whereas the second uses library loader\r",
"// as a consequence classes defined by web app could not be found if use Java standard Class#forName\r",
"try",
"{",
"return",
"(",
"T",
")",
"Classes",
".",
"forName",
"(",
"string",
")",
";",
"}",
"catch",
"(",
"NoSuchBeingException",
"e",
")",
"{",
"log",
".",
"warn",
"(",
"\"Class |%s| not found. Class converter force return value to null.\"",
",",
"string",
")",
";",
"return",
"null",
";",
"}",
"}"
] |
Return the Java class instance for given canonical name. If given string is empty returns null. If class not found warn
to logger and also returns null.
|
[
"Return",
"the",
"Java",
"class",
"instance",
"for",
"given",
"canonical",
"name",
".",
"If",
"given",
"string",
"is",
"empty",
"returns",
"null",
".",
"If",
"class",
"not",
"found",
"warn",
"to",
"logger",
"and",
"also",
"returns",
"null",
"."
] |
f8c64482142b163487745da74feb106f0765c16b
|
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/ClassConverter.java#L27-L43
|
152,406
|
js-lib-com/commons
|
src/main/java/js/converter/ClassConverter.java
|
ClassConverter.asString
|
@Override
public String asString(Object object) {
assert object != null;
assert object instanceof Class;
return ((Class<?>) object).getCanonicalName();
}
|
java
|
@Override
public String asString(Object object) {
assert object != null;
assert object instanceof Class;
return ((Class<?>) object).getCanonicalName();
}
|
[
"@",
"Override",
"public",
"String",
"asString",
"(",
"Object",
"object",
")",
"{",
"assert",
"object",
"!=",
"null",
";",
"assert",
"object",
"instanceof",
"Class",
";",
"return",
"(",
"(",
"Class",
"<",
"?",
">",
")",
"object",
")",
".",
"getCanonicalName",
"(",
")",
";",
"}"
] |
Get string representation for given Java class instance. Return class canonical name.
|
[
"Get",
"string",
"representation",
"for",
"given",
"Java",
"class",
"instance",
".",
"Return",
"class",
"canonical",
"name",
"."
] |
f8c64482142b163487745da74feb106f0765c16b
|
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/ClassConverter.java#L46-L51
|
152,407
|
jbundle/jbundle
|
base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java
|
ToolScreen.setupDisplaySFields
|
public void setupDisplaySFields()
{
new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.FORMLINK);
}
|
java
|
public void setupDisplaySFields()
{
new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.FORMLINK);
}
|
[
"public",
"void",
"setupDisplaySFields",
"(",
")",
"{",
"new",
"SCannedBox",
"(",
"this",
".",
"getNextLocation",
"(",
"ScreenConstants",
".",
"RIGHT_OF_LAST_BUTTON_WITH_GAP",
",",
"ScreenConstants",
".",
"SET_ANCHOR",
")",
",",
"this",
",",
"null",
",",
"ScreenConstants",
".",
"DEFAULT_DISPLAY",
",",
"MenuConstants",
".",
"FORMLINK",
")",
";",
"}"
] |
Controls for a display screen.
|
[
"Controls",
"for",
"a",
"display",
"screen",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java#L148-L151
|
152,408
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.setupFields
|
public void setupFields()
{
FieldInfo field = null;
for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < 256; iFieldSeq++)
{
field = this.setupField(iFieldSeq); // Allocate this Field (may be overidden)
if (field == null)
break; // End of fields
}
}
|
java
|
public void setupFields()
{
FieldInfo field = null;
for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < 256; iFieldSeq++)
{
field = this.setupField(iFieldSeq); // Allocate this Field (may be overidden)
if (field == null)
break; // End of fields
}
}
|
[
"public",
"void",
"setupFields",
"(",
")",
"{",
"FieldInfo",
"field",
"=",
"null",
";",
"for",
"(",
"int",
"iFieldSeq",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"iFieldSeq",
"<",
"256",
";",
"iFieldSeq",
"++",
")",
"{",
"field",
"=",
"this",
".",
"setupField",
"(",
"iFieldSeq",
")",
";",
"// Allocate this Field (may be overidden)",
"if",
"(",
"field",
"==",
"null",
")",
"break",
";",
"// End of fields",
"}",
"}"
] |
Set up all the fields for this record.
|
[
"Set",
"up",
"all",
"the",
"fields",
"for",
"this",
"record",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L271-L280
|
152,409
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.setupKeys
|
public void setupKeys()
{
KeyArea keyArea = null;
for (int iKeyArea = DBConstants.MAIN_KEY_FIELD; iKeyArea < 64; iKeyArea++)
{
keyArea = this.setupKey(iKeyArea); // Allocate this Key (overidden in file class)
if (keyArea == null)
break; // End of Keys
}
}
|
java
|
public void setupKeys()
{
KeyArea keyArea = null;
for (int iKeyArea = DBConstants.MAIN_KEY_FIELD; iKeyArea < 64; iKeyArea++)
{
keyArea = this.setupKey(iKeyArea); // Allocate this Key (overidden in file class)
if (keyArea == null)
break; // End of Keys
}
}
|
[
"public",
"void",
"setupKeys",
"(",
")",
"{",
"KeyArea",
"keyArea",
"=",
"null",
";",
"for",
"(",
"int",
"iKeyArea",
"=",
"DBConstants",
".",
"MAIN_KEY_FIELD",
";",
"iKeyArea",
"<",
"64",
";",
"iKeyArea",
"++",
")",
"{",
"keyArea",
"=",
"this",
".",
"setupKey",
"(",
"iKeyArea",
")",
";",
"// Allocate this Key (overidden in file class)",
"if",
"(",
"keyArea",
"==",
"null",
")",
"break",
";",
"// End of Keys",
"}",
"}"
] |
Set up all the key areas for this record.
|
[
"Set",
"up",
"all",
"the",
"key",
"areas",
"for",
"this",
"record",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L294-L303
|
152,410
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.doAddListener
|
public void doAddListener(BaseListener listener)
{
if (m_listener != null)
m_listener.doAddListener((FileListener)listener);
else
m_listener = (FileListener)listener;
boolean bOldState = listener.setEnabledListener(false); // To disable recursive forever loop!
listener.setOwner(this);
listener.setEnabledListener(bOldState); // Renable the listener to eliminate echos
}
|
java
|
public void doAddListener(BaseListener listener)
{
if (m_listener != null)
m_listener.doAddListener((FileListener)listener);
else
m_listener = (FileListener)listener;
boolean bOldState = listener.setEnabledListener(false); // To disable recursive forever loop!
listener.setOwner(this);
listener.setEnabledListener(bOldState); // Renable the listener to eliminate echos
}
|
[
"public",
"void",
"doAddListener",
"(",
"BaseListener",
"listener",
")",
"{",
"if",
"(",
"m_listener",
"!=",
"null",
")",
"m_listener",
".",
"doAddListener",
"(",
"(",
"FileListener",
")",
"listener",
")",
";",
"else",
"m_listener",
"=",
"(",
"FileListener",
")",
"listener",
";",
"boolean",
"bOldState",
"=",
"listener",
".",
"setEnabledListener",
"(",
"false",
")",
";",
"// To disable recursive forever loop!",
"listener",
".",
"setOwner",
"(",
"this",
")",
";",
"listener",
".",
"setEnabledListener",
"(",
"bOldState",
")",
";",
"// Renable the listener to eliminate echos",
"}"
] |
Internal method to add a listener to the end of the chain.
Sets the listener's owner to this.
@param theBehavior Listener or Filter to add to this record.
|
[
"Internal",
"method",
"to",
"add",
"a",
"listener",
"to",
"the",
"end",
"of",
"the",
"chain",
".",
"Sets",
"the",
"listener",
"s",
"owner",
"to",
"this",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L441-L450
|
152,411
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.removeListener
|
public void removeListener(BaseListener theBehavior, boolean bFreeBehavior)
{
if (m_listener != null)
{
if (m_listener == theBehavior)
{
m_listener = (FileListener)theBehavior.getNextListener();
theBehavior.unlink(bFreeBehavior); // remove theBehavior from the linked list
}
else
m_listener.removeListener(theBehavior, bFreeBehavior);
}
}
|
java
|
public void removeListener(BaseListener theBehavior, boolean bFreeBehavior)
{
if (m_listener != null)
{
if (m_listener == theBehavior)
{
m_listener = (FileListener)theBehavior.getNextListener();
theBehavior.unlink(bFreeBehavior); // remove theBehavior from the linked list
}
else
m_listener.removeListener(theBehavior, bFreeBehavior);
}
}
|
[
"public",
"void",
"removeListener",
"(",
"BaseListener",
"theBehavior",
",",
"boolean",
"bFreeBehavior",
")",
"{",
"if",
"(",
"m_listener",
"!=",
"null",
")",
"{",
"if",
"(",
"m_listener",
"==",
"theBehavior",
")",
"{",
"m_listener",
"=",
"(",
"FileListener",
")",
"theBehavior",
".",
"getNextListener",
"(",
")",
";",
"theBehavior",
".",
"unlink",
"(",
"bFreeBehavior",
")",
";",
"// remove theBehavior from the linked list",
"}",
"else",
"m_listener",
".",
"removeListener",
"(",
"theBehavior",
",",
"bFreeBehavior",
")",
";",
"}",
"}"
] |
Remove a listener from the chain.
@param theBehavior Listener or Filter to add to this record.
@param bFreeBehavior Free the behavior.
|
[
"Remove",
"a",
"listener",
"from",
"the",
"chain",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L456-L468
|
152,412
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.setEnableNonFilter
|
public Object[] setEnableNonFilter(Object[] rgobjEnable, boolean bHasNext, boolean bBreak, boolean bAfterRequery, boolean bSelectEOF, boolean bFieldListeners)
{
boolean bEnable = (rgobjEnable == null) ? false : true;
if (bFieldListeners)
{
if (rgobjEnable == null)
rgobjEnable = this.setEnableFieldListeners(bEnable);
else
this.setEnableFieldListeners(rgobjEnable);
}
else
{
if (rgobjEnable == null)
rgobjEnable = new Object[0];
}
FileListener listener = this.getListener();
int iCount = this.getFieldCount();
while (listener != null)
{
if (!(listener instanceof org.jbundle.base.db.filter.FileFilter))
{
if (!bEnable)
{
rgobjEnable = Utility.growArray(rgobjEnable, iCount + 1, 8);
if (listener.isEnabledListener())
rgobjEnable[iCount] = Boolean.TRUE;
else
rgobjEnable[iCount] = Boolean.FALSE;
listener.setEnabledListener(bEnable);
}
else
{ // Enable
boolean bEnableThis = true;
if (iCount < rgobjEnable.length)
if (rgobjEnable[iCount] != null)
bEnableThis = ((Boolean)rgobjEnable[iCount]).booleanValue();
listener.setEnabledListener(bEnableThis);
}
iCount++;
}
listener = (FileListener)listener.getNextListener();
}
if (bEnable)
{
if (bAfterRequery)
this.handleRecordChange(null, DBConstants.AFTER_REQUERY_TYPE, true);
if (bBreak)
this.handleRecordChange(null, DBConstants.CONTROL_BREAK_TYPE, true);
if (bHasNext)
{
this.handleValidRecord(true);
this.handleRecordChange(null, DBConstants.MOVE_NEXT_TYPE, true);
}
if (bSelectEOF)
this.handleRecordChange(null, DBConstants.SELECT_EOF_TYPE, true);
if (this.getTable().getCurrentTable().getRecord() != this)
{ // Special logic - match listeners on current record (if shared)
boolean bCloneListeners = false;
boolean bMatchEnabledState = true;
boolean bSyncReferenceFields = false;
boolean bMatchSelectedState = true;
this.matchListeners(this.getTable().getCurrentTable().getRecord(), bCloneListeners, bMatchEnabledState, bSyncReferenceFields, bMatchSelectedState, true);
}
}
return rgobjEnable;
}
|
java
|
public Object[] setEnableNonFilter(Object[] rgobjEnable, boolean bHasNext, boolean bBreak, boolean bAfterRequery, boolean bSelectEOF, boolean bFieldListeners)
{
boolean bEnable = (rgobjEnable == null) ? false : true;
if (bFieldListeners)
{
if (rgobjEnable == null)
rgobjEnable = this.setEnableFieldListeners(bEnable);
else
this.setEnableFieldListeners(rgobjEnable);
}
else
{
if (rgobjEnable == null)
rgobjEnable = new Object[0];
}
FileListener listener = this.getListener();
int iCount = this.getFieldCount();
while (listener != null)
{
if (!(listener instanceof org.jbundle.base.db.filter.FileFilter))
{
if (!bEnable)
{
rgobjEnable = Utility.growArray(rgobjEnable, iCount + 1, 8);
if (listener.isEnabledListener())
rgobjEnable[iCount] = Boolean.TRUE;
else
rgobjEnable[iCount] = Boolean.FALSE;
listener.setEnabledListener(bEnable);
}
else
{ // Enable
boolean bEnableThis = true;
if (iCount < rgobjEnable.length)
if (rgobjEnable[iCount] != null)
bEnableThis = ((Boolean)rgobjEnable[iCount]).booleanValue();
listener.setEnabledListener(bEnableThis);
}
iCount++;
}
listener = (FileListener)listener.getNextListener();
}
if (bEnable)
{
if (bAfterRequery)
this.handleRecordChange(null, DBConstants.AFTER_REQUERY_TYPE, true);
if (bBreak)
this.handleRecordChange(null, DBConstants.CONTROL_BREAK_TYPE, true);
if (bHasNext)
{
this.handleValidRecord(true);
this.handleRecordChange(null, DBConstants.MOVE_NEXT_TYPE, true);
}
if (bSelectEOF)
this.handleRecordChange(null, DBConstants.SELECT_EOF_TYPE, true);
if (this.getTable().getCurrentTable().getRecord() != this)
{ // Special logic - match listeners on current record (if shared)
boolean bCloneListeners = false;
boolean bMatchEnabledState = true;
boolean bSyncReferenceFields = false;
boolean bMatchSelectedState = true;
this.matchListeners(this.getTable().getCurrentTable().getRecord(), bCloneListeners, bMatchEnabledState, bSyncReferenceFields, bMatchSelectedState, true);
}
}
return rgobjEnable;
}
|
[
"public",
"Object",
"[",
"]",
"setEnableNonFilter",
"(",
"Object",
"[",
"]",
"rgobjEnable",
",",
"boolean",
"bHasNext",
",",
"boolean",
"bBreak",
",",
"boolean",
"bAfterRequery",
",",
"boolean",
"bSelectEOF",
",",
"boolean",
"bFieldListeners",
")",
"{",
"boolean",
"bEnable",
"=",
"(",
"rgobjEnable",
"==",
"null",
")",
"?",
"false",
":",
"true",
";",
"if",
"(",
"bFieldListeners",
")",
"{",
"if",
"(",
"rgobjEnable",
"==",
"null",
")",
"rgobjEnable",
"=",
"this",
".",
"setEnableFieldListeners",
"(",
"bEnable",
")",
";",
"else",
"this",
".",
"setEnableFieldListeners",
"(",
"rgobjEnable",
")",
";",
"}",
"else",
"{",
"if",
"(",
"rgobjEnable",
"==",
"null",
")",
"rgobjEnable",
"=",
"new",
"Object",
"[",
"0",
"]",
";",
"}",
"FileListener",
"listener",
"=",
"this",
".",
"getListener",
"(",
")",
";",
"int",
"iCount",
"=",
"this",
".",
"getFieldCount",
"(",
")",
";",
"while",
"(",
"listener",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"listener",
"instanceof",
"org",
".",
"jbundle",
".",
"base",
".",
"db",
".",
"filter",
".",
"FileFilter",
")",
")",
"{",
"if",
"(",
"!",
"bEnable",
")",
"{",
"rgobjEnable",
"=",
"Utility",
".",
"growArray",
"(",
"rgobjEnable",
",",
"iCount",
"+",
"1",
",",
"8",
")",
";",
"if",
"(",
"listener",
".",
"isEnabledListener",
"(",
")",
")",
"rgobjEnable",
"[",
"iCount",
"]",
"=",
"Boolean",
".",
"TRUE",
";",
"else",
"rgobjEnable",
"[",
"iCount",
"]",
"=",
"Boolean",
".",
"FALSE",
";",
"listener",
".",
"setEnabledListener",
"(",
"bEnable",
")",
";",
"}",
"else",
"{",
"// Enable",
"boolean",
"bEnableThis",
"=",
"true",
";",
"if",
"(",
"iCount",
"<",
"rgobjEnable",
".",
"length",
")",
"if",
"(",
"rgobjEnable",
"[",
"iCount",
"]",
"!=",
"null",
")",
"bEnableThis",
"=",
"(",
"(",
"Boolean",
")",
"rgobjEnable",
"[",
"iCount",
"]",
")",
".",
"booleanValue",
"(",
")",
";",
"listener",
".",
"setEnabledListener",
"(",
"bEnableThis",
")",
";",
"}",
"iCount",
"++",
";",
"}",
"listener",
"=",
"(",
"FileListener",
")",
"listener",
".",
"getNextListener",
"(",
")",
";",
"}",
"if",
"(",
"bEnable",
")",
"{",
"if",
"(",
"bAfterRequery",
")",
"this",
".",
"handleRecordChange",
"(",
"null",
",",
"DBConstants",
".",
"AFTER_REQUERY_TYPE",
",",
"true",
")",
";",
"if",
"(",
"bBreak",
")",
"this",
".",
"handleRecordChange",
"(",
"null",
",",
"DBConstants",
".",
"CONTROL_BREAK_TYPE",
",",
"true",
")",
";",
"if",
"(",
"bHasNext",
")",
"{",
"this",
".",
"handleValidRecord",
"(",
"true",
")",
";",
"this",
".",
"handleRecordChange",
"(",
"null",
",",
"DBConstants",
".",
"MOVE_NEXT_TYPE",
",",
"true",
")",
";",
"}",
"if",
"(",
"bSelectEOF",
")",
"this",
".",
"handleRecordChange",
"(",
"null",
",",
"DBConstants",
".",
"SELECT_EOF_TYPE",
",",
"true",
")",
";",
"if",
"(",
"this",
".",
"getTable",
"(",
")",
".",
"getCurrentTable",
"(",
")",
".",
"getRecord",
"(",
")",
"!=",
"this",
")",
"{",
"// Special logic - match listeners on current record (if shared)",
"boolean",
"bCloneListeners",
"=",
"false",
";",
"boolean",
"bMatchEnabledState",
"=",
"true",
";",
"boolean",
"bSyncReferenceFields",
"=",
"false",
";",
"boolean",
"bMatchSelectedState",
"=",
"true",
";",
"this",
".",
"matchListeners",
"(",
"this",
".",
"getTable",
"(",
")",
".",
"getCurrentTable",
"(",
")",
".",
"getRecord",
"(",
")",
",",
"bCloneListeners",
",",
"bMatchEnabledState",
",",
"bSyncReferenceFields",
",",
"bMatchSelectedState",
",",
"true",
")",
";",
"}",
"}",
"return",
"rgobjEnable",
";",
"}"
] |
Enable or Disable non-filter listeners for this record.
|
[
"Enable",
"or",
"Disable",
"non",
"-",
"filter",
"listeners",
"for",
"this",
"record",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L528-L594
|
152,413
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.setEnableFieldListeners
|
public Object[] setEnableFieldListeners(boolean bEnable)
{
int iFieldCount = this.getFieldCount();
Object[] rgobjEnabledFields = new Object[iFieldCount];
for (int i = 0; i < iFieldCount; i++)
{
BaseField field = this.getField(i);
rgobjEnabledFields[i] = field.setEnableListeners(bEnable);
}
return rgobjEnabledFields;
}
|
java
|
public Object[] setEnableFieldListeners(boolean bEnable)
{
int iFieldCount = this.getFieldCount();
Object[] rgobjEnabledFields = new Object[iFieldCount];
for (int i = 0; i < iFieldCount; i++)
{
BaseField field = this.getField(i);
rgobjEnabledFields[i] = field.setEnableListeners(bEnable);
}
return rgobjEnabledFields;
}
|
[
"public",
"Object",
"[",
"]",
"setEnableFieldListeners",
"(",
"boolean",
"bEnable",
")",
"{",
"int",
"iFieldCount",
"=",
"this",
".",
"getFieldCount",
"(",
")",
";",
"Object",
"[",
"]",
"rgobjEnabledFields",
"=",
"new",
"Object",
"[",
"iFieldCount",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"iFieldCount",
";",
"i",
"++",
")",
"{",
"BaseField",
"field",
"=",
"this",
".",
"getField",
"(",
"i",
")",
";",
"rgobjEnabledFields",
"[",
"i",
"]",
"=",
"field",
".",
"setEnableListeners",
"(",
"bEnable",
")",
";",
"}",
"return",
"rgobjEnabledFields",
";",
"}"
] |
Enable or Disable all the field listeners and return the original state.
@param bEnable Enable or disable.
@return The original state of the listeners.
|
[
"Enable",
"or",
"Disable",
"all",
"the",
"field",
"listeners",
"and",
"return",
"the",
"original",
"state",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L600-L610
|
152,414
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.setEnableFieldListeners
|
public void setEnableFieldListeners(Object[] rgobjEnabledFields)
{
for (int i = 0; i < this.getFieldCount(); i++)
{
this.getField(i).setEnableListeners((boolean[])rgobjEnabledFields[i]);
}
}
|
java
|
public void setEnableFieldListeners(Object[] rgobjEnabledFields)
{
for (int i = 0; i < this.getFieldCount(); i++)
{
this.getField(i).setEnableListeners((boolean[])rgobjEnabledFields[i]);
}
}
|
[
"public",
"void",
"setEnableFieldListeners",
"(",
"Object",
"[",
"]",
"rgobjEnabledFields",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"getFieldCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"this",
".",
"getField",
"(",
"i",
")",
".",
"setEnableListeners",
"(",
"(",
"boolean",
"[",
"]",
")",
"rgobjEnabledFields",
"[",
"i",
"]",
")",
";",
"}",
"}"
] |
Enable all the field listeners in this record according to this map.
@param rgbEnabledFields The field listeners (in order) to enable/disable.
|
[
"Enable",
"all",
"the",
"field",
"listeners",
"in",
"this",
"record",
"according",
"to",
"this",
"map",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L615-L621
|
152,415
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.formatTableNames
|
public static final String formatTableNames(String strTableNames, boolean bAddQuotes)
{
if (bAddQuotes)
if (strTableNames.indexOf(' ') != -1)
strTableNames = BaseField.addQuotes(strTableNames, DBConstants.SQL_START_QUOTE, DBConstants.SQL_END_QUOTE); // Spaces in name, quotes required
return strTableNames;
}
|
java
|
public static final String formatTableNames(String strTableNames, boolean bAddQuotes)
{
if (bAddQuotes)
if (strTableNames.indexOf(' ') != -1)
strTableNames = BaseField.addQuotes(strTableNames, DBConstants.SQL_START_QUOTE, DBConstants.SQL_END_QUOTE); // Spaces in name, quotes required
return strTableNames;
}
|
[
"public",
"static",
"final",
"String",
"formatTableNames",
"(",
"String",
"strTableNames",
",",
"boolean",
"bAddQuotes",
")",
"{",
"if",
"(",
"bAddQuotes",
")",
"if",
"(",
"strTableNames",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"strTableNames",
"=",
"BaseField",
".",
"addQuotes",
"(",
"strTableNames",
",",
"DBConstants",
".",
"SQL_START_QUOTE",
",",
"DBConstants",
".",
"SQL_END_QUOTE",
")",
";",
"// Spaces in name, quotes required",
"return",
"strTableNames",
";",
"}"
] |
Utility routine to add quotes to a string if the string contains a space.
@param strTableNames The table name to add quotes to if there is a space in the name.
@param bAddQuotes Add the quotes?
@return The new quoted table name.
|
[
"Utility",
"routine",
"to",
"add",
"quotes",
"to",
"a",
"string",
"if",
"the",
"string",
"contains",
"a",
"space",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L847-L853
|
152,416
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getTable
|
public BaseTable getTable()
{
BaseTable table = (BaseTable)super.getTable();
if (table == null) // It's possible that m_table was set in an overriding init method.
{
DatabaseOwner databaseOwner = null;
if (this.getRecordOwner() != null)
databaseOwner = this.getRecordOwner().getDatabaseOwner();
if (databaseOwner != null)
{
BaseDatabase database = (BaseDatabase)databaseOwner.getDatabase(this.getDatabaseName(), this.getDatabaseType(), null);
m_table = database.makeTable(this);
}
}
return (BaseTable)super.getTable();
}
|
java
|
public BaseTable getTable()
{
BaseTable table = (BaseTable)super.getTable();
if (table == null) // It's possible that m_table was set in an overriding init method.
{
DatabaseOwner databaseOwner = null;
if (this.getRecordOwner() != null)
databaseOwner = this.getRecordOwner().getDatabaseOwner();
if (databaseOwner != null)
{
BaseDatabase database = (BaseDatabase)databaseOwner.getDatabase(this.getDatabaseName(), this.getDatabaseType(), null);
m_table = database.makeTable(this);
}
}
return (BaseTable)super.getTable();
}
|
[
"public",
"BaseTable",
"getTable",
"(",
")",
"{",
"BaseTable",
"table",
"=",
"(",
"BaseTable",
")",
"super",
".",
"getTable",
"(",
")",
";",
"if",
"(",
"table",
"==",
"null",
")",
"// It's possible that m_table was set in an overriding init method.",
"{",
"DatabaseOwner",
"databaseOwner",
"=",
"null",
";",
"if",
"(",
"this",
".",
"getRecordOwner",
"(",
")",
"!=",
"null",
")",
"databaseOwner",
"=",
"this",
".",
"getRecordOwner",
"(",
")",
".",
"getDatabaseOwner",
"(",
")",
";",
"if",
"(",
"databaseOwner",
"!=",
"null",
")",
"{",
"BaseDatabase",
"database",
"=",
"(",
"BaseDatabase",
")",
"databaseOwner",
".",
"getDatabase",
"(",
"this",
".",
"getDatabaseName",
"(",
")",
",",
"this",
".",
"getDatabaseType",
"(",
")",
",",
"null",
")",
";",
"m_table",
"=",
"database",
".",
"makeTable",
"(",
"this",
")",
";",
"}",
"}",
"return",
"(",
"BaseTable",
")",
"super",
".",
"getTable",
"(",
")",
";",
"}"
] |
Get the table for this record.
This is the same as getFieldTable, but casts the class up.
@return The table for this record.
|
[
"Get",
"the",
"table",
"for",
"this",
"record",
".",
"This",
"is",
"the",
"same",
"as",
"getFieldTable",
"but",
"casts",
"the",
"class",
"up",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L958-L973
|
152,417
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getFieldSeq
|
public int getFieldSeq(String fieldName)
{
for (int i = 0; i < this.getFieldCount(); i++)
{
if (fieldName.equals(this.getField(i).getFieldName()))
return i;
}
return -1;
}
|
java
|
public int getFieldSeq(String fieldName)
{
for (int i = 0; i < this.getFieldCount(); i++)
{
if (fieldName.equals(this.getField(i).getFieldName()))
return i;
}
return -1;
}
|
[
"public",
"int",
"getFieldSeq",
"(",
"String",
"fieldName",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"getFieldCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"fieldName",
".",
"equals",
"(",
"this",
".",
"getField",
"(",
"i",
")",
".",
"getFieldName",
"(",
")",
")",
")",
"return",
"i",
";",
"}",
"return",
"-",
"1",
";",
"}"
] |
Get the field sequence for this field.
@param fieldName
@return
|
[
"Get",
"the",
"field",
"sequence",
"for",
"this",
"field",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1026-L1034
|
152,418
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getDefaultScreenKeyArea
|
public String getDefaultScreenKeyArea()
{
for (int i = DBConstants.MAIN_KEY_AREA; i < this.getKeyAreaCount(); i++)
{
if (this.getKeyArea(i).getUniqueKeyCode() == DBConstants.NOT_UNIQUE)
if (this.getKeyArea(i).getKeyField(DBConstants.MAIN_KEY_FIELD).getField(DBConstants.FILE_KEY_AREA) instanceof StringField)
return this.getKeyArea(i).getKeyName();
}
return null; // Return the current key area
}
|
java
|
public String getDefaultScreenKeyArea()
{
for (int i = DBConstants.MAIN_KEY_AREA; i < this.getKeyAreaCount(); i++)
{
if (this.getKeyArea(i).getUniqueKeyCode() == DBConstants.NOT_UNIQUE)
if (this.getKeyArea(i).getKeyField(DBConstants.MAIN_KEY_FIELD).getField(DBConstants.FILE_KEY_AREA) instanceof StringField)
return this.getKeyArea(i).getKeyName();
}
return null; // Return the current key area
}
|
[
"public",
"String",
"getDefaultScreenKeyArea",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"DBConstants",
".",
"MAIN_KEY_AREA",
";",
"i",
"<",
"this",
".",
"getKeyAreaCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"getKeyArea",
"(",
"i",
")",
".",
"getUniqueKeyCode",
"(",
")",
"==",
"DBConstants",
".",
"NOT_UNIQUE",
")",
"if",
"(",
"this",
".",
"getKeyArea",
"(",
"i",
")",
".",
"getKeyField",
"(",
"DBConstants",
".",
"MAIN_KEY_FIELD",
")",
".",
"getField",
"(",
"DBConstants",
".",
"FILE_KEY_AREA",
")",
"instanceof",
"StringField",
")",
"return",
"this",
".",
"getKeyArea",
"(",
"i",
")",
".",
"getKeyName",
"(",
")",
";",
"}",
"return",
"null",
";",
"// Return the current key area",
"}"
] |
Get the default key index for grid screens.
The default key area for grid screens is the first non-unique key that is a string.
Override this to supply a different key area.
@return The key area to use for screens and popups.
|
[
"Get",
"the",
"default",
"key",
"index",
"for",
"grid",
"screens",
".",
"The",
"default",
"key",
"area",
"for",
"grid",
"screens",
"is",
"the",
"first",
"non",
"-",
"unique",
"key",
"that",
"is",
"a",
"string",
".",
"Override",
"this",
"to",
"supply",
"a",
"different",
"key",
"area",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1157-L1166
|
152,419
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getRecord
|
public Record getRecord(String strFileName)
{
boolean bAddQuotes = false;
if (strFileName.length() > 0) if (strFileName.charAt(0) == '\"')
bAddQuotes = true;
if (this.getTableNames(bAddQuotes).equals(strFileName))
return this;
return null;
}
|
java
|
public Record getRecord(String strFileName)
{
boolean bAddQuotes = false;
if (strFileName.length() > 0) if (strFileName.charAt(0) == '\"')
bAddQuotes = true;
if (this.getTableNames(bAddQuotes).equals(strFileName))
return this;
return null;
}
|
[
"public",
"Record",
"getRecord",
"(",
"String",
"strFileName",
")",
"{",
"boolean",
"bAddQuotes",
"=",
"false",
";",
"if",
"(",
"strFileName",
".",
"length",
"(",
")",
">",
"0",
")",
"if",
"(",
"strFileName",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
")",
"bAddQuotes",
"=",
"true",
";",
"if",
"(",
"this",
".",
"getTableNames",
"(",
"bAddQuotes",
")",
".",
"equals",
"(",
"strFileName",
")",
")",
"return",
"this",
";",
"return",
"null",
";",
"}"
] |
Get the record with this file name.
This is more usefull in the queryrecord.
@return This if match.
|
[
"Get",
"the",
"record",
"with",
"this",
"file",
"name",
".",
"This",
"is",
"more",
"usefull",
"in",
"the",
"queryrecord",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1208-L1216
|
152,420
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.findRecordOwner
|
public RecordOwner findRecordOwner()
{
RecordOwner recordOwner = this.getRecordOwner();
if (recordOwner instanceof org.jbundle.base.db.shared.FakeRecordOwner)
recordOwner = null;
BaseListener listener = this.getListener();
while ((recordOwner == null) && (listener != null))
{
BaseListener listenerDep = listener.getDependentListener();
if (listenerDep != null)
if (listenerDep.getListenerOwner() instanceof RecordOwner)
recordOwner = (RecordOwner)listenerDep.getListenerOwner();
listener = listener.getNextListener();
}
if (recordOwner == null)
if (this.getTable() != null)
if (this.getTable().getDatabase() != null)
if (this.getTable().getDatabase().getDatabaseOwner() instanceof Application)
{
App app = (App)this.getTable().getDatabase().getDatabaseOwner();
if (app.getSystemRecordOwner() == null) // This should be okay... get the system recordowner.
app = ((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getDefaultApplication();
if (app != null)
{
if (app.getSystemRecordOwner() instanceof RecordOwner)
recordOwner = (RecordOwner)app.getSystemRecordOwner();
else
{
Environment env = (Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment();
for (int i = env.getApplicationCount() - 1; i >= 0; i--)
{
app = env.getApplication(i);
if (app instanceof MainApplication)
if (app.getSystemRecordOwner() instanceof RecordOwner)
recordOwner = (RecordOwner)app.getSystemRecordOwner();
}
}
}
}
return recordOwner;
}
|
java
|
public RecordOwner findRecordOwner()
{
RecordOwner recordOwner = this.getRecordOwner();
if (recordOwner instanceof org.jbundle.base.db.shared.FakeRecordOwner)
recordOwner = null;
BaseListener listener = this.getListener();
while ((recordOwner == null) && (listener != null))
{
BaseListener listenerDep = listener.getDependentListener();
if (listenerDep != null)
if (listenerDep.getListenerOwner() instanceof RecordOwner)
recordOwner = (RecordOwner)listenerDep.getListenerOwner();
listener = listener.getNextListener();
}
if (recordOwner == null)
if (this.getTable() != null)
if (this.getTable().getDatabase() != null)
if (this.getTable().getDatabase().getDatabaseOwner() instanceof Application)
{
App app = (App)this.getTable().getDatabase().getDatabaseOwner();
if (app.getSystemRecordOwner() == null) // This should be okay... get the system recordowner.
app = ((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getDefaultApplication();
if (app != null)
{
if (app.getSystemRecordOwner() instanceof RecordOwner)
recordOwner = (RecordOwner)app.getSystemRecordOwner();
else
{
Environment env = (Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment();
for (int i = env.getApplicationCount() - 1; i >= 0; i--)
{
app = env.getApplication(i);
if (app instanceof MainApplication)
if (app.getSystemRecordOwner() instanceof RecordOwner)
recordOwner = (RecordOwner)app.getSystemRecordOwner();
}
}
}
}
return recordOwner;
}
|
[
"public",
"RecordOwner",
"findRecordOwner",
"(",
")",
"{",
"RecordOwner",
"recordOwner",
"=",
"this",
".",
"getRecordOwner",
"(",
")",
";",
"if",
"(",
"recordOwner",
"instanceof",
"org",
".",
"jbundle",
".",
"base",
".",
"db",
".",
"shared",
".",
"FakeRecordOwner",
")",
"recordOwner",
"=",
"null",
";",
"BaseListener",
"listener",
"=",
"this",
".",
"getListener",
"(",
")",
";",
"while",
"(",
"(",
"recordOwner",
"==",
"null",
")",
"&&",
"(",
"listener",
"!=",
"null",
")",
")",
"{",
"BaseListener",
"listenerDep",
"=",
"listener",
".",
"getDependentListener",
"(",
")",
";",
"if",
"(",
"listenerDep",
"!=",
"null",
")",
"if",
"(",
"listenerDep",
".",
"getListenerOwner",
"(",
")",
"instanceof",
"RecordOwner",
")",
"recordOwner",
"=",
"(",
"RecordOwner",
")",
"listenerDep",
".",
"getListenerOwner",
"(",
")",
";",
"listener",
"=",
"listener",
".",
"getNextListener",
"(",
")",
";",
"}",
"if",
"(",
"recordOwner",
"==",
"null",
")",
"if",
"(",
"this",
".",
"getTable",
"(",
")",
"!=",
"null",
")",
"if",
"(",
"this",
".",
"getTable",
"(",
")",
".",
"getDatabase",
"(",
")",
"!=",
"null",
")",
"if",
"(",
"this",
".",
"getTable",
"(",
")",
".",
"getDatabase",
"(",
")",
".",
"getDatabaseOwner",
"(",
")",
"instanceof",
"Application",
")",
"{",
"App",
"app",
"=",
"(",
"App",
")",
"this",
".",
"getTable",
"(",
")",
".",
"getDatabase",
"(",
")",
".",
"getDatabaseOwner",
"(",
")",
";",
"if",
"(",
"app",
".",
"getSystemRecordOwner",
"(",
")",
"==",
"null",
")",
"// This should be okay... get the system recordowner.",
"app",
"=",
"(",
"(",
"Environment",
")",
"this",
".",
"getTable",
"(",
")",
".",
"getDatabase",
"(",
")",
".",
"getDatabaseOwner",
"(",
")",
".",
"getEnvironment",
"(",
")",
")",
".",
"getDefaultApplication",
"(",
")",
";",
"if",
"(",
"app",
"!=",
"null",
")",
"{",
"if",
"(",
"app",
".",
"getSystemRecordOwner",
"(",
")",
"instanceof",
"RecordOwner",
")",
"recordOwner",
"=",
"(",
"RecordOwner",
")",
"app",
".",
"getSystemRecordOwner",
"(",
")",
";",
"else",
"{",
"Environment",
"env",
"=",
"(",
"Environment",
")",
"this",
".",
"getTable",
"(",
")",
".",
"getDatabase",
"(",
")",
".",
"getDatabaseOwner",
"(",
")",
".",
"getEnvironment",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"env",
".",
"getApplicationCount",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"app",
"=",
"env",
".",
"getApplication",
"(",
"i",
")",
";",
"if",
"(",
"app",
"instanceof",
"MainApplication",
")",
"if",
"(",
"app",
".",
"getSystemRecordOwner",
"(",
")",
"instanceof",
"RecordOwner",
")",
"recordOwner",
"=",
"(",
"RecordOwner",
")",
"app",
".",
"getSystemRecordOwner",
"(",
")",
";",
"}",
"}",
"}",
"}",
"return",
"recordOwner",
";",
"}"
] |
Get a recordowner from this record.
This method does a deep search using the listeners and the database connections to find a recordowner.
@param record
@return
|
[
"Get",
"a",
"recordowner",
"from",
"this",
"record",
".",
"This",
"method",
"does",
"a",
"deep",
"search",
"using",
"the",
"listeners",
"and",
"the",
"database",
"connections",
"to",
"find",
"a",
"recordowner",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1259-L1299
|
152,421
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.isAllSelected
|
public boolean isAllSelected()
{
boolean bAllSelected = true;
for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq <= this.getFieldCount() + DBConstants.MAIN_FIELD - 1; iFieldSeq++)
{
if(this.getField(iFieldSeq).isSelected() == false)
bAllSelected = false;
}
return bAllSelected;
}
|
java
|
public boolean isAllSelected()
{
boolean bAllSelected = true;
for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq <= this.getFieldCount() + DBConstants.MAIN_FIELD - 1; iFieldSeq++)
{
if(this.getField(iFieldSeq).isSelected() == false)
bAllSelected = false;
}
return bAllSelected;
}
|
[
"public",
"boolean",
"isAllSelected",
"(",
")",
"{",
"boolean",
"bAllSelected",
"=",
"true",
";",
"for",
"(",
"int",
"iFieldSeq",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"iFieldSeq",
"<=",
"this",
".",
"getFieldCount",
"(",
")",
"+",
"DBConstants",
".",
"MAIN_FIELD",
"-",
"1",
";",
"iFieldSeq",
"++",
")",
"{",
"if",
"(",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"isSelected",
"(",
")",
"==",
"false",
")",
"bAllSelected",
"=",
"false",
";",
"}",
"return",
"bAllSelected",
";",
"}"
] |
Are all the fields selected?
@return true if all selected.
|
[
"Are",
"all",
"the",
"fields",
"selected?"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1341-L1350
|
152,422
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getSQLQuery
|
public String getSQLQuery(boolean bUseCurrentValues, Vector<BaseField> vParamList)
{
String strRecordset = this.makeTableNames(false);
String strFields = this.getSQLFields(DBConstants.SQL_SELECT_TYPE, bUseCurrentValues);
boolean bIsQueryRecord = this.isQueryRecord();
String strSortParams = this.addSortParams(bIsQueryRecord, true);
this.handleInitialKey(); // Set up the smaller key
String strStartRange = this.addSelectParams(">=", DBConstants.START_SELECT_KEY, true, bIsQueryRecord, bUseCurrentValues, vParamList, true, false); // Add only if changed
this.handleEndKey(); // Set up the larger key
String strEndRange = this.addSelectParams("<=", DBConstants.END_SELECT_KEY, true, bIsQueryRecord, bUseCurrentValues, vParamList, true, false); // Add only if changed
String strWhere = DBConstants.BLANK;
if (strStartRange.length() == 0)
strWhere = strEndRange;
else
{
if (strEndRange.length() == 0)
strWhere = strStartRange;
else
strWhere = strStartRange + " AND " + strEndRange;
}
// Next, get the recordset filter
StringBuffer strbFilter = new StringBuffer();
this.handleRemoteCriteria(strbFilter, bIsQueryRecord, vParamList); // Add any selection criteria (from behaviors)
if (strbFilter.length() > 0)
{
if (strWhere.length() == 0)
strWhere = strbFilter.toString();
else
strWhere += " AND (" + strbFilter.toString() + ")";
}
if (strWhere.length() > 0)
strWhere = " WHERE " + strWhere;
strRecordset = "SELECT" + strFields + " FROM " + strRecordset + strWhere + strSortParams;
return strRecordset;
}
|
java
|
public String getSQLQuery(boolean bUseCurrentValues, Vector<BaseField> vParamList)
{
String strRecordset = this.makeTableNames(false);
String strFields = this.getSQLFields(DBConstants.SQL_SELECT_TYPE, bUseCurrentValues);
boolean bIsQueryRecord = this.isQueryRecord();
String strSortParams = this.addSortParams(bIsQueryRecord, true);
this.handleInitialKey(); // Set up the smaller key
String strStartRange = this.addSelectParams(">=", DBConstants.START_SELECT_KEY, true, bIsQueryRecord, bUseCurrentValues, vParamList, true, false); // Add only if changed
this.handleEndKey(); // Set up the larger key
String strEndRange = this.addSelectParams("<=", DBConstants.END_SELECT_KEY, true, bIsQueryRecord, bUseCurrentValues, vParamList, true, false); // Add only if changed
String strWhere = DBConstants.BLANK;
if (strStartRange.length() == 0)
strWhere = strEndRange;
else
{
if (strEndRange.length() == 0)
strWhere = strStartRange;
else
strWhere = strStartRange + " AND " + strEndRange;
}
// Next, get the recordset filter
StringBuffer strbFilter = new StringBuffer();
this.handleRemoteCriteria(strbFilter, bIsQueryRecord, vParamList); // Add any selection criteria (from behaviors)
if (strbFilter.length() > 0)
{
if (strWhere.length() == 0)
strWhere = strbFilter.toString();
else
strWhere += " AND (" + strbFilter.toString() + ")";
}
if (strWhere.length() > 0)
strWhere = " WHERE " + strWhere;
strRecordset = "SELECT" + strFields + " FROM " + strRecordset + strWhere + strSortParams;
return strRecordset;
}
|
[
"public",
"String",
"getSQLQuery",
"(",
"boolean",
"bUseCurrentValues",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"String",
"strRecordset",
"=",
"this",
".",
"makeTableNames",
"(",
"false",
")",
";",
"String",
"strFields",
"=",
"this",
".",
"getSQLFields",
"(",
"DBConstants",
".",
"SQL_SELECT_TYPE",
",",
"bUseCurrentValues",
")",
";",
"boolean",
"bIsQueryRecord",
"=",
"this",
".",
"isQueryRecord",
"(",
")",
";",
"String",
"strSortParams",
"=",
"this",
".",
"addSortParams",
"(",
"bIsQueryRecord",
",",
"true",
")",
";",
"this",
".",
"handleInitialKey",
"(",
")",
";",
"// Set up the smaller key",
"String",
"strStartRange",
"=",
"this",
".",
"addSelectParams",
"(",
"\">=\"",
",",
"DBConstants",
".",
"START_SELECT_KEY",
",",
"true",
",",
"bIsQueryRecord",
",",
"bUseCurrentValues",
",",
"vParamList",
",",
"true",
",",
"false",
")",
";",
"// Add only if changed",
"this",
".",
"handleEndKey",
"(",
")",
";",
"// Set up the larger key",
"String",
"strEndRange",
"=",
"this",
".",
"addSelectParams",
"(",
"\"<=\"",
",",
"DBConstants",
".",
"END_SELECT_KEY",
",",
"true",
",",
"bIsQueryRecord",
",",
"bUseCurrentValues",
",",
"vParamList",
",",
"true",
",",
"false",
")",
";",
"// Add only if changed",
"String",
"strWhere",
"=",
"DBConstants",
".",
"BLANK",
";",
"if",
"(",
"strStartRange",
".",
"length",
"(",
")",
"==",
"0",
")",
"strWhere",
"=",
"strEndRange",
";",
"else",
"{",
"if",
"(",
"strEndRange",
".",
"length",
"(",
")",
"==",
"0",
")",
"strWhere",
"=",
"strStartRange",
";",
"else",
"strWhere",
"=",
"strStartRange",
"+",
"\" AND \"",
"+",
"strEndRange",
";",
"}",
"// Next, get the recordset filter",
"StringBuffer",
"strbFilter",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"this",
".",
"handleRemoteCriteria",
"(",
"strbFilter",
",",
"bIsQueryRecord",
",",
"vParamList",
")",
";",
"// Add any selection criteria (from behaviors)",
"if",
"(",
"strbFilter",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"strWhere",
".",
"length",
"(",
")",
"==",
"0",
")",
"strWhere",
"=",
"strbFilter",
".",
"toString",
"(",
")",
";",
"else",
"strWhere",
"+=",
"\" AND (\"",
"+",
"strbFilter",
".",
"toString",
"(",
")",
"+",
"\")\"",
";",
"}",
"if",
"(",
"strWhere",
".",
"length",
"(",
")",
">",
"0",
")",
"strWhere",
"=",
"\" WHERE \"",
"+",
"strWhere",
";",
"strRecordset",
"=",
"\"SELECT\"",
"+",
"strFields",
"+",
"\" FROM \"",
"+",
"strRecordset",
"+",
"strWhere",
"+",
"strSortParams",
";",
"return",
"strRecordset",
";",
"}"
] |
Get the SQL SELECT string.
@param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
@param vParamList The parameter list.
@return The SQL select string.
|
[
"Get",
"the",
"SQL",
"SELECT",
"string",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1412-L1448
|
152,423
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getSQLSeek
|
public String getSQLSeek(String strSeekSign, boolean bUseCurrentValues, Vector<BaseField> vParamList)
{
boolean bIsQueryRecord = this.isQueryRecord();
String strRecordset = this.makeTableNames(false);
String strFields = this.getSQLFields(DBConstants.SQL_SELECT_TYPE, bUseCurrentValues);
String strSortParams = this.addSortParams(bIsQueryRecord, false);
KeyArea keyArea = this.getKeyArea(-1); // Current index
keyArea.setupKeyBuffer(null, DBConstants.TEMP_KEY_AREA); // Move params
String sFilter = keyArea.addSelectParams(strSeekSign, DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentValues, vParamList, false, false); // Always add!?
if (sFilter.length() > 0)
{
if (strRecordset.indexOf(" WHERE ") == -1)
sFilter = " WHERE " + sFilter;
else
sFilter = " AND " + sFilter;
}
strRecordset = "SELECT" + strFields + " FROM " + strRecordset + sFilter + strSortParams;
return strRecordset;
}
|
java
|
public String getSQLSeek(String strSeekSign, boolean bUseCurrentValues, Vector<BaseField> vParamList)
{
boolean bIsQueryRecord = this.isQueryRecord();
String strRecordset = this.makeTableNames(false);
String strFields = this.getSQLFields(DBConstants.SQL_SELECT_TYPE, bUseCurrentValues);
String strSortParams = this.addSortParams(bIsQueryRecord, false);
KeyArea keyArea = this.getKeyArea(-1); // Current index
keyArea.setupKeyBuffer(null, DBConstants.TEMP_KEY_AREA); // Move params
String sFilter = keyArea.addSelectParams(strSeekSign, DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentValues, vParamList, false, false); // Always add!?
if (sFilter.length() > 0)
{
if (strRecordset.indexOf(" WHERE ") == -1)
sFilter = " WHERE " + sFilter;
else
sFilter = " AND " + sFilter;
}
strRecordset = "SELECT" + strFields + " FROM " + strRecordset + sFilter + strSortParams;
return strRecordset;
}
|
[
"public",
"String",
"getSQLSeek",
"(",
"String",
"strSeekSign",
",",
"boolean",
"bUseCurrentValues",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"boolean",
"bIsQueryRecord",
"=",
"this",
".",
"isQueryRecord",
"(",
")",
";",
"String",
"strRecordset",
"=",
"this",
".",
"makeTableNames",
"(",
"false",
")",
";",
"String",
"strFields",
"=",
"this",
".",
"getSQLFields",
"(",
"DBConstants",
".",
"SQL_SELECT_TYPE",
",",
"bUseCurrentValues",
")",
";",
"String",
"strSortParams",
"=",
"this",
".",
"addSortParams",
"(",
"bIsQueryRecord",
",",
"false",
")",
";",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getKeyArea",
"(",
"-",
"1",
")",
";",
"// Current index",
"keyArea",
".",
"setupKeyBuffer",
"(",
"null",
",",
"DBConstants",
".",
"TEMP_KEY_AREA",
")",
";",
"// Move params",
"String",
"sFilter",
"=",
"keyArea",
".",
"addSelectParams",
"(",
"strSeekSign",
",",
"DBConstants",
".",
"TEMP_KEY_AREA",
",",
"false",
",",
"bIsQueryRecord",
",",
"bUseCurrentValues",
",",
"vParamList",
",",
"false",
",",
"false",
")",
";",
"// Always add!?",
"if",
"(",
"sFilter",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"strRecordset",
".",
"indexOf",
"(",
"\" WHERE \"",
")",
"==",
"-",
"1",
")",
"sFilter",
"=",
"\" WHERE \"",
"+",
"sFilter",
";",
"else",
"sFilter",
"=",
"\" AND \"",
"+",
"sFilter",
";",
"}",
"strRecordset",
"=",
"\"SELECT\"",
"+",
"strFields",
"+",
"\" FROM \"",
"+",
"strRecordset",
"+",
"sFilter",
"+",
"strSortParams",
";",
"return",
"strRecordset",
";",
"}"
] |
Get the SQL 'Seek' string.
@param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
@param vParamList The parameter list.
@return The SQL select string.
|
[
"Get",
"the",
"SQL",
"Seek",
"string",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1455-L1476
|
152,424
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getSQLUpdate
|
public String getSQLUpdate(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getBaseRecord().getKeyArea(0); // Primary index
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, true);
boolean bIsQueryRecord = this.getBaseRecord().isQueryRecord();
String sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, true); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
String strSetValues = this.getBaseRecord().getSQLFields(DBConstants.SQL_UPDATE_TYPE, bUseCurrentValues);
if (strSetValues.length() == 0)
return null; // No fields to update
strRecordset = "UPDATE " + strRecordset + " SET " + strSetValues + sFilter;
return strRecordset;
}
|
java
|
public String getSQLUpdate(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getBaseRecord().getKeyArea(0); // Primary index
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, true);
boolean bIsQueryRecord = this.getBaseRecord().isQueryRecord();
String sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, true); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
String strSetValues = this.getBaseRecord().getSQLFields(DBConstants.SQL_UPDATE_TYPE, bUseCurrentValues);
if (strSetValues.length() == 0)
return null; // No fields to update
strRecordset = "UPDATE " + strRecordset + " SET " + strSetValues + sFilter;
return strRecordset;
}
|
[
"public",
"String",
"getSQLUpdate",
"(",
"boolean",
"bUseCurrentValues",
")",
"{",
"String",
"strRecordset",
"=",
"this",
".",
"getBaseRecord",
"(",
")",
".",
"makeTableNames",
"(",
"false",
")",
";",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getBaseRecord",
"(",
")",
".",
"getKeyArea",
"(",
"0",
")",
";",
"// Primary index",
"boolean",
"bUseCurrentKeyValues",
"=",
"bUseCurrentValues",
"?",
"true",
":",
"keyArea",
".",
"isNull",
"(",
"DBConstants",
".",
"TEMP_KEY_AREA",
",",
"true",
")",
";",
"boolean",
"bIsQueryRecord",
"=",
"this",
".",
"getBaseRecord",
"(",
")",
".",
"isQueryRecord",
"(",
")",
";",
"String",
"sFilter",
"=",
"keyArea",
".",
"addSelectParams",
"(",
"\"=\"",
",",
"DBConstants",
".",
"TEMP_KEY_AREA",
",",
"false",
",",
"bIsQueryRecord",
",",
"bUseCurrentKeyValues",
",",
"null",
",",
"true",
",",
"true",
")",
";",
"// Always add!?",
"if",
"(",
"sFilter",
".",
"length",
"(",
")",
">",
"0",
")",
"sFilter",
"=",
"\" WHERE \"",
"+",
"sFilter",
";",
"String",
"strSetValues",
"=",
"this",
".",
"getBaseRecord",
"(",
")",
".",
"getSQLFields",
"(",
"DBConstants",
".",
"SQL_UPDATE_TYPE",
",",
"bUseCurrentValues",
")",
";",
"if",
"(",
"strSetValues",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"null",
";",
"// No fields to update",
"strRecordset",
"=",
"\"UPDATE \"",
"+",
"strRecordset",
"+",
"\" SET \"",
"+",
"strSetValues",
"+",
"sFilter",
";",
"return",
"strRecordset",
";",
"}"
] |
Get the SQL 'Update' string.
UPDATE table SET field1 = 'value1', field2 = 'value2' WHERE key = 'value'
@param bUseCurrentValues If true, use the current field value, otherwise, use '?'.
@param vParamList The parameter list.
@return The SQL select string.
@return null if nothing to update.
|
[
"Get",
"the",
"SQL",
"Update",
"string",
".",
"UPDATE",
"table",
"SET",
"field1",
"=",
"value1",
"field2",
"=",
"value2",
"WHERE",
"key",
"=",
"value"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1485-L1502
|
152,425
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getSQLDelete
|
public String getSQLDelete(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getKeyArea(0); // Primary index
boolean bIsQueryRecord = this.isQueryRecord();
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, false);
String sFilter = "?";
sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, false); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
strRecordset = "DELETE FROM " + strRecordset + sFilter;
return strRecordset;
}
|
java
|
public String getSQLDelete(boolean bUseCurrentValues)
{
String strRecordset = this.getBaseRecord().makeTableNames(false);
KeyArea keyArea = this.getKeyArea(0); // Primary index
boolean bIsQueryRecord = this.isQueryRecord();
boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, false);
String sFilter = "?";
sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, false); // Always add!?
if (sFilter.length() > 0)
sFilter = " WHERE " + sFilter;
strRecordset = "DELETE FROM " + strRecordset + sFilter;
return strRecordset;
}
|
[
"public",
"String",
"getSQLDelete",
"(",
"boolean",
"bUseCurrentValues",
")",
"{",
"String",
"strRecordset",
"=",
"this",
".",
"getBaseRecord",
"(",
")",
".",
"makeTableNames",
"(",
"false",
")",
";",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getKeyArea",
"(",
"0",
")",
";",
"// Primary index",
"boolean",
"bIsQueryRecord",
"=",
"this",
".",
"isQueryRecord",
"(",
")",
";",
"boolean",
"bUseCurrentKeyValues",
"=",
"bUseCurrentValues",
"?",
"true",
":",
"keyArea",
".",
"isNull",
"(",
"DBConstants",
".",
"TEMP_KEY_AREA",
",",
"false",
")",
";",
"String",
"sFilter",
"=",
"\"?\"",
";",
"sFilter",
"=",
"keyArea",
".",
"addSelectParams",
"(",
"\"=\"",
",",
"DBConstants",
".",
"TEMP_KEY_AREA",
",",
"false",
",",
"bIsQueryRecord",
",",
"bUseCurrentKeyValues",
",",
"null",
",",
"true",
",",
"false",
")",
";",
"// Always add!?",
"if",
"(",
"sFilter",
".",
"length",
"(",
")",
">",
"0",
")",
"sFilter",
"=",
"\" WHERE \"",
"+",
"sFilter",
";",
"strRecordset",
"=",
"\"DELETE FROM \"",
"+",
"strRecordset",
"+",
"sFilter",
";",
"return",
"strRecordset",
";",
"}"
] |
Get the SQL 'Delete' string.
DELETE table WHERE key=value;
@param bUseCurrentValues If true, insert field values, if false, insert '?'
@return The SQL delete string.
|
[
"Get",
"the",
"SQL",
"Delete",
"string",
".",
"DELETE",
"table",
"WHERE",
"key",
"=",
"value",
";"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1509-L1524
|
152,426
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.handleInitialKey
|
public void handleInitialKey() // init this field override for other value
{
KeyArea keyArea = this.getKeyArea(-1);
if (keyArea == null)
return;
BaseBuffer buffer = new VectorBuffer(null);
boolean[] rgbModified = keyArea.getModified();
boolean[] rgbNullable = keyArea.setNullable(true);
keyArea.setupKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
keyArea.zeroKeyFields(DBConstants.START_SELECT_KEY); // Zero out the key fields
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
((FileListener)nextListener).doInitialKey();
else
this.doInitialKey();
keyArea.setNullable(rgbNullable);
keyArea.setModified(rgbModified);
keyArea.reverseKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
}
|
java
|
public void handleInitialKey() // init this field override for other value
{
KeyArea keyArea = this.getKeyArea(-1);
if (keyArea == null)
return;
BaseBuffer buffer = new VectorBuffer(null);
boolean[] rgbModified = keyArea.getModified();
boolean[] rgbNullable = keyArea.setNullable(true);
keyArea.setupKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
keyArea.zeroKeyFields(DBConstants.START_SELECT_KEY); // Zero out the key fields
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
((FileListener)nextListener).doInitialKey();
else
this.doInitialKey();
keyArea.setNullable(rgbNullable);
keyArea.setModified(rgbModified);
keyArea.reverseKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
}
|
[
"public",
"void",
"handleInitialKey",
"(",
")",
"// init this field override for other value",
"{",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getKeyArea",
"(",
"-",
"1",
")",
";",
"if",
"(",
"keyArea",
"==",
"null",
")",
"return",
";",
"BaseBuffer",
"buffer",
"=",
"new",
"VectorBuffer",
"(",
"null",
")",
";",
"boolean",
"[",
"]",
"rgbModified",
"=",
"keyArea",
".",
"getModified",
"(",
")",
";",
"boolean",
"[",
"]",
"rgbNullable",
"=",
"keyArea",
".",
"setNullable",
"(",
"true",
")",
";",
"keyArea",
".",
"setupKeyBuffer",
"(",
"buffer",
",",
"DBConstants",
".",
"FILE_KEY_AREA",
")",
";",
"keyArea",
".",
"zeroKeyFields",
"(",
"DBConstants",
".",
"START_SELECT_KEY",
")",
";",
"// Zero out the key fields",
"BaseListener",
"nextListener",
"=",
"this",
".",
"getNextEnabledListener",
"(",
")",
";",
"if",
"(",
"nextListener",
"!=",
"null",
")",
"(",
"(",
"FileListener",
")",
"nextListener",
")",
".",
"doInitialKey",
"(",
")",
";",
"else",
"this",
".",
"doInitialKey",
"(",
")",
";",
"keyArea",
".",
"setNullable",
"(",
"rgbNullable",
")",
";",
"keyArea",
".",
"setModified",
"(",
"rgbModified",
")",
";",
"keyArea",
".",
"reverseKeyBuffer",
"(",
"buffer",
",",
"DBConstants",
".",
"FILE_KEY_AREA",
")",
";",
"}"
] |
The initial key position is in this record... Save it!
|
[
"The",
"initial",
"key",
"position",
"is",
"in",
"this",
"record",
"...",
"Save",
"it!"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1581-L1599
|
152,427
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.handleEndKey
|
public void handleEndKey()
{
KeyArea keyArea = this.getKeyArea(-1);
if (keyArea == null)
return;
BaseBuffer buffer = new VectorBuffer(null);
boolean[] rgbModified = keyArea.getModified();
boolean[] rgbNullable = keyArea.setNullable(true);
keyArea.setupKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
keyArea.zeroKeyFields(DBConstants.END_SELECT_KEY); // Set the key fields to a large value
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
((FileListener)nextListener).doEndKey();
else
this.doEndKey();
keyArea.setNullable(rgbNullable);
keyArea.setModified(rgbModified);
keyArea.reverseKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
}
|
java
|
public void handleEndKey()
{
KeyArea keyArea = this.getKeyArea(-1);
if (keyArea == null)
return;
BaseBuffer buffer = new VectorBuffer(null);
boolean[] rgbModified = keyArea.getModified();
boolean[] rgbNullable = keyArea.setNullable(true);
keyArea.setupKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
keyArea.zeroKeyFields(DBConstants.END_SELECT_KEY); // Set the key fields to a large value
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
((FileListener)nextListener).doEndKey();
else
this.doEndKey();
keyArea.setNullable(rgbNullable);
keyArea.setModified(rgbModified);
keyArea.reverseKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);
}
|
[
"public",
"void",
"handleEndKey",
"(",
")",
"{",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getKeyArea",
"(",
"-",
"1",
")",
";",
"if",
"(",
"keyArea",
"==",
"null",
")",
"return",
";",
"BaseBuffer",
"buffer",
"=",
"new",
"VectorBuffer",
"(",
"null",
")",
";",
"boolean",
"[",
"]",
"rgbModified",
"=",
"keyArea",
".",
"getModified",
"(",
")",
";",
"boolean",
"[",
"]",
"rgbNullable",
"=",
"keyArea",
".",
"setNullable",
"(",
"true",
")",
";",
"keyArea",
".",
"setupKeyBuffer",
"(",
"buffer",
",",
"DBConstants",
".",
"FILE_KEY_AREA",
")",
";",
"keyArea",
".",
"zeroKeyFields",
"(",
"DBConstants",
".",
"END_SELECT_KEY",
")",
";",
"// Set the key fields to a large value",
"BaseListener",
"nextListener",
"=",
"this",
".",
"getNextEnabledListener",
"(",
")",
";",
"if",
"(",
"nextListener",
"!=",
"null",
")",
"(",
"(",
"FileListener",
")",
"nextListener",
")",
".",
"doEndKey",
"(",
")",
";",
"else",
"this",
".",
"doEndKey",
"(",
")",
";",
"keyArea",
".",
"setNullable",
"(",
"rgbNullable",
")",
";",
"keyArea",
".",
"setModified",
"(",
"rgbModified",
")",
";",
"keyArea",
".",
"reverseKeyBuffer",
"(",
"buffer",
",",
"DBConstants",
".",
"FILE_KEY_AREA",
")",
";",
"}"
] |
The end key position is in this record... Save it!
|
[
"The",
"end",
"key",
"position",
"is",
"in",
"this",
"record",
"...",
"Save",
"it!"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1611-L1629
|
152,428
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.handleLocalCriteria
|
public boolean handleLocalCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{
BaseListener nextListener = this.getNextEnabledListener();
boolean bDontSkip = true;
if (nextListener != null)
bDontSkip = ((FileListener)nextListener).doLocalCriteria(strFilter, bIncludeFileName, vParamList);
else
bDontSkip = this.doLocalCriteria(strFilter, bIncludeFileName, vParamList);
if (bDontSkip == false)
return bDontSkip; // skip it
return this.getTable().doLocalCriteria(strFilter, bIncludeFileName, vParamList); // Give the table a shot at it
}
|
java
|
public boolean handleLocalCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{
BaseListener nextListener = this.getNextEnabledListener();
boolean bDontSkip = true;
if (nextListener != null)
bDontSkip = ((FileListener)nextListener).doLocalCriteria(strFilter, bIncludeFileName, vParamList);
else
bDontSkip = this.doLocalCriteria(strFilter, bIncludeFileName, vParamList);
if (bDontSkip == false)
return bDontSkip; // skip it
return this.getTable().doLocalCriteria(strFilter, bIncludeFileName, vParamList); // Give the table a shot at it
}
|
[
"public",
"boolean",
"handleLocalCriteria",
"(",
"StringBuffer",
"strFilter",
",",
"boolean",
"bIncludeFileName",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"BaseListener",
"nextListener",
"=",
"this",
".",
"getNextEnabledListener",
"(",
")",
";",
"boolean",
"bDontSkip",
"=",
"true",
";",
"if",
"(",
"nextListener",
"!=",
"null",
")",
"bDontSkip",
"=",
"(",
"(",
"FileListener",
")",
"nextListener",
")",
".",
"doLocalCriteria",
"(",
"strFilter",
",",
"bIncludeFileName",
",",
"vParamList",
")",
";",
"else",
"bDontSkip",
"=",
"this",
".",
"doLocalCriteria",
"(",
"strFilter",
",",
"bIncludeFileName",
",",
"vParamList",
")",
";",
"if",
"(",
"bDontSkip",
"==",
"false",
")",
"return",
"bDontSkip",
";",
"// skip it",
"return",
"this",
".",
"getTable",
"(",
")",
".",
"doLocalCriteria",
"(",
"strFilter",
",",
"bIncludeFileName",
",",
"vParamList",
")",
";",
"// Give the table a shot at it",
"}"
] |
Check to see if this record should be skipped.
Generally, you use a remote criteria.
@param strFilter The current SQL WHERE string.
@param bIncludeFileName Include the Filename.fieldName in the string.
@param vParamList The list of params.
@return true if the criteria passes.
@return false if the criteria fails, and returns without checking further.
|
[
"Check",
"to",
"see",
"if",
"this",
"record",
"should",
"be",
"skipped",
".",
"Generally",
"you",
"use",
"a",
"remote",
"criteria",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1647-L1658
|
152,429
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.handleRemoteCriteria
|
public boolean handleRemoteCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
return ((FileListener)nextListener).doRemoteCriteria(strFilter, bIncludeFileName, vParamList);
else
return this.doRemoteCriteria(strFilter, bIncludeFileName, vParamList);
}
|
java
|
public boolean handleRemoteCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
return ((FileListener)nextListener).doRemoteCriteria(strFilter, bIncludeFileName, vParamList);
else
return this.doRemoteCriteria(strFilter, bIncludeFileName, vParamList);
}
|
[
"public",
"boolean",
"handleRemoteCriteria",
"(",
"StringBuffer",
"strFilter",
",",
"boolean",
"bIncludeFileName",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"BaseListener",
"nextListener",
"=",
"this",
".",
"getNextEnabledListener",
"(",
")",
";",
"if",
"(",
"nextListener",
"!=",
"null",
")",
"return",
"(",
"(",
"FileListener",
")",
"nextListener",
")",
".",
"doRemoteCriteria",
"(",
"strFilter",
",",
"bIncludeFileName",
",",
"vParamList",
")",
";",
"else",
"return",
"this",
".",
"doRemoteCriteria",
"(",
"strFilter",
",",
"bIncludeFileName",
",",
"vParamList",
")",
";",
"}"
] |
Check to see if this record should be skipped.
@param strFilter The current SQL WHERE string.
@param bIncludeFileName Include the Filename.fieldName in the string.
@param vParamList The list of params.
@return true if the criteria passes.
@return false if the criteria fails, and returns without checking further.
|
[
"Check",
"to",
"see",
"if",
"this",
"record",
"should",
"be",
"skipped",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1680-L1687
|
152,430
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.isModified
|
public boolean isModified(boolean bNonKeyOnly)
{
int fieldCount = this.getFieldCount(); // BaseField Count
for (int fieldSeq = DBConstants.MAIN_FIELD; fieldSeq < fieldCount+DBConstants.MAIN_FIELD; fieldSeq++)
{
BaseField field = this.getField(fieldSeq);
if (field.isModified()) if (!field.isVirtual()) // If not public and has been modified...
{
boolean bSkip = false;
if (bNonKeyOnly)
{
KeyArea index = this.getKeyArea(-1);
for (int i = DBConstants.MAIN_KEY_FIELD; i < index.getKeyFields(); i++)
{
if (field == index.getField(i))
{
bSkip = true; // Skip this one
break;
}
}
}
if (!bSkip)
return true; // A field has been changed
}
}
return false; // No Changes YET
}
|
java
|
public boolean isModified(boolean bNonKeyOnly)
{
int fieldCount = this.getFieldCount(); // BaseField Count
for (int fieldSeq = DBConstants.MAIN_FIELD; fieldSeq < fieldCount+DBConstants.MAIN_FIELD; fieldSeq++)
{
BaseField field = this.getField(fieldSeq);
if (field.isModified()) if (!field.isVirtual()) // If not public and has been modified...
{
boolean bSkip = false;
if (bNonKeyOnly)
{
KeyArea index = this.getKeyArea(-1);
for (int i = DBConstants.MAIN_KEY_FIELD; i < index.getKeyFields(); i++)
{
if (field == index.getField(i))
{
bSkip = true; // Skip this one
break;
}
}
}
if (!bSkip)
return true; // A field has been changed
}
}
return false; // No Changes YET
}
|
[
"public",
"boolean",
"isModified",
"(",
"boolean",
"bNonKeyOnly",
")",
"{",
"int",
"fieldCount",
"=",
"this",
".",
"getFieldCount",
"(",
")",
";",
"// BaseField Count",
"for",
"(",
"int",
"fieldSeq",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"fieldSeq",
"<",
"fieldCount",
"+",
"DBConstants",
".",
"MAIN_FIELD",
";",
"fieldSeq",
"++",
")",
"{",
"BaseField",
"field",
"=",
"this",
".",
"getField",
"(",
"fieldSeq",
")",
";",
"if",
"(",
"field",
".",
"isModified",
"(",
")",
")",
"if",
"(",
"!",
"field",
".",
"isVirtual",
"(",
")",
")",
"// If not public and has been modified...",
"{",
"boolean",
"bSkip",
"=",
"false",
";",
"if",
"(",
"bNonKeyOnly",
")",
"{",
"KeyArea",
"index",
"=",
"this",
".",
"getKeyArea",
"(",
"-",
"1",
")",
";",
"for",
"(",
"int",
"i",
"=",
"DBConstants",
".",
"MAIN_KEY_FIELD",
";",
"i",
"<",
"index",
".",
"getKeyFields",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"field",
"==",
"index",
".",
"getField",
"(",
"i",
")",
")",
"{",
"bSkip",
"=",
"true",
";",
"// Skip this one",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"bSkip",
")",
"return",
"true",
";",
"// A field has been changed",
"}",
"}",
"return",
"false",
";",
"// No Changes YET",
"}"
] |
Have any fields Changed?
@param bNonKeyOnly If we are talking about non current key fields only.
@return true if any fields have changed.
|
[
"Have",
"any",
"fields",
"Changed?"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2026-L2052
|
152,431
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.setModified
|
public void setModified(boolean[] rgbModified)
{
int iFieldCount = this.getFieldCount(); // BaseField Count
for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < iFieldCount + DBConstants.MAIN_FIELD; iFieldSeq++)
{
BaseField field = this.getField(iFieldSeq);
if (iFieldSeq < rgbModified.length)
field.setModified(rgbModified[iFieldSeq]);
}
}
|
java
|
public void setModified(boolean[] rgbModified)
{
int iFieldCount = this.getFieldCount(); // BaseField Count
for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < iFieldCount + DBConstants.MAIN_FIELD; iFieldSeq++)
{
BaseField field = this.getField(iFieldSeq);
if (iFieldSeq < rgbModified.length)
field.setModified(rgbModified[iFieldSeq]);
}
}
|
[
"public",
"void",
"setModified",
"(",
"boolean",
"[",
"]",
"rgbModified",
")",
"{",
"int",
"iFieldCount",
"=",
"this",
".",
"getFieldCount",
"(",
")",
";",
"// BaseField Count",
"for",
"(",
"int",
"iFieldSeq",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"iFieldSeq",
"<",
"iFieldCount",
"+",
"DBConstants",
".",
"MAIN_FIELD",
";",
"iFieldSeq",
"++",
")",
"{",
"BaseField",
"field",
"=",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
";",
"if",
"(",
"iFieldSeq",
"<",
"rgbModified",
".",
"length",
")",
"field",
".",
"setModified",
"(",
"rgbModified",
"[",
"iFieldSeq",
"]",
")",
";",
"}",
"}"
] |
Restore the field's modified status to this.
@param bNonKeyOnly If we are talking about non current key fields only.
@return true if any fields have changed.
|
[
"Restore",
"the",
"field",
"s",
"modified",
"status",
"to",
"this",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2074-L2083
|
152,432
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.isNull
|
public boolean isNull()
{ // Return true if all non null fields have data in them
int fieldCount = this.getFieldCount(); // BaseField Count
for (int fieldSeq = DBConstants.MAIN_FIELD; fieldSeq < fieldCount+DBConstants.MAIN_FIELD; fieldSeq++)
{
BaseField field = this.getField(fieldSeq);
if ((!field.isNullable()) && (field.isNull()))
return true; // This field can't be null!!!
}
return false; // All fields okay
}
|
java
|
public boolean isNull()
{ // Return true if all non null fields have data in them
int fieldCount = this.getFieldCount(); // BaseField Count
for (int fieldSeq = DBConstants.MAIN_FIELD; fieldSeq < fieldCount+DBConstants.MAIN_FIELD; fieldSeq++)
{
BaseField field = this.getField(fieldSeq);
if ((!field.isNullable()) && (field.isNull()))
return true; // This field can't be null!!!
}
return false; // All fields okay
}
|
[
"public",
"boolean",
"isNull",
"(",
")",
"{",
"// Return true if all non null fields have data in them",
"int",
"fieldCount",
"=",
"this",
".",
"getFieldCount",
"(",
")",
";",
"// BaseField Count",
"for",
"(",
"int",
"fieldSeq",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"fieldSeq",
"<",
"fieldCount",
"+",
"DBConstants",
".",
"MAIN_FIELD",
";",
"fieldSeq",
"++",
")",
"{",
"BaseField",
"field",
"=",
"this",
".",
"getField",
"(",
"fieldSeq",
")",
";",
"if",
"(",
"(",
"!",
"field",
".",
"isNullable",
"(",
")",
")",
"&&",
"(",
"field",
".",
"isNull",
"(",
")",
")",
")",
"return",
"true",
";",
"// This field can't be null!!!",
"}",
"return",
"false",
";",
"// All fields okay",
"}"
] |
Are there any null fields which can't be null?
@return true If a non-nullable field is null.
@return false If the fields are okay.
|
[
"Are",
"there",
"any",
"null",
"fields",
"which",
"can",
"t",
"be",
"null?"
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2089-L2099
|
152,433
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.addDependentScreen
|
public void addDependentScreen(ScreenParent screen)
{
if (m_depScreens == null)
m_depScreens = new Vector<ScreenParent>();
m_depScreens.addElement(screen);
screen.setDependentQuery(this);
}
|
java
|
public void addDependentScreen(ScreenParent screen)
{
if (m_depScreens == null)
m_depScreens = new Vector<ScreenParent>();
m_depScreens.addElement(screen);
screen.setDependentQuery(this);
}
|
[
"public",
"void",
"addDependentScreen",
"(",
"ScreenParent",
"screen",
")",
"{",
"if",
"(",
"m_depScreens",
"==",
"null",
")",
"m_depScreens",
"=",
"new",
"Vector",
"<",
"ScreenParent",
">",
"(",
")",
";",
"m_depScreens",
".",
"addElement",
"(",
"screen",
")",
";",
"screen",
".",
"setDependentQuery",
"(",
"this",
")",
";",
"}"
] |
Add another screen dependent on this record.
If this record is closed, so is the dependent screen.
@param screen Dependent screen to add.
|
[
"Add",
"another",
"screen",
"dependent",
"on",
"this",
"record",
".",
"If",
"this",
"record",
"is",
"closed",
"so",
"is",
"the",
"dependent",
"screen",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2418-L2424
|
152,434
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.removeDependentScreen
|
public void removeDependentScreen(ScreenParent screen)
{
if (m_depScreens == null)
return;
if (m_depScreens.contains(screen))
m_depScreens.removeElement(screen);
screen.setDependentQuery(null);
}
|
java
|
public void removeDependentScreen(ScreenParent screen)
{
if (m_depScreens == null)
return;
if (m_depScreens.contains(screen))
m_depScreens.removeElement(screen);
screen.setDependentQuery(null);
}
|
[
"public",
"void",
"removeDependentScreen",
"(",
"ScreenParent",
"screen",
")",
"{",
"if",
"(",
"m_depScreens",
"==",
"null",
")",
"return",
";",
"if",
"(",
"m_depScreens",
".",
"contains",
"(",
"screen",
")",
")",
"m_depScreens",
".",
"removeElement",
"(",
"screen",
")",
";",
"screen",
".",
"setDependentQuery",
"(",
"null",
")",
";",
"}"
] |
Remove a dependent screen.
@param screen The screen to remove.
|
[
"Remove",
"a",
"dependent",
"screen",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2429-L2436
|
152,435
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getCounterField
|
public FieldInfo getCounterField()
{
KeyArea keyArea = this.getKeyArea(DBConstants.MAIN_KEY_AREA);
if (keyArea != null)
{
BaseField fldID = keyArea.getKeyField(DBConstants.MAIN_KEY_FIELD).getField(DBConstants.FILE_KEY_AREA);
if (fldID instanceof CounterField)
return (CounterField)fldID;
}
return null; // None
}
|
java
|
public FieldInfo getCounterField()
{
KeyArea keyArea = this.getKeyArea(DBConstants.MAIN_KEY_AREA);
if (keyArea != null)
{
BaseField fldID = keyArea.getKeyField(DBConstants.MAIN_KEY_FIELD).getField(DBConstants.FILE_KEY_AREA);
if (fldID instanceof CounterField)
return (CounterField)fldID;
}
return null; // None
}
|
[
"public",
"FieldInfo",
"getCounterField",
"(",
")",
"{",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getKeyArea",
"(",
"DBConstants",
".",
"MAIN_KEY_AREA",
")",
";",
"if",
"(",
"keyArea",
"!=",
"null",
")",
"{",
"BaseField",
"fldID",
"=",
"keyArea",
".",
"getKeyField",
"(",
"DBConstants",
".",
"MAIN_KEY_FIELD",
")",
".",
"getField",
"(",
"DBConstants",
".",
"FILE_KEY_AREA",
")",
";",
"if",
"(",
"fldID",
"instanceof",
"CounterField",
")",
"return",
"(",
"CounterField",
")",
"fldID",
";",
"}",
"return",
"null",
";",
"// None",
"}"
] |
Get the autosequence field if it exists.
@return The counterfield or null.
|
[
"Get",
"the",
"autosequence",
"field",
"if",
"it",
"exists",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2662-L2672
|
152,436
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.moveFields
|
public boolean moveFields(Record recSource, ResourceBundle resource, boolean bDisplayOption, int iMoveMode, boolean bAllowFieldChange, boolean bOnlyModifiedFields, boolean bMoveModifiedState, boolean syncSelection)
{
boolean bFieldsMoved = false;
for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
{
BaseField fldDest = this.getField(iFieldSeq);
BaseField fldSource = null;
try {
if (resource == Record.MOVE_BY_NAME)
{
String strSourceField = fldDest.getFieldName();
fldSource = recSource.getField(strSourceField);
}
else if (resource != null)
{
String strSourceField = resource.getString(fldDest.getFieldName()); // Lookup source field name from dest
if ((strSourceField != null) && (strSourceField.length() > 0))
fldSource = recSource.getField(strSourceField);
}
else // if (resource == null)
{
fldSource = recSource.getField(iFieldSeq);
}
} catch (MissingResourceException ex) {
fldSource = null;
}
if (fldSource != null)
{
if ((!bOnlyModifiedFields) || (fldSource.isModified()))
{
boolean[] rgbEnabled = null;
if (bAllowFieldChange == false) // Don't enable a disabled field listener
rgbEnabled = fldDest.setEnableListeners(bAllowFieldChange); // Don't call the HandleFieldChanged beh until ALL inited!
FieldDataScratchHandler listenerScratchData = null;
if ((bAllowFieldChange == false) && (bMoveModifiedState))
if (iMoveMode == DBConstants.READ_MOVE) // Very obscure - Make sure this fake read move does not change the scratch area
if (fldDest.getNextValidListener(iMoveMode) instanceof FieldDataScratchHandler) // Always enable would have to be true since listeners have been disabled
(listenerScratchData = ((FieldDataScratchHandler)fldDest.getNextValidListener(iMoveMode))).setAlwaysEnabled(false);
fldDest.moveFieldToThis(fldSource, bDisplayOption, iMoveMode);
if (listenerScratchData != null)
listenerScratchData.setAlwaysEnabled(true);
if (rgbEnabled != null)
fldDest.setEnableListeners(rgbEnabled);
if (bAllowFieldChange == false)
fldDest.setModified(false); // At this point, no changes have been done
bFieldsMoved = true;
}
if ((bAllowFieldChange) || (bMoveModifiedState))
fldDest.setModified(fldSource.isModified()); // If you allow field change set if source is modified.
if (syncSelection)
fldDest.setSelected(fldSource.isSelected());
}
}
return bFieldsMoved;
}
|
java
|
public boolean moveFields(Record recSource, ResourceBundle resource, boolean bDisplayOption, int iMoveMode, boolean bAllowFieldChange, boolean bOnlyModifiedFields, boolean bMoveModifiedState, boolean syncSelection)
{
boolean bFieldsMoved = false;
for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
{
BaseField fldDest = this.getField(iFieldSeq);
BaseField fldSource = null;
try {
if (resource == Record.MOVE_BY_NAME)
{
String strSourceField = fldDest.getFieldName();
fldSource = recSource.getField(strSourceField);
}
else if (resource != null)
{
String strSourceField = resource.getString(fldDest.getFieldName()); // Lookup source field name from dest
if ((strSourceField != null) && (strSourceField.length() > 0))
fldSource = recSource.getField(strSourceField);
}
else // if (resource == null)
{
fldSource = recSource.getField(iFieldSeq);
}
} catch (MissingResourceException ex) {
fldSource = null;
}
if (fldSource != null)
{
if ((!bOnlyModifiedFields) || (fldSource.isModified()))
{
boolean[] rgbEnabled = null;
if (bAllowFieldChange == false) // Don't enable a disabled field listener
rgbEnabled = fldDest.setEnableListeners(bAllowFieldChange); // Don't call the HandleFieldChanged beh until ALL inited!
FieldDataScratchHandler listenerScratchData = null;
if ((bAllowFieldChange == false) && (bMoveModifiedState))
if (iMoveMode == DBConstants.READ_MOVE) // Very obscure - Make sure this fake read move does not change the scratch area
if (fldDest.getNextValidListener(iMoveMode) instanceof FieldDataScratchHandler) // Always enable would have to be true since listeners have been disabled
(listenerScratchData = ((FieldDataScratchHandler)fldDest.getNextValidListener(iMoveMode))).setAlwaysEnabled(false);
fldDest.moveFieldToThis(fldSource, bDisplayOption, iMoveMode);
if (listenerScratchData != null)
listenerScratchData.setAlwaysEnabled(true);
if (rgbEnabled != null)
fldDest.setEnableListeners(rgbEnabled);
if (bAllowFieldChange == false)
fldDest.setModified(false); // At this point, no changes have been done
bFieldsMoved = true;
}
if ((bAllowFieldChange) || (bMoveModifiedState))
fldDest.setModified(fldSource.isModified()); // If you allow field change set if source is modified.
if (syncSelection)
fldDest.setSelected(fldSource.isSelected());
}
}
return bFieldsMoved;
}
|
[
"public",
"boolean",
"moveFields",
"(",
"Record",
"recSource",
",",
"ResourceBundle",
"resource",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
",",
"boolean",
"bAllowFieldChange",
",",
"boolean",
"bOnlyModifiedFields",
",",
"boolean",
"bMoveModifiedState",
",",
"boolean",
"syncSelection",
")",
"{",
"boolean",
"bFieldsMoved",
"=",
"false",
";",
"for",
"(",
"int",
"iFieldSeq",
"=",
"0",
";",
"iFieldSeq",
"<",
"this",
".",
"getFieldCount",
"(",
")",
";",
"iFieldSeq",
"++",
")",
"{",
"BaseField",
"fldDest",
"=",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
";",
"BaseField",
"fldSource",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"resource",
"==",
"Record",
".",
"MOVE_BY_NAME",
")",
"{",
"String",
"strSourceField",
"=",
"fldDest",
".",
"getFieldName",
"(",
")",
";",
"fldSource",
"=",
"recSource",
".",
"getField",
"(",
"strSourceField",
")",
";",
"}",
"else",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"String",
"strSourceField",
"=",
"resource",
".",
"getString",
"(",
"fldDest",
".",
"getFieldName",
"(",
")",
")",
";",
"// Lookup source field name from dest",
"if",
"(",
"(",
"strSourceField",
"!=",
"null",
")",
"&&",
"(",
"strSourceField",
".",
"length",
"(",
")",
">",
"0",
")",
")",
"fldSource",
"=",
"recSource",
".",
"getField",
"(",
"strSourceField",
")",
";",
"}",
"else",
"// if (resource == null)",
"{",
"fldSource",
"=",
"recSource",
".",
"getField",
"(",
"iFieldSeq",
")",
";",
"}",
"}",
"catch",
"(",
"MissingResourceException",
"ex",
")",
"{",
"fldSource",
"=",
"null",
";",
"}",
"if",
"(",
"fldSource",
"!=",
"null",
")",
"{",
"if",
"(",
"(",
"!",
"bOnlyModifiedFields",
")",
"||",
"(",
"fldSource",
".",
"isModified",
"(",
")",
")",
")",
"{",
"boolean",
"[",
"]",
"rgbEnabled",
"=",
"null",
";",
"if",
"(",
"bAllowFieldChange",
"==",
"false",
")",
"// Don't enable a disabled field listener",
"rgbEnabled",
"=",
"fldDest",
".",
"setEnableListeners",
"(",
"bAllowFieldChange",
")",
";",
"// Don't call the HandleFieldChanged beh until ALL inited!",
"FieldDataScratchHandler",
"listenerScratchData",
"=",
"null",
";",
"if",
"(",
"(",
"bAllowFieldChange",
"==",
"false",
")",
"&&",
"(",
"bMoveModifiedState",
")",
")",
"if",
"(",
"iMoveMode",
"==",
"DBConstants",
".",
"READ_MOVE",
")",
"// Very obscure - Make sure this fake read move does not change the scratch area",
"if",
"(",
"fldDest",
".",
"getNextValidListener",
"(",
"iMoveMode",
")",
"instanceof",
"FieldDataScratchHandler",
")",
"// Always enable would have to be true since listeners have been disabled",
"(",
"listenerScratchData",
"=",
"(",
"(",
"FieldDataScratchHandler",
")",
"fldDest",
".",
"getNextValidListener",
"(",
"iMoveMode",
")",
")",
")",
".",
"setAlwaysEnabled",
"(",
"false",
")",
";",
"fldDest",
".",
"moveFieldToThis",
"(",
"fldSource",
",",
"bDisplayOption",
",",
"iMoveMode",
")",
";",
"if",
"(",
"listenerScratchData",
"!=",
"null",
")",
"listenerScratchData",
".",
"setAlwaysEnabled",
"(",
"true",
")",
";",
"if",
"(",
"rgbEnabled",
"!=",
"null",
")",
"fldDest",
".",
"setEnableListeners",
"(",
"rgbEnabled",
")",
";",
"if",
"(",
"bAllowFieldChange",
"==",
"false",
")",
"fldDest",
".",
"setModified",
"(",
"false",
")",
";",
"// At this point, no changes have been done",
"bFieldsMoved",
"=",
"true",
";",
"}",
"if",
"(",
"(",
"bAllowFieldChange",
")",
"||",
"(",
"bMoveModifiedState",
")",
")",
"fldDest",
".",
"setModified",
"(",
"fldSource",
".",
"isModified",
"(",
")",
")",
";",
"// If you allow field change set if source is modified.",
"if",
"(",
"syncSelection",
")",
"fldDest",
".",
"setSelected",
"(",
"fldSource",
".",
"isSelected",
"(",
")",
")",
";",
"}",
"}",
"return",
"bFieldsMoved",
";",
"}"
] |
Copy all the fields from one record to another.
@param recSource
@param resource
@param bDisplayOption
@param iMoveMode
@param bAllowFieldChange
@param bOnlyModifiedFields
@param bMoveModifiedState
@param syncSelection TODO
@return true if successful
|
[
"Copy",
"all",
"the",
"fields",
"from",
"one",
"record",
"to",
"another",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2715-L2773
|
152,437
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.selectScreenFields
|
public void selectScreenFields()
{
if (this.isOpen())
return; // Can't select after it's open
//x this.setSelected(false);
// for (Enumeration e = m_SFieldList.elements() ; e.hasMoreElements() ;)
{ // This should only be called for Imaged GridScreens (Child windows would be deleted by now if Component)
// ScreenField sField = (ScreenField)e.nextElement();
// if (sField.getConverter() != null) if (sField.getConverter().getField() != null)
// ((BaseField)sField.getConverter().getField()).setSelected(true);
}
Record recordBase = this.getBaseRecord(); // Get an actual Record to add/edit/etc...
if (recordBase != null)
{ // Make sure the main key area's keys are selected
for (int iIndex = DBConstants.MAIN_FIELD; iIndex < recordBase.getFieldCount(); iIndex++)
{
boolean bSelect = false; // By default
BaseField field = recordBase.getField(iIndex);
if (field.isVirtual())
continue; // Who cares if a virtual field is selected or not? (actually, I sometimes need to auto-cache virtuals).
if (field.getComponent(0) != null)
bSelect = true; // If you are linked to a screen field, you should be selected
else
{
FieldListener listener = field.getListener();
while (listener != null)
{
if (listener.respondsToMode(DBConstants.READ_MOVE))
{
if ((!field.isVirtual())
|| (listener instanceof ReadSecondaryHandler))
bSelect = true;
}
listener = (FieldListener)listener.getNextListener(); // Next listener in chain
}
}
field.setSelected(bSelect); // Select/deselect field
}
KeyArea keyArea = recordBase.getKeyArea(DBConstants.MAIN_KEY_AREA);
int iLastIndex = keyArea.getKeyFields() + DBConstants.MAIN_FIELD;
for (int iIndexSeq = DBConstants.MAIN_FIELD; iIndexSeq < iLastIndex; iIndexSeq++)
{ // Make sure the index key is selected!
keyArea.getField(iIndexSeq).setSelected(true);
}
}
this.selectFields(); // This will do nothing, unless there is a specific selection method
}
|
java
|
public void selectScreenFields()
{
if (this.isOpen())
return; // Can't select after it's open
//x this.setSelected(false);
// for (Enumeration e = m_SFieldList.elements() ; e.hasMoreElements() ;)
{ // This should only be called for Imaged GridScreens (Child windows would be deleted by now if Component)
// ScreenField sField = (ScreenField)e.nextElement();
// if (sField.getConverter() != null) if (sField.getConverter().getField() != null)
// ((BaseField)sField.getConverter().getField()).setSelected(true);
}
Record recordBase = this.getBaseRecord(); // Get an actual Record to add/edit/etc...
if (recordBase != null)
{ // Make sure the main key area's keys are selected
for (int iIndex = DBConstants.MAIN_FIELD; iIndex < recordBase.getFieldCount(); iIndex++)
{
boolean bSelect = false; // By default
BaseField field = recordBase.getField(iIndex);
if (field.isVirtual())
continue; // Who cares if a virtual field is selected or not? (actually, I sometimes need to auto-cache virtuals).
if (field.getComponent(0) != null)
bSelect = true; // If you are linked to a screen field, you should be selected
else
{
FieldListener listener = field.getListener();
while (listener != null)
{
if (listener.respondsToMode(DBConstants.READ_MOVE))
{
if ((!field.isVirtual())
|| (listener instanceof ReadSecondaryHandler))
bSelect = true;
}
listener = (FieldListener)listener.getNextListener(); // Next listener in chain
}
}
field.setSelected(bSelect); // Select/deselect field
}
KeyArea keyArea = recordBase.getKeyArea(DBConstants.MAIN_KEY_AREA);
int iLastIndex = keyArea.getKeyFields() + DBConstants.MAIN_FIELD;
for (int iIndexSeq = DBConstants.MAIN_FIELD; iIndexSeq < iLastIndex; iIndexSeq++)
{ // Make sure the index key is selected!
keyArea.getField(iIndexSeq).setSelected(true);
}
}
this.selectFields(); // This will do nothing, unless there is a specific selection method
}
|
[
"public",
"void",
"selectScreenFields",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isOpen",
"(",
")",
")",
"return",
";",
"// Can't select after it's open",
"//x this.setSelected(false);",
"// for (Enumeration e = m_SFieldList.elements() ; e.hasMoreElements() ;)",
"{",
"// This should only be called for Imaged GridScreens (Child windows would be deleted by now if Component)",
"// ScreenField sField = (ScreenField)e.nextElement();",
"// if (sField.getConverter() != null) if (sField.getConverter().getField() != null)",
"// ((BaseField)sField.getConverter().getField()).setSelected(true);",
"}",
"Record",
"recordBase",
"=",
"this",
".",
"getBaseRecord",
"(",
")",
";",
"// Get an actual Record to add/edit/etc...",
"if",
"(",
"recordBase",
"!=",
"null",
")",
"{",
"// Make sure the main key area's keys are selected",
"for",
"(",
"int",
"iIndex",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"iIndex",
"<",
"recordBase",
".",
"getFieldCount",
"(",
")",
";",
"iIndex",
"++",
")",
"{",
"boolean",
"bSelect",
"=",
"false",
";",
"// By default",
"BaseField",
"field",
"=",
"recordBase",
".",
"getField",
"(",
"iIndex",
")",
";",
"if",
"(",
"field",
".",
"isVirtual",
"(",
")",
")",
"continue",
";",
"// Who cares if a virtual field is selected or not? (actually, I sometimes need to auto-cache virtuals).",
"if",
"(",
"field",
".",
"getComponent",
"(",
"0",
")",
"!=",
"null",
")",
"bSelect",
"=",
"true",
";",
"// If you are linked to a screen field, you should be selected",
"else",
"{",
"FieldListener",
"listener",
"=",
"field",
".",
"getListener",
"(",
")",
";",
"while",
"(",
"listener",
"!=",
"null",
")",
"{",
"if",
"(",
"listener",
".",
"respondsToMode",
"(",
"DBConstants",
".",
"READ_MOVE",
")",
")",
"{",
"if",
"(",
"(",
"!",
"field",
".",
"isVirtual",
"(",
")",
")",
"||",
"(",
"listener",
"instanceof",
"ReadSecondaryHandler",
")",
")",
"bSelect",
"=",
"true",
";",
"}",
"listener",
"=",
"(",
"FieldListener",
")",
"listener",
".",
"getNextListener",
"(",
")",
";",
"// Next listener in chain",
"}",
"}",
"field",
".",
"setSelected",
"(",
"bSelect",
")",
";",
"// Select/deselect field",
"}",
"KeyArea",
"keyArea",
"=",
"recordBase",
".",
"getKeyArea",
"(",
"DBConstants",
".",
"MAIN_KEY_AREA",
")",
";",
"int",
"iLastIndex",
"=",
"keyArea",
".",
"getKeyFields",
"(",
")",
"+",
"DBConstants",
".",
"MAIN_FIELD",
";",
"for",
"(",
"int",
"iIndexSeq",
"=",
"DBConstants",
".",
"MAIN_FIELD",
";",
"iIndexSeq",
"<",
"iLastIndex",
";",
"iIndexSeq",
"++",
")",
"{",
"// Make sure the index key is selected!",
"keyArea",
".",
"getField",
"(",
"iIndexSeq",
")",
".",
"setSelected",
"(",
"true",
")",
";",
"}",
"}",
"this",
".",
"selectFields",
"(",
")",
";",
"// This will do nothing, unless there is a specific selection method",
"}"
] |
Optimize the query by only selecting the fields which are being displayed.
|
[
"Optimize",
"the",
"query",
"by",
"only",
"selecting",
"the",
"fields",
"which",
"are",
"being",
"displayed",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2862-L2908
|
152,438
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.checkAndHandleFieldChanges
|
public boolean checkAndHandleFieldChanges(BaseBuffer buffer, boolean[] rgbModified, boolean bRestoreVirtualFields)
{
boolean bAnyChanged = false;
// Fifth step: If what is currently on the screen is different from the new merged data, re-call the handleFieldChanged (SCREEN_MOVE)
buffer.resetPosition();
for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
{
BaseField field = this.getField(iFieldSeq);
Object dataScreen = buffer.getNextData();
Object dataUpdated = field.getData();
if (((dataUpdated != null) && (!dataUpdated.equals(dataScreen)))
|| ((dataUpdated == null) && (dataScreen != dataUpdated))
|| (field.isModified()))
{ // I compare rather than check isModified due to the virtual fields
if ((this.getField(iFieldSeq).isVirtual())
&& (!this.getField(iFieldSeq).isModified())
&& (this.getField(iFieldSeq).getData() == this.getField(iFieldSeq).getDefault()))
{ // Virtual fields that were not changed, need to be returned to their former value
if (bRestoreVirtualFields)
{
boolean[] rgbEnabled = this.getField(iFieldSeq).setEnableListeners(false);
this.getField(iFieldSeq).setData(dataScreen);
this.getField(iFieldSeq).setModified(false);
this.getField(iFieldSeq).setEnableListeners(rgbEnabled);
}
}
else
{
int iMoveMode = field.isModified() ? DBConstants.SCREEN_MOVE : DBConstants.READ_MOVE; // If I changed it, SCREEN_MOVE, if data changed, READ_MOVE
if (rgbModified != null)
if (rgbModified[iFieldSeq])
{
iMoveMode = DBConstants.SCREEN_MOVE; // Special case if I changed it, and the someone else changed it to the same thing, hit screen_move one more time.
if (field.isVirtual())
if (((dataUpdated != null) && (dataUpdated.equals(dataScreen)))
|| ((dataUpdated == null) && (dataScreen == dataUpdated)))
if (!field.isJustModified()) // Extra special case - Since a changed virtual field will always be modified, see if it actually changed;
iMoveMode = DBConstants.READ_MOVE; // Extra special case - If not, see if someone else modified it
}
this.getField(iFieldSeq).handleFieldChanged(DBConstants.DISPLAY, iMoveMode);
bAnyChanged = true;
}
}
}
return bAnyChanged;
}
|
java
|
public boolean checkAndHandleFieldChanges(BaseBuffer buffer, boolean[] rgbModified, boolean bRestoreVirtualFields)
{
boolean bAnyChanged = false;
// Fifth step: If what is currently on the screen is different from the new merged data, re-call the handleFieldChanged (SCREEN_MOVE)
buffer.resetPosition();
for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
{
BaseField field = this.getField(iFieldSeq);
Object dataScreen = buffer.getNextData();
Object dataUpdated = field.getData();
if (((dataUpdated != null) && (!dataUpdated.equals(dataScreen)))
|| ((dataUpdated == null) && (dataScreen != dataUpdated))
|| (field.isModified()))
{ // I compare rather than check isModified due to the virtual fields
if ((this.getField(iFieldSeq).isVirtual())
&& (!this.getField(iFieldSeq).isModified())
&& (this.getField(iFieldSeq).getData() == this.getField(iFieldSeq).getDefault()))
{ // Virtual fields that were not changed, need to be returned to their former value
if (bRestoreVirtualFields)
{
boolean[] rgbEnabled = this.getField(iFieldSeq).setEnableListeners(false);
this.getField(iFieldSeq).setData(dataScreen);
this.getField(iFieldSeq).setModified(false);
this.getField(iFieldSeq).setEnableListeners(rgbEnabled);
}
}
else
{
int iMoveMode = field.isModified() ? DBConstants.SCREEN_MOVE : DBConstants.READ_MOVE; // If I changed it, SCREEN_MOVE, if data changed, READ_MOVE
if (rgbModified != null)
if (rgbModified[iFieldSeq])
{
iMoveMode = DBConstants.SCREEN_MOVE; // Special case if I changed it, and the someone else changed it to the same thing, hit screen_move one more time.
if (field.isVirtual())
if (((dataUpdated != null) && (dataUpdated.equals(dataScreen)))
|| ((dataUpdated == null) && (dataScreen == dataUpdated)))
if (!field.isJustModified()) // Extra special case - Since a changed virtual field will always be modified, see if it actually changed;
iMoveMode = DBConstants.READ_MOVE; // Extra special case - If not, see if someone else modified it
}
this.getField(iFieldSeq).handleFieldChanged(DBConstants.DISPLAY, iMoveMode);
bAnyChanged = true;
}
}
}
return bAnyChanged;
}
|
[
"public",
"boolean",
"checkAndHandleFieldChanges",
"(",
"BaseBuffer",
"buffer",
",",
"boolean",
"[",
"]",
"rgbModified",
",",
"boolean",
"bRestoreVirtualFields",
")",
"{",
"boolean",
"bAnyChanged",
"=",
"false",
";",
"// Fifth step: If what is currently on the screen is different from the new merged data, re-call the handleFieldChanged (SCREEN_MOVE)",
"buffer",
".",
"resetPosition",
"(",
")",
";",
"for",
"(",
"int",
"iFieldSeq",
"=",
"0",
";",
"iFieldSeq",
"<",
"this",
".",
"getFieldCount",
"(",
")",
";",
"iFieldSeq",
"++",
")",
"{",
"BaseField",
"field",
"=",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
";",
"Object",
"dataScreen",
"=",
"buffer",
".",
"getNextData",
"(",
")",
";",
"Object",
"dataUpdated",
"=",
"field",
".",
"getData",
"(",
")",
";",
"if",
"(",
"(",
"(",
"dataUpdated",
"!=",
"null",
")",
"&&",
"(",
"!",
"dataUpdated",
".",
"equals",
"(",
"dataScreen",
")",
")",
")",
"||",
"(",
"(",
"dataUpdated",
"==",
"null",
")",
"&&",
"(",
"dataScreen",
"!=",
"dataUpdated",
")",
")",
"||",
"(",
"field",
".",
"isModified",
"(",
")",
")",
")",
"{",
"// I compare rather than check isModified due to the virtual fields",
"if",
"(",
"(",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"isVirtual",
"(",
")",
")",
"&&",
"(",
"!",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"isModified",
"(",
")",
")",
"&&",
"(",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"getData",
"(",
")",
"==",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"getDefault",
"(",
")",
")",
")",
"{",
"// Virtual fields that were not changed, need to be returned to their former value",
"if",
"(",
"bRestoreVirtualFields",
")",
"{",
"boolean",
"[",
"]",
"rgbEnabled",
"=",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"setEnableListeners",
"(",
"false",
")",
";",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"setData",
"(",
"dataScreen",
")",
";",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"setModified",
"(",
"false",
")",
";",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"setEnableListeners",
"(",
"rgbEnabled",
")",
";",
"}",
"}",
"else",
"{",
"int",
"iMoveMode",
"=",
"field",
".",
"isModified",
"(",
")",
"?",
"DBConstants",
".",
"SCREEN_MOVE",
":",
"DBConstants",
".",
"READ_MOVE",
";",
"// If I changed it, SCREEN_MOVE, if data changed, READ_MOVE",
"if",
"(",
"rgbModified",
"!=",
"null",
")",
"if",
"(",
"rgbModified",
"[",
"iFieldSeq",
"]",
")",
"{",
"iMoveMode",
"=",
"DBConstants",
".",
"SCREEN_MOVE",
";",
"// Special case if I changed it, and the someone else changed it to the same thing, hit screen_move one more time.",
"if",
"(",
"field",
".",
"isVirtual",
"(",
")",
")",
"if",
"(",
"(",
"(",
"dataUpdated",
"!=",
"null",
")",
"&&",
"(",
"dataUpdated",
".",
"equals",
"(",
"dataScreen",
")",
")",
")",
"||",
"(",
"(",
"dataUpdated",
"==",
"null",
")",
"&&",
"(",
"dataScreen",
"==",
"dataUpdated",
")",
")",
")",
"if",
"(",
"!",
"field",
".",
"isJustModified",
"(",
")",
")",
"// Extra special case - Since a changed virtual field will always be modified, see if it actually changed;",
"iMoveMode",
"=",
"DBConstants",
".",
"READ_MOVE",
";",
"// Extra special case - If not, see if someone else modified it",
"}",
"this",
".",
"getField",
"(",
"iFieldSeq",
")",
".",
"handleFieldChanged",
"(",
"DBConstants",
".",
"DISPLAY",
",",
"iMoveMode",
")",
";",
"bAnyChanged",
"=",
"true",
";",
"}",
"}",
"}",
"return",
"bAnyChanged",
";",
"}"
] |
Compare the current state with the way the record was before and call any fieldchange listeners.
@param buffer
@param rgbModified
@return
|
[
"Compare",
"the",
"current",
"state",
"with",
"the",
"way",
"the",
"record",
"was",
"before",
"and",
"call",
"any",
"fieldchange",
"listeners",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3084-L3129
|
152,439
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.getCodeKeyArea
|
public int getCodeKeyArea()
{
int iTargetKeyArea = 0; // Key 0 cannot be the code key
for (int i = this.getKeyAreaCount() - 1; i >= 0 ; i--)
{
KeyArea keyArea = this.getKeyArea(i);
if (keyArea.getUniqueKeyCode() == DBConstants.SECONDARY_KEY)
iTargetKeyArea = i;
if (iTargetKeyArea == 0)
if (keyArea.getUniqueKeyCode() == DBConstants.NOT_UNIQUE)
if (keyArea.getField(0).getDataClass() == String.class)
iTargetKeyArea = i; // Best guess if no secondary
}
return iTargetKeyArea;
}
|
java
|
public int getCodeKeyArea()
{
int iTargetKeyArea = 0; // Key 0 cannot be the code key
for (int i = this.getKeyAreaCount() - 1; i >= 0 ; i--)
{
KeyArea keyArea = this.getKeyArea(i);
if (keyArea.getUniqueKeyCode() == DBConstants.SECONDARY_KEY)
iTargetKeyArea = i;
if (iTargetKeyArea == 0)
if (keyArea.getUniqueKeyCode() == DBConstants.NOT_UNIQUE)
if (keyArea.getField(0).getDataClass() == String.class)
iTargetKeyArea = i; // Best guess if no secondary
}
return iTargetKeyArea;
}
|
[
"public",
"int",
"getCodeKeyArea",
"(",
")",
"{",
"int",
"iTargetKeyArea",
"=",
"0",
";",
"// Key 0 cannot be the code key",
"for",
"(",
"int",
"i",
"=",
"this",
".",
"getKeyAreaCount",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"KeyArea",
"keyArea",
"=",
"this",
".",
"getKeyArea",
"(",
"i",
")",
";",
"if",
"(",
"keyArea",
".",
"getUniqueKeyCode",
"(",
")",
"==",
"DBConstants",
".",
"SECONDARY_KEY",
")",
"iTargetKeyArea",
"=",
"i",
";",
"if",
"(",
"iTargetKeyArea",
"==",
"0",
")",
"if",
"(",
"keyArea",
".",
"getUniqueKeyCode",
"(",
")",
"==",
"DBConstants",
".",
"NOT_UNIQUE",
")",
"if",
"(",
"keyArea",
".",
"getField",
"(",
"0",
")",
".",
"getDataClass",
"(",
")",
"==",
"String",
".",
"class",
")",
"iTargetKeyArea",
"=",
"i",
";",
"// Best guess if no secondary",
"}",
"return",
"iTargetKeyArea",
";",
"}"
] |
Get the code key area.
@return The code key area (or 0 if not found).
|
[
"Get",
"the",
"code",
"key",
"area",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3172-L3186
|
152,440
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.populateThinTable
|
public boolean populateThinTable(FieldList fieldList, boolean bApplyMappedFilter)
{
Record record = this;
if (bApplyMappedFilter)
record = this.applyMappedFilter();
if (record == null)
return false;
FieldTable table = fieldList.getTable();
boolean bAutoSequence = fieldList.isAutoSequence();
boolean[] rgListeners = null;
Object[] rgFieldListeners = null;
int iOldOpenMode = fieldList.getOpenMode();
fieldList.setOpenMode(DBConstants.OPEN_NORMAL);
try {
fieldList.setAutoSequence(false); // Disable autoseq temporarily
if (fieldList instanceof Record)
{
rgListeners = ((Record)fieldList).setEnableListeners(false);
rgFieldListeners = ((Record)fieldList).setEnableFieldListeners(false);
}
while (record.hasNext())
{
record.next();
table.addNew();
if (bApplyMappedFilter)
this.moveDataToThin(record, fieldList);
else
this.copyAllFields(record, fieldList);
table.add(fieldList);
}
} catch (DBException ex) {
ex.printStackTrace();
} finally {
fieldList.setAutoSequence(bAutoSequence);
if (rgListeners != null)
((Record)fieldList).setEnableListeners(rgListeners);
if (rgFieldListeners != null)
((Record)fieldList).setEnableFieldListeners(rgFieldListeners);
fieldList.setOpenMode(iOldOpenMode);
}
if (bApplyMappedFilter)
this.freeMappedRecord(record);
return true;
}
|
java
|
public boolean populateThinTable(FieldList fieldList, boolean bApplyMappedFilter)
{
Record record = this;
if (bApplyMappedFilter)
record = this.applyMappedFilter();
if (record == null)
return false;
FieldTable table = fieldList.getTable();
boolean bAutoSequence = fieldList.isAutoSequence();
boolean[] rgListeners = null;
Object[] rgFieldListeners = null;
int iOldOpenMode = fieldList.getOpenMode();
fieldList.setOpenMode(DBConstants.OPEN_NORMAL);
try {
fieldList.setAutoSequence(false); // Disable autoseq temporarily
if (fieldList instanceof Record)
{
rgListeners = ((Record)fieldList).setEnableListeners(false);
rgFieldListeners = ((Record)fieldList).setEnableFieldListeners(false);
}
while (record.hasNext())
{
record.next();
table.addNew();
if (bApplyMappedFilter)
this.moveDataToThin(record, fieldList);
else
this.copyAllFields(record, fieldList);
table.add(fieldList);
}
} catch (DBException ex) {
ex.printStackTrace();
} finally {
fieldList.setAutoSequence(bAutoSequence);
if (rgListeners != null)
((Record)fieldList).setEnableListeners(rgListeners);
if (rgFieldListeners != null)
((Record)fieldList).setEnableFieldListeners(rgFieldListeners);
fieldList.setOpenMode(iOldOpenMode);
}
if (bApplyMappedFilter)
this.freeMappedRecord(record);
return true;
}
|
[
"public",
"boolean",
"populateThinTable",
"(",
"FieldList",
"fieldList",
",",
"boolean",
"bApplyMappedFilter",
")",
"{",
"Record",
"record",
"=",
"this",
";",
"if",
"(",
"bApplyMappedFilter",
")",
"record",
"=",
"this",
".",
"applyMappedFilter",
"(",
")",
";",
"if",
"(",
"record",
"==",
"null",
")",
"return",
"false",
";",
"FieldTable",
"table",
"=",
"fieldList",
".",
"getTable",
"(",
")",
";",
"boolean",
"bAutoSequence",
"=",
"fieldList",
".",
"isAutoSequence",
"(",
")",
";",
"boolean",
"[",
"]",
"rgListeners",
"=",
"null",
";",
"Object",
"[",
"]",
"rgFieldListeners",
"=",
"null",
";",
"int",
"iOldOpenMode",
"=",
"fieldList",
".",
"getOpenMode",
"(",
")",
";",
"fieldList",
".",
"setOpenMode",
"(",
"DBConstants",
".",
"OPEN_NORMAL",
")",
";",
"try",
"{",
"fieldList",
".",
"setAutoSequence",
"(",
"false",
")",
";",
"// Disable autoseq temporarily",
"if",
"(",
"fieldList",
"instanceof",
"Record",
")",
"{",
"rgListeners",
"=",
"(",
"(",
"Record",
")",
"fieldList",
")",
".",
"setEnableListeners",
"(",
"false",
")",
";",
"rgFieldListeners",
"=",
"(",
"(",
"Record",
")",
"fieldList",
")",
".",
"setEnableFieldListeners",
"(",
"false",
")",
";",
"}",
"while",
"(",
"record",
".",
"hasNext",
"(",
")",
")",
"{",
"record",
".",
"next",
"(",
")",
";",
"table",
".",
"addNew",
"(",
")",
";",
"if",
"(",
"bApplyMappedFilter",
")",
"this",
".",
"moveDataToThin",
"(",
"record",
",",
"fieldList",
")",
";",
"else",
"this",
".",
"copyAllFields",
"(",
"record",
",",
"fieldList",
")",
";",
"table",
".",
"add",
"(",
"fieldList",
")",
";",
"}",
"}",
"catch",
"(",
"DBException",
"ex",
")",
"{",
"ex",
".",
"printStackTrace",
"(",
")",
";",
"}",
"finally",
"{",
"fieldList",
".",
"setAutoSequence",
"(",
"bAutoSequence",
")",
";",
"if",
"(",
"rgListeners",
"!=",
"null",
")",
"(",
"(",
"Record",
")",
"fieldList",
")",
".",
"setEnableListeners",
"(",
"rgListeners",
")",
";",
"if",
"(",
"rgFieldListeners",
"!=",
"null",
")",
"(",
"(",
"Record",
")",
"fieldList",
")",
".",
"setEnableFieldListeners",
"(",
"rgFieldListeners",
")",
";",
"fieldList",
".",
"setOpenMode",
"(",
"iOldOpenMode",
")",
";",
"}",
"if",
"(",
"bApplyMappedFilter",
")",
"this",
".",
"freeMappedRecord",
"(",
"record",
")",
";",
"return",
"true",
";",
"}"
] |
Utility to copy this entire table to this thin table.
@param fieldList
@return true If successful
|
[
"Utility",
"to",
"copy",
"this",
"entire",
"table",
"to",
"this",
"thin",
"table",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3208-L3253
|
152,441
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.copyAllFields
|
public final void copyAllFields(Record record, FieldList fieldList)
{
for (int i = 0; i < fieldList.getFieldCount(); i++)
{
FieldInfo fieldInfo = fieldList.getField(i);
BaseField field = record.getField(i);
this.moveFieldToThin(fieldInfo, field, record);
}
}
|
java
|
public final void copyAllFields(Record record, FieldList fieldList)
{
for (int i = 0; i < fieldList.getFieldCount(); i++)
{
FieldInfo fieldInfo = fieldList.getField(i);
BaseField field = record.getField(i);
this.moveFieldToThin(fieldInfo, field, record);
}
}
|
[
"public",
"final",
"void",
"copyAllFields",
"(",
"Record",
"record",
",",
"FieldList",
"fieldList",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fieldList",
".",
"getFieldCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"FieldInfo",
"fieldInfo",
"=",
"fieldList",
".",
"getField",
"(",
"i",
")",
";",
"BaseField",
"field",
"=",
"record",
".",
"getField",
"(",
"i",
")",
";",
"this",
".",
"moveFieldToThin",
"(",
"fieldInfo",
",",
"field",
",",
"record",
")",
";",
"}",
"}"
] |
Copy the data in this record to the thin version.
@param fieldList
|
[
"Copy",
"the",
"data",
"in",
"this",
"record",
"to",
"the",
"thin",
"version",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3275-L3283
|
152,442
|
jbundle/jbundle
|
base/base/src/main/java/org/jbundle/base/db/Record.java
|
Record.moveFieldToThin
|
public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record)
{
if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName())))
{
field = null;
if (record != null)
field = record.getField(fieldInfo.getFieldName());
}
if (field != null)
{
if (field.getDataClass() == fieldInfo.getDataClass())
fieldInfo.setData(field.getData());
else
fieldInfo.setString(field.toString());
}
}
|
java
|
public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record)
{
if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName())))
{
field = null;
if (record != null)
field = record.getField(fieldInfo.getFieldName());
}
if (field != null)
{
if (field.getDataClass() == fieldInfo.getDataClass())
fieldInfo.setData(field.getData());
else
fieldInfo.setString(field.toString());
}
}
|
[
"public",
"void",
"moveFieldToThin",
"(",
"FieldInfo",
"fieldInfo",
",",
"BaseField",
"field",
",",
"Record",
"record",
")",
"{",
"if",
"(",
"(",
"field",
"==",
"null",
")",
"||",
"(",
"!",
"field",
".",
"getFieldName",
"(",
")",
".",
"equals",
"(",
"fieldInfo",
".",
"getFieldName",
"(",
")",
")",
")",
")",
"{",
"field",
"=",
"null",
";",
"if",
"(",
"record",
"!=",
"null",
")",
"field",
"=",
"record",
".",
"getField",
"(",
"fieldInfo",
".",
"getFieldName",
"(",
")",
")",
";",
"}",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"if",
"(",
"field",
".",
"getDataClass",
"(",
")",
"==",
"fieldInfo",
".",
"getDataClass",
"(",
")",
")",
"fieldInfo",
".",
"setData",
"(",
"field",
".",
"getData",
"(",
")",
")",
";",
"else",
"fieldInfo",
".",
"setString",
"(",
"field",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] |
Move the data in this record to the thin version.
@param fieldInfo The destination thin field.
@param field The source field (or null to auto-find)
@param record The source record (or null if field supplied)
|
[
"Move",
"the",
"data",
"in",
"this",
"record",
"to",
"the",
"thin",
"version",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3290-L3305
|
152,443
|
js-lib-com/commons
|
src/main/java/js/io/WildcardFilter.java
|
WildcardFilter.tokenize
|
private static String[] tokenize(String string) {
if (string.indexOf("?") == -1 && string.indexOf("*") == -1) {
return new String[] { string };
}
char[] textArray = string.toCharArray();
List<String> tokens = new ArrayList<String>();
StringBuilder tokenBuilder = new StringBuilder();
for (int i = 0; i < textArray.length; i++) {
if (textArray[i] != '?' && textArray[i] != '*') {
// collect non wild card characters
tokenBuilder.append(textArray[i]);
continue;
}
if (tokenBuilder.length() != 0) {
tokens.add(tokenBuilder.toString());
tokenBuilder.setLength(0);
}
if (textArray[i] == '?') {
tokens.add("?");
} else if (tokens.size() == 0 || (i > 0 && tokens.get(tokens.size() - 1).equals("*") == false)) {
tokens.add("*");
}
}
if (tokenBuilder.length() != 0) {
tokens.add(tokenBuilder.toString());
}
return (String[]) tokens.toArray(new String[tokens.size()]);
}
|
java
|
private static String[] tokenize(String string) {
if (string.indexOf("?") == -1 && string.indexOf("*") == -1) {
return new String[] { string };
}
char[] textArray = string.toCharArray();
List<String> tokens = new ArrayList<String>();
StringBuilder tokenBuilder = new StringBuilder();
for (int i = 0; i < textArray.length; i++) {
if (textArray[i] != '?' && textArray[i] != '*') {
// collect non wild card characters
tokenBuilder.append(textArray[i]);
continue;
}
if (tokenBuilder.length() != 0) {
tokens.add(tokenBuilder.toString());
tokenBuilder.setLength(0);
}
if (textArray[i] == '?') {
tokens.add("?");
} else if (tokens.size() == 0 || (i > 0 && tokens.get(tokens.size() - 1).equals("*") == false)) {
tokens.add("*");
}
}
if (tokenBuilder.length() != 0) {
tokens.add(tokenBuilder.toString());
}
return (String[]) tokens.toArray(new String[tokens.size()]);
}
|
[
"private",
"static",
"String",
"[",
"]",
"tokenize",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
".",
"indexOf",
"(",
"\"?\"",
")",
"==",
"-",
"1",
"&&",
"string",
".",
"indexOf",
"(",
"\"*\"",
")",
"==",
"-",
"1",
")",
"{",
"return",
"new",
"String",
"[",
"]",
"{",
"string",
"}",
";",
"}",
"char",
"[",
"]",
"textArray",
"=",
"string",
".",
"toCharArray",
"(",
")",
";",
"List",
"<",
"String",
">",
"tokens",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"StringBuilder",
"tokenBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"textArray",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"textArray",
"[",
"i",
"]",
"!=",
"'",
"'",
"&&",
"textArray",
"[",
"i",
"]",
"!=",
"'",
"'",
")",
"{",
"// collect non wild card characters\r",
"tokenBuilder",
".",
"append",
"(",
"textArray",
"[",
"i",
"]",
")",
";",
"continue",
";",
"}",
"if",
"(",
"tokenBuilder",
".",
"length",
"(",
")",
"!=",
"0",
")",
"{",
"tokens",
".",
"add",
"(",
"tokenBuilder",
".",
"toString",
"(",
")",
")",
";",
"tokenBuilder",
".",
"setLength",
"(",
"0",
")",
";",
"}",
"if",
"(",
"textArray",
"[",
"i",
"]",
"==",
"'",
"'",
")",
"{",
"tokens",
".",
"add",
"(",
"\"?\"",
")",
";",
"}",
"else",
"if",
"(",
"tokens",
".",
"size",
"(",
")",
"==",
"0",
"||",
"(",
"i",
">",
"0",
"&&",
"tokens",
".",
"get",
"(",
"tokens",
".",
"size",
"(",
")",
"-",
"1",
")",
".",
"equals",
"(",
"\"*\"",
")",
"==",
"false",
")",
")",
"{",
"tokens",
".",
"add",
"(",
"\"*\"",
")",
";",
"}",
"}",
"if",
"(",
"tokenBuilder",
".",
"length",
"(",
")",
"!=",
"0",
")",
"{",
"tokens",
".",
"add",
"(",
"tokenBuilder",
".",
"toString",
"(",
")",
")",
";",
"}",
"return",
"(",
"String",
"[",
"]",
")",
"tokens",
".",
"toArray",
"(",
"new",
"String",
"[",
"tokens",
".",
"size",
"(",
")",
"]",
")",
";",
"}"
] |
Splits a string into a number of tokens.
@param string string to split.
@return tokens list.
|
[
"Splits",
"a",
"string",
"into",
"a",
"number",
"of",
"tokens",
"."
] |
f8c64482142b163487745da74feb106f0765c16b
|
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/io/WildcardFilter.java#L181-L213
|
152,444
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setProduct
|
public void setProduct(final String product) {
if (product == null && this.product == null) {
return;
} else if (product == null) {
removeChild(this.product);
this.product = null;
} else if (this.product == null) {
this.product = new KeyValueNode<String>(CommonConstants.CS_PRODUCT_TITLE, product);
appendChild(this.product, false);
} else {
this.product.setValue(product);
}
}
|
java
|
public void setProduct(final String product) {
if (product == null && this.product == null) {
return;
} else if (product == null) {
removeChild(this.product);
this.product = null;
} else if (this.product == null) {
this.product = new KeyValueNode<String>(CommonConstants.CS_PRODUCT_TITLE, product);
appendChild(this.product, false);
} else {
this.product.setValue(product);
}
}
|
[
"public",
"void",
"setProduct",
"(",
"final",
"String",
"product",
")",
"{",
"if",
"(",
"product",
"==",
"null",
"&&",
"this",
".",
"product",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"product",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"product",
")",
";",
"this",
".",
"product",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"product",
"==",
"null",
")",
"{",
"this",
".",
"product",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_PRODUCT_TITLE",
",",
"product",
")",
";",
"appendChild",
"(",
"this",
".",
"product",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"product",
".",
"setValue",
"(",
"product",
")",
";",
"}",
"}"
] |
Sets the name of the product that the Content Specification documents.
@param product The name of the Product.
|
[
"Sets",
"the",
"name",
"of",
"the",
"product",
"that",
"the",
"Content",
"Specification",
"documents",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L180-L192
|
152,445
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setVersion
|
public void setVersion(final String version) {
if (version == null && this.version == null) {
return;
} else if (version == null) {
removeChild(this.version);
this.version = null;
} else if (this.version == null) {
this.version = new KeyValueNode<String>(CommonConstants.CS_VERSION_TITLE, version);
appendChild(this.version, false);
} else {
this.version.setValue(version);
}
}
|
java
|
public void setVersion(final String version) {
if (version == null && this.version == null) {
return;
} else if (version == null) {
removeChild(this.version);
this.version = null;
} else if (this.version == null) {
this.version = new KeyValueNode<String>(CommonConstants.CS_VERSION_TITLE, version);
appendChild(this.version, false);
} else {
this.version.setValue(version);
}
}
|
[
"public",
"void",
"setVersion",
"(",
"final",
"String",
"version",
")",
"{",
"if",
"(",
"version",
"==",
"null",
"&&",
"this",
".",
"version",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"version",
")",
";",
"this",
".",
"version",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"version",
"==",
"null",
")",
"{",
"this",
".",
"version",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_VERSION_TITLE",
",",
"version",
")",
";",
"appendChild",
"(",
"this",
".",
"version",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"version",
".",
"setValue",
"(",
"version",
")",
";",
"}",
"}"
] |
Set the version of the product that the Content Specification documents.
@param version The product version.
|
[
"Set",
"the",
"version",
"of",
"the",
"product",
"that",
"the",
"Content",
"Specification",
"documents",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L217-L229
|
152,446
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBrand
|
public void setBrand(final String brand) {
if (brand == null && this.brand == null) {
return;
} else if (brand == null) {
removeChild(this.brand);
this.brand = null;
} else if (this.brand == null) {
this.brand = new KeyValueNode<String>(CommonConstants.CS_BRAND_TITLE, brand);
appendChild(this.brand, false);
} else {
this.brand.setValue(brand);
}
}
|
java
|
public void setBrand(final String brand) {
if (brand == null && this.brand == null) {
return;
} else if (brand == null) {
removeChild(this.brand);
this.brand = null;
} else if (this.brand == null) {
this.brand = new KeyValueNode<String>(CommonConstants.CS_BRAND_TITLE, brand);
appendChild(this.brand, false);
} else {
this.brand.setValue(brand);
}
}
|
[
"public",
"void",
"setBrand",
"(",
"final",
"String",
"brand",
")",
"{",
"if",
"(",
"brand",
"==",
"null",
"&&",
"this",
".",
"brand",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"brand",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"brand",
")",
";",
"this",
".",
"brand",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"brand",
"==",
"null",
")",
"{",
"this",
".",
"brand",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_BRAND_TITLE",
",",
"brand",
")",
";",
"appendChild",
"(",
"this",
".",
"brand",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"brand",
".",
"setValue",
"(",
"brand",
")",
";",
"}",
"}"
] |
Set the brand of the product that the Content Specification documents.
@param brand The brand of the product.
|
[
"Set",
"the",
"brand",
"of",
"the",
"product",
"that",
"the",
"Content",
"Specification",
"documents",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L254-L266
|
152,447
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setId
|
public void setId(final Integer id) {
if (id == null && this.id == null) {
return;
} else if (id == null) {
removeChild(this.id);
this.id = null;
} else if (this.id == null) {
this.id = new KeyValueNode<Integer>(CommonConstants.CS_ID_TITLE, id);
nodes.addFirst(this.id);
if (this.id.getParent() != null) {
this.id.removeParent();
}
this.id.setParent(this);
} else {
this.id.setValue(id);
}
}
|
java
|
public void setId(final Integer id) {
if (id == null && this.id == null) {
return;
} else if (id == null) {
removeChild(this.id);
this.id = null;
} else if (this.id == null) {
this.id = new KeyValueNode<Integer>(CommonConstants.CS_ID_TITLE, id);
nodes.addFirst(this.id);
if (this.id.getParent() != null) {
this.id.removeParent();
}
this.id.setParent(this);
} else {
this.id.setValue(id);
}
}
|
[
"public",
"void",
"setId",
"(",
"final",
"Integer",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
"&&",
"this",
".",
"id",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"id",
")",
";",
"this",
".",
"id",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"id",
"==",
"null",
")",
"{",
"this",
".",
"id",
"=",
"new",
"KeyValueNode",
"<",
"Integer",
">",
"(",
"CommonConstants",
".",
"CS_ID_TITLE",
",",
"id",
")",
";",
"nodes",
".",
"addFirst",
"(",
"this",
".",
"id",
")",
";",
"if",
"(",
"this",
".",
"id",
".",
"getParent",
"(",
")",
"!=",
"null",
")",
"{",
"this",
".",
"id",
".",
"removeParent",
"(",
")",
";",
"}",
"this",
".",
"id",
".",
"setParent",
"(",
"this",
")",
";",
"}",
"else",
"{",
"this",
".",
"id",
".",
"setValue",
"(",
"id",
")",
";",
"}",
"}"
] |
Sets the ID of the Content Specification.
@param id The database ID of the content specification.
|
[
"Sets",
"the",
"ID",
"of",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L273-L289
|
152,448
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setTitle
|
public void setTitle(final String title) {
if (title == null && this.title == null) {
return;
} else if (title == null) {
removeChild(this.title);
this.title = null;
} else if (this.title == null) {
this.title = new KeyValueNode<String>(CommonConstants.CS_TITLE_TITLE, title);
appendChild(this.title, false);
} else {
this.title.setValue(title);
}
}
|
java
|
public void setTitle(final String title) {
if (title == null && this.title == null) {
return;
} else if (title == null) {
removeChild(this.title);
this.title = null;
} else if (this.title == null) {
this.title = new KeyValueNode<String>(CommonConstants.CS_TITLE_TITLE, title);
appendChild(this.title, false);
} else {
this.title.setValue(title);
}
}
|
[
"public",
"void",
"setTitle",
"(",
"final",
"String",
"title",
")",
"{",
"if",
"(",
"title",
"==",
"null",
"&&",
"this",
".",
"title",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"title",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"title",
")",
";",
"this",
".",
"title",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"title",
"==",
"null",
")",
"{",
"this",
".",
"title",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_TITLE_TITLE",
",",
"title",
")",
";",
"appendChild",
"(",
"this",
".",
"title",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"title",
".",
"setValue",
"(",
"title",
")",
";",
"}",
"}"
] |
Sets the Content Specifications title.
@param title The title for the content specification
|
[
"Sets",
"the",
"Content",
"Specifications",
"title",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L352-L364
|
152,449
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setSubtitle
|
public void setSubtitle(final String subtitle) {
if (subtitle == null && this.subtitle == null) {
return;
} else if (subtitle == null) {
removeChild(this.subtitle);
this.subtitle = null;
} else if (this.subtitle == null) {
this.subtitle = new KeyValueNode<String>(CommonConstants.CS_SUBTITLE_TITLE, subtitle);
appendChild(this.subtitle, false);
} else {
this.subtitle.setValue(subtitle);
}
}
|
java
|
public void setSubtitle(final String subtitle) {
if (subtitle == null && this.subtitle == null) {
return;
} else if (subtitle == null) {
removeChild(this.subtitle);
this.subtitle = null;
} else if (this.subtitle == null) {
this.subtitle = new KeyValueNode<String>(CommonConstants.CS_SUBTITLE_TITLE, subtitle);
appendChild(this.subtitle, false);
} else {
this.subtitle.setValue(subtitle);
}
}
|
[
"public",
"void",
"setSubtitle",
"(",
"final",
"String",
"subtitle",
")",
"{",
"if",
"(",
"subtitle",
"==",
"null",
"&&",
"this",
".",
"subtitle",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"subtitle",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"subtitle",
")",
";",
"this",
".",
"subtitle",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"subtitle",
"==",
"null",
")",
"{",
"this",
".",
"subtitle",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_SUBTITLE_TITLE",
",",
"subtitle",
")",
";",
"appendChild",
"(",
"this",
".",
"subtitle",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"subtitle",
".",
"setValue",
"(",
"subtitle",
")",
";",
"}",
"}"
] |
Sets the Subtitle for the Content Specification
@param subtitle The subtitle for the Content Specification
|
[
"Sets",
"the",
"Subtitle",
"for",
"the",
"Content",
"Specification"
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L389-L401
|
152,450
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBookVersion
|
public void setBookVersion(final String bookVersion) {
if (bookVersion == null && this.bookVersion == null) {
return;
} else if (bookVersion == null) {
removeChild(this.bookVersion);
this.bookVersion = null;
} else if (this.bookVersion == null) {
this.bookVersion = new KeyValueNode<String>(CommonConstants.CS_BOOK_VERSION_TITLE, bookVersion);
appendChild(this.bookVersion, false);
} else {
this.bookVersion.setValue(bookVersion);
}
}
|
java
|
public void setBookVersion(final String bookVersion) {
if (bookVersion == null && this.bookVersion == null) {
return;
} else if (bookVersion == null) {
removeChild(this.bookVersion);
this.bookVersion = null;
} else if (this.bookVersion == null) {
this.bookVersion = new KeyValueNode<String>(CommonConstants.CS_BOOK_VERSION_TITLE, bookVersion);
appendChild(this.bookVersion, false);
} else {
this.bookVersion.setValue(bookVersion);
}
}
|
[
"public",
"void",
"setBookVersion",
"(",
"final",
"String",
"bookVersion",
")",
"{",
"if",
"(",
"bookVersion",
"==",
"null",
"&&",
"this",
".",
"bookVersion",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"bookVersion",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"bookVersion",
")",
";",
"this",
".",
"bookVersion",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"bookVersion",
"==",
"null",
")",
"{",
"this",
".",
"bookVersion",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_BOOK_VERSION_TITLE",
",",
"bookVersion",
")",
";",
"appendChild",
"(",
"this",
".",
"bookVersion",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"bookVersion",
".",
"setValue",
"(",
"bookVersion",
")",
";",
"}",
"}"
] |
Set the BookVersion of the Book the Content Specification represents.
@param bookVersion The Book Version.
|
[
"Set",
"the",
"BookVersion",
"of",
"the",
"Book",
"the",
"Content",
"Specification",
"represents",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L426-L438
|
152,451
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setEdition
|
public void setEdition(final String edition) {
if (edition == null && this.edition == null) {
return;
} else if (edition == null) {
removeChild(this.edition);
this.edition = null;
} else if (this.edition == null) {
this.edition = new KeyValueNode<String>(CommonConstants.CS_EDITION_TITLE, edition);
appendChild(this.edition, false);
} else {
this.edition.setValue(edition);
}
}
|
java
|
public void setEdition(final String edition) {
if (edition == null && this.edition == null) {
return;
} else if (edition == null) {
removeChild(this.edition);
this.edition = null;
} else if (this.edition == null) {
this.edition = new KeyValueNode<String>(CommonConstants.CS_EDITION_TITLE, edition);
appendChild(this.edition, false);
} else {
this.edition.setValue(edition);
}
}
|
[
"public",
"void",
"setEdition",
"(",
"final",
"String",
"edition",
")",
"{",
"if",
"(",
"edition",
"==",
"null",
"&&",
"this",
".",
"edition",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"edition",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"edition",
")",
";",
"this",
".",
"edition",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"edition",
"==",
"null",
")",
"{",
"this",
".",
"edition",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_EDITION_TITLE",
",",
"edition",
")",
";",
"appendChild",
"(",
"this",
".",
"edition",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"edition",
".",
"setValue",
"(",
"edition",
")",
";",
"}",
"}"
] |
Set the Edition of the Book the Content Specification represents.
@param edition The Book Edition.
|
[
"Set",
"the",
"Edition",
"of",
"the",
"Book",
"the",
"Content",
"Specification",
"represents",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L463-L475
|
152,452
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setPubsNumber
|
public void setPubsNumber(final Integer pubsNumber) {
if (pubsNumber == null && this.pubsNumber == null) {
return;
} else if (pubsNumber == null) {
removeChild(this.pubsNumber);
this.pubsNumber = null;
} else if (this.pubsNumber == null) {
this.pubsNumber = new KeyValueNode<Integer>(CommonConstants.CS_PUBSNUMBER_TITLE, pubsNumber);
appendChild(this.pubsNumber, false);
} else {
this.pubsNumber.setValue(pubsNumber);
}
}
|
java
|
public void setPubsNumber(final Integer pubsNumber) {
if (pubsNumber == null && this.pubsNumber == null) {
return;
} else if (pubsNumber == null) {
removeChild(this.pubsNumber);
this.pubsNumber = null;
} else if (this.pubsNumber == null) {
this.pubsNumber = new KeyValueNode<Integer>(CommonConstants.CS_PUBSNUMBER_TITLE, pubsNumber);
appendChild(this.pubsNumber, false);
} else {
this.pubsNumber.setValue(pubsNumber);
}
}
|
[
"public",
"void",
"setPubsNumber",
"(",
"final",
"Integer",
"pubsNumber",
")",
"{",
"if",
"(",
"pubsNumber",
"==",
"null",
"&&",
"this",
".",
"pubsNumber",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"pubsNumber",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"pubsNumber",
")",
";",
"this",
".",
"pubsNumber",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"pubsNumber",
"==",
"null",
")",
"{",
"this",
".",
"pubsNumber",
"=",
"new",
"KeyValueNode",
"<",
"Integer",
">",
"(",
"CommonConstants",
".",
"CS_PUBSNUMBER_TITLE",
",",
"pubsNumber",
")",
";",
"appendChild",
"(",
"this",
".",
"pubsNumber",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"pubsNumber",
".",
"setValue",
"(",
"pubsNumber",
")",
";",
"}",
"}"
] |
Set the publication number for the Content Specification.
@param pubsNumber The publication number.
|
[
"Set",
"the",
"publication",
"number",
"for",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L500-L512
|
152,453
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.getPublicanCfg
|
public String getPublicanCfg() {
return !publicanCfgs.containsKey(DEFAULT_PUBLICAN_CFG_KEY) ? null : publicanCfgs.get(DEFAULT_PUBLICAN_CFG_KEY).getValueText();
}
|
java
|
public String getPublicanCfg() {
return !publicanCfgs.containsKey(DEFAULT_PUBLICAN_CFG_KEY) ? null : publicanCfgs.get(DEFAULT_PUBLICAN_CFG_KEY).getValueText();
}
|
[
"public",
"String",
"getPublicanCfg",
"(",
")",
"{",
"return",
"!",
"publicanCfgs",
".",
"containsKey",
"(",
"DEFAULT_PUBLICAN_CFG_KEY",
")",
"?",
"null",
":",
"publicanCfgs",
".",
"get",
"(",
"DEFAULT_PUBLICAN_CFG_KEY",
")",
".",
"getValueText",
"(",
")",
";",
"}"
] |
Gets the data what will be appended to the publican.cfg file when built.
@return The data to be appended or null if none exist.
|
[
"Gets",
"the",
"data",
"what",
"will",
"be",
"appended",
"to",
"the",
"publican",
".",
"cfg",
"file",
"when",
"built",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L519-L521
|
152,454
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.getAdditionalPublicanCfg
|
public String getAdditionalPublicanCfg(final String name) {
return !publicanCfgs.containsKey(name) ? null : publicanCfgs.get(name).getValueText();
}
|
java
|
public String getAdditionalPublicanCfg(final String name) {
return !publicanCfgs.containsKey(name) ? null : publicanCfgs.get(name).getValueText();
}
|
[
"public",
"String",
"getAdditionalPublicanCfg",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"!",
"publicanCfgs",
".",
"containsKey",
"(",
"name",
")",
"?",
"null",
":",
"publicanCfgs",
".",
"get",
"(",
"name",
")",
".",
"getValueText",
"(",
")",
";",
"}"
] |
Gets the data what will be appended to the custom additional publican.cfg file when built.
@param name The custom configuration name.
@return The data to be appended or null if none exist.
|
[
"Gets",
"the",
"data",
"what",
"will",
"be",
"appended",
"to",
"the",
"custom",
"additional",
"publican",
".",
"cfg",
"file",
"when",
"built",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L558-L560
|
152,455
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.getAdditionalPublicanCfgNode
|
public KeyValueNode<String> getAdditionalPublicanCfgNode(final String name) {
return !publicanCfgs.containsKey(name) ? null : publicanCfgs.get(name);
}
|
java
|
public KeyValueNode<String> getAdditionalPublicanCfgNode(final String name) {
return !publicanCfgs.containsKey(name) ? null : publicanCfgs.get(name);
}
|
[
"public",
"KeyValueNode",
"<",
"String",
">",
"getAdditionalPublicanCfgNode",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"!",
"publicanCfgs",
".",
"containsKey",
"(",
"name",
")",
"?",
"null",
":",
"publicanCfgs",
".",
"get",
"(",
"name",
")",
";",
"}"
] |
Gets the custom additional publican.cfg node for the specified name.
@param name The custom configuration name.
@return The additional publican.cfg node, or null if it doesn't exist.
|
[
"Gets",
"the",
"custom",
"additional",
"publican",
".",
"cfg",
"node",
"for",
"the",
"specified",
"name",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L568-L570
|
152,456
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.getAllAdditionalPublicanCfgs
|
public Map<String, String> getAllAdditionalPublicanCfgs() {
final Map<String, String> retValue = new HashMap<String, String>();
for (final Map.Entry<String, KeyValueNode<String>> entry : publicanCfgs.entrySet()) {
if (!DEFAULT_PUBLICAN_CFG_KEY.equals(entry.getKey())) {
retValue.put(entry.getValue().getKey(), entry.getValue().getValueText());
}
}
return retValue;
}
|
java
|
public Map<String, String> getAllAdditionalPublicanCfgs() {
final Map<String, String> retValue = new HashMap<String, String>();
for (final Map.Entry<String, KeyValueNode<String>> entry : publicanCfgs.entrySet()) {
if (!DEFAULT_PUBLICAN_CFG_KEY.equals(entry.getKey())) {
retValue.put(entry.getValue().getKey(), entry.getValue().getValueText());
}
}
return retValue;
}
|
[
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getAllAdditionalPublicanCfgs",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"retValue",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"KeyValueNode",
"<",
"String",
">",
">",
"entry",
":",
"publicanCfgs",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"!",
"DEFAULT_PUBLICAN_CFG_KEY",
".",
"equals",
"(",
"entry",
".",
"getKey",
"(",
")",
")",
")",
"{",
"retValue",
".",
"put",
"(",
"entry",
".",
"getValue",
"(",
")",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
".",
"getValueText",
"(",
")",
")",
";",
"}",
"}",
"return",
"retValue",
";",
"}"
] |
Gets all of the additional custom publican.cfg files in the
@return A mapping of file names to publican.cfg content.
|
[
"Gets",
"all",
"of",
"the",
"additional",
"custom",
"publican",
".",
"cfg",
"files",
"in",
"the"
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L577-L587
|
152,457
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setDefaultPublicanCfg
|
public void setDefaultPublicanCfg(final String defaultPublicanCfg) {
if (defaultPublicanCfg == null && this.defaultPublicanCfg == null) {
return;
} else if (defaultPublicanCfg == null) {
removeChild(this.defaultPublicanCfg);
this.defaultPublicanCfg = null;
} else if (this.defaultPublicanCfg == null) {
this.defaultPublicanCfg = new KeyValueNode<String>(CommonConstants.CS_DEFAULT_PUBLICAN_CFG_TITLE, defaultPublicanCfg);
appendChild(this.defaultPublicanCfg, false);
} else {
this.defaultPublicanCfg.setValue(defaultPublicanCfg);
}
}
|
java
|
public void setDefaultPublicanCfg(final String defaultPublicanCfg) {
if (defaultPublicanCfg == null && this.defaultPublicanCfg == null) {
return;
} else if (defaultPublicanCfg == null) {
removeChild(this.defaultPublicanCfg);
this.defaultPublicanCfg = null;
} else if (this.defaultPublicanCfg == null) {
this.defaultPublicanCfg = new KeyValueNode<String>(CommonConstants.CS_DEFAULT_PUBLICAN_CFG_TITLE, defaultPublicanCfg);
appendChild(this.defaultPublicanCfg, false);
} else {
this.defaultPublicanCfg.setValue(defaultPublicanCfg);
}
}
|
[
"public",
"void",
"setDefaultPublicanCfg",
"(",
"final",
"String",
"defaultPublicanCfg",
")",
"{",
"if",
"(",
"defaultPublicanCfg",
"==",
"null",
"&&",
"this",
".",
"defaultPublicanCfg",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"defaultPublicanCfg",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"defaultPublicanCfg",
")",
";",
"this",
".",
"defaultPublicanCfg",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"defaultPublicanCfg",
"==",
"null",
")",
"{",
"this",
".",
"defaultPublicanCfg",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_DEFAULT_PUBLICAN_CFG_TITLE",
",",
"defaultPublicanCfg",
")",
";",
"appendChild",
"(",
"this",
".",
"defaultPublicanCfg",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"defaultPublicanCfg",
".",
"setValue",
"(",
"defaultPublicanCfg",
")",
";",
"}",
"}"
] |
Set the default publican.cfg configuration that should be used when building.
@param defaultPublicanCfg The name of the default publican.cfg to use when building.
|
[
"Set",
"the",
"default",
"publican",
".",
"cfg",
"configuration",
"that",
"should",
"be",
"used",
"when",
"building",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L634-L646
|
152,458
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setFormat
|
public void setFormat(final String format) {
if (format == null && this.format == null) {
return;
} else if (format == null) {
removeChild(this.format);
this.format = null;
} else if (this.format == null) {
this.format = new KeyValueNode<String>(CommonConstants.CS_FORMAT_TITLE, format);
appendChild(this.format, false);
} else {
this.format.setValue(format);
}
}
|
java
|
public void setFormat(final String format) {
if (format == null && this.format == null) {
return;
} else if (format == null) {
removeChild(this.format);
this.format = null;
} else if (this.format == null) {
this.format = new KeyValueNode<String>(CommonConstants.CS_FORMAT_TITLE, format);
appendChild(this.format, false);
} else {
this.format.setValue(format);
}
}
|
[
"public",
"void",
"setFormat",
"(",
"final",
"String",
"format",
")",
"{",
"if",
"(",
"format",
"==",
"null",
"&&",
"this",
".",
"format",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"format",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"format",
")",
";",
"this",
".",
"format",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"format",
"==",
"null",
")",
"{",
"this",
".",
"format",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_FORMAT_TITLE",
",",
"format",
")",
";",
"appendChild",
"(",
"this",
".",
"format",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"format",
".",
"setValue",
"(",
"format",
")",
";",
"}",
"}"
] |
Sets the DTD for a Content Specification.
@param format The DTD of the Content Specification.
|
[
"Sets",
"the",
"DTD",
"for",
"a",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L671-L683
|
152,459
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setCopyrightHolder
|
public void setCopyrightHolder(final String copyrightHolder) {
if (copyrightHolder == null && this.copyrightHolder == null) {
return;
} else if (copyrightHolder == null) {
removeChild(this.copyrightHolder);
this.copyrightHolder = null;
} else if (this.copyrightHolder == null) {
this.copyrightHolder = new KeyValueNode<String>(CommonConstants.CS_COPYRIGHT_HOLDER_TITLE, copyrightHolder);
appendChild(this.copyrightHolder, false);
} else {
this.copyrightHolder.setValue(copyrightHolder);
}
}
|
java
|
public void setCopyrightHolder(final String copyrightHolder) {
if (copyrightHolder == null && this.copyrightHolder == null) {
return;
} else if (copyrightHolder == null) {
removeChild(this.copyrightHolder);
this.copyrightHolder = null;
} else if (this.copyrightHolder == null) {
this.copyrightHolder = new KeyValueNode<String>(CommonConstants.CS_COPYRIGHT_HOLDER_TITLE, copyrightHolder);
appendChild(this.copyrightHolder, false);
} else {
this.copyrightHolder.setValue(copyrightHolder);
}
}
|
[
"public",
"void",
"setCopyrightHolder",
"(",
"final",
"String",
"copyrightHolder",
")",
"{",
"if",
"(",
"copyrightHolder",
"==",
"null",
"&&",
"this",
".",
"copyrightHolder",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"copyrightHolder",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"copyrightHolder",
")",
";",
"this",
".",
"copyrightHolder",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"copyrightHolder",
"==",
"null",
")",
"{",
"this",
".",
"copyrightHolder",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_COPYRIGHT_HOLDER_TITLE",
",",
"copyrightHolder",
")",
";",
"appendChild",
"(",
"this",
".",
"copyrightHolder",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"copyrightHolder",
".",
"setValue",
"(",
"copyrightHolder",
")",
";",
"}",
"}"
] |
Set the Copyright Holder of the Content Specification and the book it creates.
@param copyrightHolder The name of the Copyright Holder.
|
[
"Set",
"the",
"Copyright",
"Holder",
"of",
"the",
"Content",
"Specification",
"and",
"the",
"book",
"it",
"creates",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L807-L819
|
152,460
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBookType
|
public void setBookType(final BookType bookType) {
if (bookType == null && this.bookType == null) {
return;
} else if (bookType == null) {
removeChild(this.bookType);
this.bookType = null;
} else if (this.bookType == null) {
this.bookType = new KeyValueNode<BookType>(CommonConstants.CS_BOOK_TYPE_TITLE, bookType);
appendChild(this.bookType, false);
} else {
this.bookType.setValue(bookType);
}
}
|
java
|
public void setBookType(final BookType bookType) {
if (bookType == null && this.bookType == null) {
return;
} else if (bookType == null) {
removeChild(this.bookType);
this.bookType = null;
} else if (this.bookType == null) {
this.bookType = new KeyValueNode<BookType>(CommonConstants.CS_BOOK_TYPE_TITLE, bookType);
appendChild(this.bookType, false);
} else {
this.bookType.setValue(bookType);
}
}
|
[
"public",
"void",
"setBookType",
"(",
"final",
"BookType",
"bookType",
")",
"{",
"if",
"(",
"bookType",
"==",
"null",
"&&",
"this",
".",
"bookType",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"bookType",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"bookType",
")",
";",
"this",
".",
"bookType",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"bookType",
"==",
"null",
")",
"{",
"this",
".",
"bookType",
"=",
"new",
"KeyValueNode",
"<",
"BookType",
">",
"(",
"CommonConstants",
".",
"CS_BOOK_TYPE_TITLE",
",",
"bookType",
")",
";",
"appendChild",
"(",
"this",
".",
"bookType",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"bookType",
".",
"setValue",
"(",
"bookType",
")",
";",
"}",
"}"
] |
Set the Type of Book the Content Specification should be created for. The current values that are supported are "Book"
and "Article".
@param bookType The type the book should be built as.
|
[
"Set",
"the",
"Type",
"of",
"Book",
"the",
"Content",
"Specification",
"should",
"be",
"created",
"for",
".",
"The",
"current",
"values",
"that",
"are",
"supported",
"are",
"Book",
"and",
"Article",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L874-L886
|
152,461
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBrandLogo
|
public void setBrandLogo(final String brandLogo) {
if (brandLogo == null && this.brandLogo == null) {
return;
} else if (brandLogo == null) {
removeChild(this.brandLogo);
this.brandLogo = null;
} else if (this.brandLogo == null) {
this.brandLogo = new KeyValueNode<String>(CommonConstants.CS_BRAND_LOGO_TITLE, brandLogo);
appendChild(this.brandLogo, false);
} else {
this.brandLogo.setValue(brandLogo);
}
}
|
java
|
public void setBrandLogo(final String brandLogo) {
if (brandLogo == null && this.brandLogo == null) {
return;
} else if (brandLogo == null) {
removeChild(this.brandLogo);
this.brandLogo = null;
} else if (this.brandLogo == null) {
this.brandLogo = new KeyValueNode<String>(CommonConstants.CS_BRAND_LOGO_TITLE, brandLogo);
appendChild(this.brandLogo, false);
} else {
this.brandLogo.setValue(brandLogo);
}
}
|
[
"public",
"void",
"setBrandLogo",
"(",
"final",
"String",
"brandLogo",
")",
"{",
"if",
"(",
"brandLogo",
"==",
"null",
"&&",
"this",
".",
"brandLogo",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"brandLogo",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"brandLogo",
")",
";",
"this",
".",
"brandLogo",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"brandLogo",
"==",
"null",
")",
"{",
"this",
".",
"brandLogo",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_BRAND_LOGO_TITLE",
",",
"brandLogo",
")",
";",
"appendChild",
"(",
"this",
".",
"brandLogo",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"brandLogo",
".",
"setValue",
"(",
"brandLogo",
")",
";",
"}",
"}"
] |
Sets the path of the Brand Logo for the Content Specification.
@param brandLogo The path to the Brand Logo.
|
[
"Sets",
"the",
"path",
"of",
"the",
"Brand",
"Logo",
"for",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L911-L923
|
152,462
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setInjectionOptions
|
public void setInjectionOptions(final InjectionOptions injectionOptions) {
if (injectionOptions == null && this.injectionOptions == null) {
return;
} else if (injectionOptions == null) {
removeChild(this.injectionOptions);
this.injectionOptions = null;
} else if (this.injectionOptions == null) {
this.injectionOptions = new KeyValueNode<InjectionOptions>(CommonConstants.CS_INLINE_INJECTION_TITLE, injectionOptions);
appendChild(this.injectionOptions, false);
} else {
this.injectionOptions.setValue(injectionOptions);
}
}
|
java
|
public void setInjectionOptions(final InjectionOptions injectionOptions) {
if (injectionOptions == null && this.injectionOptions == null) {
return;
} else if (injectionOptions == null) {
removeChild(this.injectionOptions);
this.injectionOptions = null;
} else if (this.injectionOptions == null) {
this.injectionOptions = new KeyValueNode<InjectionOptions>(CommonConstants.CS_INLINE_INJECTION_TITLE, injectionOptions);
appendChild(this.injectionOptions, false);
} else {
this.injectionOptions.setValue(injectionOptions);
}
}
|
[
"public",
"void",
"setInjectionOptions",
"(",
"final",
"InjectionOptions",
"injectionOptions",
")",
"{",
"if",
"(",
"injectionOptions",
"==",
"null",
"&&",
"this",
".",
"injectionOptions",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"injectionOptions",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"injectionOptions",
")",
";",
"this",
".",
"injectionOptions",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"injectionOptions",
"==",
"null",
")",
"{",
"this",
".",
"injectionOptions",
"=",
"new",
"KeyValueNode",
"<",
"InjectionOptions",
">",
"(",
"CommonConstants",
".",
"CS_INLINE_INJECTION_TITLE",
",",
"injectionOptions",
")",
";",
"appendChild",
"(",
"this",
".",
"injectionOptions",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"injectionOptions",
".",
"setValue",
"(",
"injectionOptions",
")",
";",
"}",
"}"
] |
Sets the InjectionOptions that will be used by the Builder when building a book.
@param injectionOptions The InjectionOptions to be used when building a book.
|
[
"Sets",
"the",
"InjectionOptions",
"that",
"will",
"be",
"used",
"by",
"the",
"Builder",
"when",
"building",
"a",
"book",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L939-L951
|
152,463
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setLocale
|
public void setLocale(final String locale) {
if (locale == null && this.locale == null) {
return;
} else if (locale == null) {
removeChild(this.locale);
this.locale = null;
} else if (this.locale == null) {
this.locale = new KeyValueNode<String>(CommonConstants.CS_LOCALE_TITLE, locale);
appendChild(this.locale, false);
} else {
this.locale.setValue(locale);
}
}
|
java
|
public void setLocale(final String locale) {
if (locale == null && this.locale == null) {
return;
} else if (locale == null) {
removeChild(this.locale);
this.locale = null;
} else if (this.locale == null) {
this.locale = new KeyValueNode<String>(CommonConstants.CS_LOCALE_TITLE, locale);
appendChild(this.locale, false);
} else {
this.locale.setValue(locale);
}
}
|
[
"public",
"void",
"setLocale",
"(",
"final",
"String",
"locale",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
"&&",
"this",
".",
"locale",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"locale",
")",
";",
"this",
".",
"locale",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"locale",
"==",
"null",
")",
"{",
"this",
".",
"locale",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_LOCALE_TITLE",
",",
"locale",
")",
";",
"appendChild",
"(",
"this",
".",
"locale",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"locale",
".",
"setValue",
"(",
"locale",
")",
";",
"}",
"}"
] |
Sets the Content Specifications locale.
@param locale The locale for the content specification
|
[
"Sets",
"the",
"Content",
"Specifications",
"locale",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L994-L1006
|
152,464
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setUseDefaultPreface
|
public void setUseDefaultPreface(final Boolean useDefaultPreface) {
if (useDefaultPreface == null && this.useDefaultPreface == null) {
return;
} else if (useDefaultPreface == null) {
removeChild(this.useDefaultPreface);
this.useDefaultPreface = null;
} else if (this.useDefaultPreface == null) {
this.useDefaultPreface = new KeyValueNode<Boolean>(CommonConstants.CS_DEFAULT_PREFACE, useDefaultPreface);
appendChild(this.useDefaultPreface, false);
} else {
this.useDefaultPreface.setValue(useDefaultPreface);
}
}
|
java
|
public void setUseDefaultPreface(final Boolean useDefaultPreface) {
if (useDefaultPreface == null && this.useDefaultPreface == null) {
return;
} else if (useDefaultPreface == null) {
removeChild(this.useDefaultPreface);
this.useDefaultPreface = null;
} else if (this.useDefaultPreface == null) {
this.useDefaultPreface = new KeyValueNode<Boolean>(CommonConstants.CS_DEFAULT_PREFACE, useDefaultPreface);
appendChild(this.useDefaultPreface, false);
} else {
this.useDefaultPreface.setValue(useDefaultPreface);
}
}
|
[
"public",
"void",
"setUseDefaultPreface",
"(",
"final",
"Boolean",
"useDefaultPreface",
")",
"{",
"if",
"(",
"useDefaultPreface",
"==",
"null",
"&&",
"this",
".",
"useDefaultPreface",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"useDefaultPreface",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"useDefaultPreface",
")",
";",
"this",
".",
"useDefaultPreface",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"useDefaultPreface",
"==",
"null",
")",
"{",
"this",
".",
"useDefaultPreface",
"=",
"new",
"KeyValueNode",
"<",
"Boolean",
">",
"(",
"CommonConstants",
".",
"CS_DEFAULT_PREFACE",
",",
"useDefaultPreface",
")",
";",
"appendChild",
"(",
"this",
".",
"useDefaultPreface",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"useDefaultPreface",
".",
"setValue",
"(",
"useDefaultPreface",
")",
";",
"}",
"}"
] |
Sets the Content Specifications Default Preface setting.
@param useDefaultPreface Whether the default preface should be used.
|
[
"Sets",
"the",
"Content",
"Specifications",
"Default",
"Preface",
"setting",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1031-L1043
|
152,465
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setOutputStyle
|
public void setOutputStyle(final String outputStyle) {
if (outputStyle == null && this.outputStyle == null) {
return;
} else if (outputStyle == null) {
removeChild(this.outputStyle);
this.outputStyle = null;
} else if (this.outputStyle == null) {
this.outputStyle = new KeyValueNode<String>(CSConstants.OUTPUT_STYLE_TITLE, outputStyle);
appendChild(this.outputStyle, false);
} else {
this.outputStyle.setValue(outputStyle);
}
}
|
java
|
public void setOutputStyle(final String outputStyle) {
if (outputStyle == null && this.outputStyle == null) {
return;
} else if (outputStyle == null) {
removeChild(this.outputStyle);
this.outputStyle = null;
} else if (this.outputStyle == null) {
this.outputStyle = new KeyValueNode<String>(CSConstants.OUTPUT_STYLE_TITLE, outputStyle);
appendChild(this.outputStyle, false);
} else {
this.outputStyle.setValue(outputStyle);
}
}
|
[
"public",
"void",
"setOutputStyle",
"(",
"final",
"String",
"outputStyle",
")",
"{",
"if",
"(",
"outputStyle",
"==",
"null",
"&&",
"this",
".",
"outputStyle",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"outputStyle",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"outputStyle",
")",
";",
"this",
".",
"outputStyle",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"outputStyle",
"==",
"null",
")",
"{",
"this",
".",
"outputStyle",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CSConstants",
".",
"OUTPUT_STYLE_TITLE",
",",
"outputStyle",
")",
";",
"appendChild",
"(",
"this",
".",
"outputStyle",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"outputStyle",
".",
"setValue",
"(",
"outputStyle",
")",
";",
"}",
"}"
] |
Sets the Content Specifications output style.
@param outputStyle The output style for the content specification
|
[
"Sets",
"the",
"Content",
"Specifications",
"output",
"style",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1068-L1080
|
152,466
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBugzillaVersion
|
public void setBugzillaVersion(final String bugzillaVersion) {
if (bugzillaVersion == null && this.bugzillaVersion == null) {
return;
} else if (bugzillaVersion == null) {
removeChild(this.bugzillaVersion);
this.bugzillaVersion = null;
} else if (this.bugzillaVersion == null) {
this.bugzillaVersion = new KeyValueNode<String>(CommonConstants.CS_BUGZILLA_VERSION_TITLE, bugzillaVersion);
appendChild(this.bugzillaVersion, false);
} else {
this.bugzillaVersion.setValue(bugzillaVersion);
}
}
|
java
|
public void setBugzillaVersion(final String bugzillaVersion) {
if (bugzillaVersion == null && this.bugzillaVersion == null) {
return;
} else if (bugzillaVersion == null) {
removeChild(this.bugzillaVersion);
this.bugzillaVersion = null;
} else if (this.bugzillaVersion == null) {
this.bugzillaVersion = new KeyValueNode<String>(CommonConstants.CS_BUGZILLA_VERSION_TITLE, bugzillaVersion);
appendChild(this.bugzillaVersion, false);
} else {
this.bugzillaVersion.setValue(bugzillaVersion);
}
}
|
[
"public",
"void",
"setBugzillaVersion",
"(",
"final",
"String",
"bugzillaVersion",
")",
"{",
"if",
"(",
"bugzillaVersion",
"==",
"null",
"&&",
"this",
".",
"bugzillaVersion",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"bugzillaVersion",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"bugzillaVersion",
")",
";",
"this",
".",
"bugzillaVersion",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"bugzillaVersion",
"==",
"null",
")",
"{",
"this",
".",
"bugzillaVersion",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_BUGZILLA_VERSION_TITLE",
",",
"bugzillaVersion",
")",
";",
"appendChild",
"(",
"this",
".",
"bugzillaVersion",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"bugzillaVersion",
".",
"setValue",
"(",
"bugzillaVersion",
")",
";",
"}",
"}"
] |
Set the Bugzilla Version to be applied during building.
@param bugzillaVersion The version of the product in bugzilla.
|
[
"Set",
"the",
"Bugzilla",
"Version",
"to",
"be",
"applied",
"during",
"building",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1497-L1509
|
152,467
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBugzillaKeywords
|
public void setBugzillaKeywords(final String bugzillaKeywords) {
if (bugzillaKeywords == null && this.bugzillaKeywords == null) {
return;
} else if (bugzillaKeywords == null) {
removeChild(this.bugzillaKeywords);
this.bugzillaKeywords = null;
} else if (this.bugzillaKeywords == null) {
this.bugzillaKeywords = new KeyValueNode<String>(CommonConstants.CS_BUGZILLA_KEYWORDS_TITLE, bugzillaKeywords);
appendChild(this.bugzillaKeywords, false);
} else {
this.bugzillaKeywords.setValue(bugzillaKeywords);
}
}
|
java
|
public void setBugzillaKeywords(final String bugzillaKeywords) {
if (bugzillaKeywords == null && this.bugzillaKeywords == null) {
return;
} else if (bugzillaKeywords == null) {
removeChild(this.bugzillaKeywords);
this.bugzillaKeywords = null;
} else if (this.bugzillaKeywords == null) {
this.bugzillaKeywords = new KeyValueNode<String>(CommonConstants.CS_BUGZILLA_KEYWORDS_TITLE, bugzillaKeywords);
appendChild(this.bugzillaKeywords, false);
} else {
this.bugzillaKeywords.setValue(bugzillaKeywords);
}
}
|
[
"public",
"void",
"setBugzillaKeywords",
"(",
"final",
"String",
"bugzillaKeywords",
")",
"{",
"if",
"(",
"bugzillaKeywords",
"==",
"null",
"&&",
"this",
".",
"bugzillaKeywords",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"bugzillaKeywords",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"bugzillaKeywords",
")",
";",
"this",
".",
"bugzillaKeywords",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"bugzillaKeywords",
"==",
"null",
")",
"{",
"this",
".",
"bugzillaKeywords",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_BUGZILLA_KEYWORDS_TITLE",
",",
"bugzillaKeywords",
")",
";",
"appendChild",
"(",
"this",
".",
"bugzillaKeywords",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"bugzillaKeywords",
".",
"setValue",
"(",
"bugzillaKeywords",
")",
";",
"}",
"}"
] |
Set the Bugzilla Keywords to be applied during building.
@param bugzillaKeywords The keywords to be set in bugzilla.
|
[
"Set",
"the",
"Bugzilla",
"Keywords",
"to",
"be",
"applied",
"during",
"building",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1534-L1546
|
152,468
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setBugzillaURL
|
public void setBugzillaURL(final String bugzillaURL) {
if (bugzillaURL == null && this.bugzillaURL == null) {
return;
} else if (bugzillaURL == null) {
removeChild(this.bugzillaURL);
this.bugzillaURL = null;
} else if (this.bugzillaURL == null) {
this.bugzillaURL = new KeyValueNode<String>(CommonConstants.CS_BUGZILLA_URL_TITLE, bugzillaURL);
appendChild(this.bugzillaURL, false);
} else {
this.bugzillaURL.setValue(bugzillaURL);
}
}
|
java
|
public void setBugzillaURL(final String bugzillaURL) {
if (bugzillaURL == null && this.bugzillaURL == null) {
return;
} else if (bugzillaURL == null) {
removeChild(this.bugzillaURL);
this.bugzillaURL = null;
} else if (this.bugzillaURL == null) {
this.bugzillaURL = new KeyValueNode<String>(CommonConstants.CS_BUGZILLA_URL_TITLE, bugzillaURL);
appendChild(this.bugzillaURL, false);
} else {
this.bugzillaURL.setValue(bugzillaURL);
}
}
|
[
"public",
"void",
"setBugzillaURL",
"(",
"final",
"String",
"bugzillaURL",
")",
"{",
"if",
"(",
"bugzillaURL",
"==",
"null",
"&&",
"this",
".",
"bugzillaURL",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"bugzillaURL",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"bugzillaURL",
")",
";",
"this",
".",
"bugzillaURL",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"bugzillaURL",
"==",
"null",
")",
"{",
"this",
".",
"bugzillaURL",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_BUGZILLA_URL_TITLE",
",",
"bugzillaURL",
")",
";",
"appendChild",
"(",
"this",
".",
"bugzillaURL",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"bugzillaURL",
".",
"setValue",
"(",
"bugzillaURL",
")",
";",
"}",
"}"
] |
Set the URL component that is used in the .ent file when building the Docbook files.
@param bugzillaURL The BZURL component to be used when building.
|
[
"Set",
"the",
"URL",
"component",
"that",
"is",
"used",
"in",
"the",
".",
"ent",
"file",
"when",
"building",
"the",
"Docbook",
"files",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1604-L1616
|
152,469
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setJIRAVersion
|
public void setJIRAVersion(final String jiraVersion) {
if (jiraVersion == null && this.jiraVersion == null) {
return;
} else if (jiraVersion == null) {
removeChild(this.jiraVersion);
this.jiraVersion = null;
} else if (this.jiraVersion == null) {
this.jiraVersion = new KeyValueNode<String>(CommonConstants.CS_JIRA_VERSION_TITLE, jiraVersion);
appendChild(this.jiraVersion, false);
} else {
this.jiraVersion.setValue(jiraVersion);
}
}
|
java
|
public void setJIRAVersion(final String jiraVersion) {
if (jiraVersion == null && this.jiraVersion == null) {
return;
} else if (jiraVersion == null) {
removeChild(this.jiraVersion);
this.jiraVersion = null;
} else if (this.jiraVersion == null) {
this.jiraVersion = new KeyValueNode<String>(CommonConstants.CS_JIRA_VERSION_TITLE, jiraVersion);
appendChild(this.jiraVersion, false);
} else {
this.jiraVersion.setValue(jiraVersion);
}
}
|
[
"public",
"void",
"setJIRAVersion",
"(",
"final",
"String",
"jiraVersion",
")",
"{",
"if",
"(",
"jiraVersion",
"==",
"null",
"&&",
"this",
".",
"jiraVersion",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"jiraVersion",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"jiraVersion",
")",
";",
"this",
".",
"jiraVersion",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"jiraVersion",
"==",
"null",
")",
"{",
"this",
".",
"jiraVersion",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_JIRA_VERSION_TITLE",
",",
"jiraVersion",
")",
";",
"appendChild",
"(",
"this",
".",
"jiraVersion",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"jiraVersion",
".",
"setValue",
"(",
"jiraVersion",
")",
";",
"}",
"}"
] |
Set the JIRA Version to be applied during building.
@param jiraVersion The version of the project in jira.
|
[
"Set",
"the",
"JIRA",
"Version",
"to",
"be",
"applied",
"during",
"building",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1769-L1781
|
152,470
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setJIRALabels
|
public void setJIRALabels(final String jiraLabels) {
if (jiraLabels == null && this.jiraLabels == null) {
return;
} else if (jiraLabels == null) {
removeChild(this.jiraLabels);
this.jiraLabels = null;
} else if (this.jiraLabels == null) {
this.jiraLabels = new KeyValueNode<String>(CommonConstants.CS_JIRA_LABELS_TITLE, jiraLabels);
appendChild(this.jiraLabels, false);
} else {
this.jiraLabels.setValue(jiraLabels);
}
}
|
java
|
public void setJIRALabels(final String jiraLabels) {
if (jiraLabels == null && this.jiraLabels == null) {
return;
} else if (jiraLabels == null) {
removeChild(this.jiraLabels);
this.jiraLabels = null;
} else if (this.jiraLabels == null) {
this.jiraLabels = new KeyValueNode<String>(CommonConstants.CS_JIRA_LABELS_TITLE, jiraLabels);
appendChild(this.jiraLabels, false);
} else {
this.jiraLabels.setValue(jiraLabels);
}
}
|
[
"public",
"void",
"setJIRALabels",
"(",
"final",
"String",
"jiraLabels",
")",
"{",
"if",
"(",
"jiraLabels",
"==",
"null",
"&&",
"this",
".",
"jiraLabels",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"jiraLabels",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"jiraLabels",
")",
";",
"this",
".",
"jiraLabels",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"jiraLabels",
"==",
"null",
")",
"{",
"this",
".",
"jiraLabels",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_JIRA_LABELS_TITLE",
",",
"jiraLabels",
")",
";",
"appendChild",
"(",
"this",
".",
"jiraLabels",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"jiraLabels",
".",
"setValue",
"(",
"jiraLabels",
")",
";",
"}",
"}"
] |
Set the JIRA Labels to be applied during building.
@param jiraLabels The keywords to be set in jira.
|
[
"Set",
"the",
"JIRA",
"Labels",
"to",
"be",
"applied",
"during",
"building",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1806-L1818
|
152,471
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setRevisionHistory
|
public void setRevisionHistory(final SpecTopic revisionHistory) {
if (revisionHistory == null && this.revisionHistory == null) {
return;
} else if (revisionHistory == null) {
removeChild(this.revisionHistory);
this.revisionHistory = null;
} else if (this.revisionHistory == null) {
revisionHistory.setTopicType(TopicType.REVISION_HISTORY);
this.revisionHistory = new KeyValueNode<SpecTopic>(CommonConstants.CS_REV_HISTORY_TITLE, revisionHistory);
appendChild(this.revisionHistory, false);
} else {
revisionHistory.setTopicType(TopicType.REVISION_HISTORY);
this.revisionHistory.setValue(revisionHistory);
}
}
|
java
|
public void setRevisionHistory(final SpecTopic revisionHistory) {
if (revisionHistory == null && this.revisionHistory == null) {
return;
} else if (revisionHistory == null) {
removeChild(this.revisionHistory);
this.revisionHistory = null;
} else if (this.revisionHistory == null) {
revisionHistory.setTopicType(TopicType.REVISION_HISTORY);
this.revisionHistory = new KeyValueNode<SpecTopic>(CommonConstants.CS_REV_HISTORY_TITLE, revisionHistory);
appendChild(this.revisionHistory, false);
} else {
revisionHistory.setTopicType(TopicType.REVISION_HISTORY);
this.revisionHistory.setValue(revisionHistory);
}
}
|
[
"public",
"void",
"setRevisionHistory",
"(",
"final",
"SpecTopic",
"revisionHistory",
")",
"{",
"if",
"(",
"revisionHistory",
"==",
"null",
"&&",
"this",
".",
"revisionHistory",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"revisionHistory",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"revisionHistory",
")",
";",
"this",
".",
"revisionHistory",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"revisionHistory",
"==",
"null",
")",
"{",
"revisionHistory",
".",
"setTopicType",
"(",
"TopicType",
".",
"REVISION_HISTORY",
")",
";",
"this",
".",
"revisionHistory",
"=",
"new",
"KeyValueNode",
"<",
"SpecTopic",
">",
"(",
"CommonConstants",
".",
"CS_REV_HISTORY_TITLE",
",",
"revisionHistory",
")",
";",
"appendChild",
"(",
"this",
".",
"revisionHistory",
",",
"false",
")",
";",
"}",
"else",
"{",
"revisionHistory",
".",
"setTopicType",
"(",
"TopicType",
".",
"REVISION_HISTORY",
")",
";",
"this",
".",
"revisionHistory",
".",
"setValue",
"(",
"revisionHistory",
")",
";",
"}",
"}"
] |
Sets the SpecTopic of the Revision History for the Content Specification.
@param revisionHistory The SpecTopic for the Revision History
|
[
"Sets",
"the",
"SpecTopic",
"of",
"the",
"Revision",
"History",
"for",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1878-L1892
|
152,472
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setFeedback
|
public void setFeedback(final SpecTopic feedback) {
if (feedback == null && this.feedback == null) {
return;
} else if (feedback == null) {
removeChild(this.feedback);
this.feedback = null;
} else if (this.feedback == null) {
feedback.setTopicType(TopicType.FEEDBACK);
this.feedback = new KeyValueNode<SpecTopic>(CommonConstants.CS_FEEDBACK_TITLE, feedback);
appendChild(this.feedback, false);
} else {
feedback.setTopicType(TopicType.FEEDBACK);
this.feedback.setValue(feedback);
}
}
|
java
|
public void setFeedback(final SpecTopic feedback) {
if (feedback == null && this.feedback == null) {
return;
} else if (feedback == null) {
removeChild(this.feedback);
this.feedback = null;
} else if (this.feedback == null) {
feedback.setTopicType(TopicType.FEEDBACK);
this.feedback = new KeyValueNode<SpecTopic>(CommonConstants.CS_FEEDBACK_TITLE, feedback);
appendChild(this.feedback, false);
} else {
feedback.setTopicType(TopicType.FEEDBACK);
this.feedback.setValue(feedback);
}
}
|
[
"public",
"void",
"setFeedback",
"(",
"final",
"SpecTopic",
"feedback",
")",
"{",
"if",
"(",
"feedback",
"==",
"null",
"&&",
"this",
".",
"feedback",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"feedback",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"feedback",
")",
";",
"this",
".",
"feedback",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"feedback",
"==",
"null",
")",
"{",
"feedback",
".",
"setTopicType",
"(",
"TopicType",
".",
"FEEDBACK",
")",
";",
"this",
".",
"feedback",
"=",
"new",
"KeyValueNode",
"<",
"SpecTopic",
">",
"(",
"CommonConstants",
".",
"CS_FEEDBACK_TITLE",
",",
"feedback",
")",
";",
"appendChild",
"(",
"this",
".",
"feedback",
",",
"false",
")",
";",
"}",
"else",
"{",
"feedback",
".",
"setTopicType",
"(",
"TopicType",
".",
"FEEDBACK",
")",
";",
"this",
".",
"feedback",
".",
"setValue",
"(",
"feedback",
")",
";",
"}",
"}"
] |
Sets the SpecTopic of the Feedback for the Content Specification.
@param feedback The SpecTopic for the Feedback content.
|
[
"Sets",
"the",
"SpecTopic",
"of",
"the",
"Feedback",
"for",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1908-L1922
|
152,473
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setLegalNotice
|
public void setLegalNotice(final SpecTopic legalNotice) {
if (legalNotice == null && this.legalNotice == null) {
return;
} else if (legalNotice == null) {
removeChild(this.legalNotice);
this.legalNotice = null;
} else if (this.legalNotice == null) {
legalNotice.setTopicType(TopicType.LEGAL_NOTICE);
this.legalNotice = new KeyValueNode<SpecTopic>(CommonConstants.CS_LEGAL_NOTICE_TITLE, legalNotice);
appendChild(this.legalNotice, false);
} else {
legalNotice.setTopicType(TopicType.LEGAL_NOTICE);
this.legalNotice.setValue(legalNotice);
}
}
|
java
|
public void setLegalNotice(final SpecTopic legalNotice) {
if (legalNotice == null && this.legalNotice == null) {
return;
} else if (legalNotice == null) {
removeChild(this.legalNotice);
this.legalNotice = null;
} else if (this.legalNotice == null) {
legalNotice.setTopicType(TopicType.LEGAL_NOTICE);
this.legalNotice = new KeyValueNode<SpecTopic>(CommonConstants.CS_LEGAL_NOTICE_TITLE, legalNotice);
appendChild(this.legalNotice, false);
} else {
legalNotice.setTopicType(TopicType.LEGAL_NOTICE);
this.legalNotice.setValue(legalNotice);
}
}
|
[
"public",
"void",
"setLegalNotice",
"(",
"final",
"SpecTopic",
"legalNotice",
")",
"{",
"if",
"(",
"legalNotice",
"==",
"null",
"&&",
"this",
".",
"legalNotice",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"legalNotice",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"legalNotice",
")",
";",
"this",
".",
"legalNotice",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"legalNotice",
"==",
"null",
")",
"{",
"legalNotice",
".",
"setTopicType",
"(",
"TopicType",
".",
"LEGAL_NOTICE",
")",
";",
"this",
".",
"legalNotice",
"=",
"new",
"KeyValueNode",
"<",
"SpecTopic",
">",
"(",
"CommonConstants",
".",
"CS_LEGAL_NOTICE_TITLE",
",",
"legalNotice",
")",
";",
"appendChild",
"(",
"this",
".",
"legalNotice",
",",
"false",
")",
";",
"}",
"else",
"{",
"legalNotice",
".",
"setTopicType",
"(",
"TopicType",
".",
"LEGAL_NOTICE",
")",
";",
"this",
".",
"legalNotice",
".",
"setValue",
"(",
"legalNotice",
")",
";",
"}",
"}"
] |
Sets the SpecTopic of the Legal Notice for the Content Specification.
@param legalNotice The SpecTopic for the Legal Notice.
|
[
"Sets",
"the",
"SpecTopic",
"of",
"the",
"Legal",
"Notice",
"for",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1938-L1952
|
152,474
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setAuthorGroup
|
public void setAuthorGroup(final SpecTopic authorGroup) {
if (authorGroup == null && this.authorGroup == null) {
return;
} else if (authorGroup == null) {
removeChild(this.authorGroup);
this.authorGroup = null;
} else if (this.authorGroup == null) {
authorGroup.setTopicType(TopicType.AUTHOR_GROUP);
this.authorGroup = new KeyValueNode<SpecTopic>(CommonConstants.CS_AUTHOR_GROUP_TITLE, authorGroup);
appendChild(this.authorGroup, false);
} else {
authorGroup.setTopicType(TopicType.AUTHOR_GROUP);
this.authorGroup.setValue(authorGroup);
}
}
|
java
|
public void setAuthorGroup(final SpecTopic authorGroup) {
if (authorGroup == null && this.authorGroup == null) {
return;
} else if (authorGroup == null) {
removeChild(this.authorGroup);
this.authorGroup = null;
} else if (this.authorGroup == null) {
authorGroup.setTopicType(TopicType.AUTHOR_GROUP);
this.authorGroup = new KeyValueNode<SpecTopic>(CommonConstants.CS_AUTHOR_GROUP_TITLE, authorGroup);
appendChild(this.authorGroup, false);
} else {
authorGroup.setTopicType(TopicType.AUTHOR_GROUP);
this.authorGroup.setValue(authorGroup);
}
}
|
[
"public",
"void",
"setAuthorGroup",
"(",
"final",
"SpecTopic",
"authorGroup",
")",
"{",
"if",
"(",
"authorGroup",
"==",
"null",
"&&",
"this",
".",
"authorGroup",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"authorGroup",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"authorGroup",
")",
";",
"this",
".",
"authorGroup",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"authorGroup",
"==",
"null",
")",
"{",
"authorGroup",
".",
"setTopicType",
"(",
"TopicType",
".",
"AUTHOR_GROUP",
")",
";",
"this",
".",
"authorGroup",
"=",
"new",
"KeyValueNode",
"<",
"SpecTopic",
">",
"(",
"CommonConstants",
".",
"CS_AUTHOR_GROUP_TITLE",
",",
"authorGroup",
")",
";",
"appendChild",
"(",
"this",
".",
"authorGroup",
",",
"false",
")",
";",
"}",
"else",
"{",
"authorGroup",
".",
"setTopicType",
"(",
"TopicType",
".",
"AUTHOR_GROUP",
")",
";",
"this",
".",
"authorGroup",
".",
"setValue",
"(",
"authorGroup",
")",
";",
"}",
"}"
] |
Sets the SpecTopic of the Author Group for the Content Specification.
@param authorGroup The SpecTopic for the Author Group.
|
[
"Sets",
"the",
"SpecTopic",
"of",
"the",
"Author",
"Group",
"for",
"the",
"Content",
"Specification",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L1968-L1982
|
152,475
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setGroupId
|
public void setGroupId(final String groupId) {
if (groupId == null && this.groupId == null) {
return;
} else if (groupId == null) {
removeChild(this.groupId);
this.groupId = null;
} else if (this.groupId == null) {
this.groupId = new KeyValueNode<String>(CommonConstants.CS_MAVEN_GROUP_ID_TITLE, groupId);
appendChild(this.groupId, false);
} else {
this.groupId.setValue(groupId);
}
}
|
java
|
public void setGroupId(final String groupId) {
if (groupId == null && this.groupId == null) {
return;
} else if (groupId == null) {
removeChild(this.groupId);
this.groupId = null;
} else if (this.groupId == null) {
this.groupId = new KeyValueNode<String>(CommonConstants.CS_MAVEN_GROUP_ID_TITLE, groupId);
appendChild(this.groupId, false);
} else {
this.groupId.setValue(groupId);
}
}
|
[
"public",
"void",
"setGroupId",
"(",
"final",
"String",
"groupId",
")",
"{",
"if",
"(",
"groupId",
"==",
"null",
"&&",
"this",
".",
"groupId",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"groupId",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"groupId",
")",
";",
"this",
".",
"groupId",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"groupId",
"==",
"null",
")",
"{",
"this",
".",
"groupId",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_MAVEN_GROUP_ID_TITLE",
",",
"groupId",
")",
";",
"appendChild",
"(",
"this",
".",
"groupId",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"groupId",
".",
"setValue",
"(",
"groupId",
")",
";",
"}",
"}"
] |
Set the Maven groupId that is used in the pom.xml file when building the jDocbook files.
@param groupId The Maven groupId to be used when building.
|
[
"Set",
"the",
"Maven",
"groupId",
"that",
"is",
"used",
"in",
"the",
"pom",
".",
"xml",
"file",
"when",
"building",
"the",
"jDocbook",
"files",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2007-L2019
|
152,476
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setArtifactId
|
public void setArtifactId(final String artifactId) {
if (artifactId == null && this.artifactId == null) {
return;
} else if (artifactId == null) {
removeChild(this.artifactId);
this.artifactId = null;
} else if (this.artifactId == null) {
this.artifactId = new KeyValueNode<String>(CommonConstants.CS_MAVEN_ARTIFACT_ID_TITLE, artifactId);
appendChild(this.artifactId, false);
} else {
this.artifactId.setValue(artifactId);
}
}
|
java
|
public void setArtifactId(final String artifactId) {
if (artifactId == null && this.artifactId == null) {
return;
} else if (artifactId == null) {
removeChild(this.artifactId);
this.artifactId = null;
} else if (this.artifactId == null) {
this.artifactId = new KeyValueNode<String>(CommonConstants.CS_MAVEN_ARTIFACT_ID_TITLE, artifactId);
appendChild(this.artifactId, false);
} else {
this.artifactId.setValue(artifactId);
}
}
|
[
"public",
"void",
"setArtifactId",
"(",
"final",
"String",
"artifactId",
")",
"{",
"if",
"(",
"artifactId",
"==",
"null",
"&&",
"this",
".",
"artifactId",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"artifactId",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"artifactId",
")",
";",
"this",
".",
"artifactId",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"artifactId",
"==",
"null",
")",
"{",
"this",
".",
"artifactId",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_MAVEN_ARTIFACT_ID_TITLE",
",",
"artifactId",
")",
";",
"appendChild",
"(",
"this",
".",
"artifactId",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"artifactId",
".",
"setValue",
"(",
"artifactId",
")",
";",
"}",
"}"
] |
Set the Maven artifactId that is used in the pom.xml file when building the jDocbook files.
@param artifactId The Maven artifactId to be used when building.
|
[
"Set",
"the",
"Maven",
"artifactId",
"that",
"is",
"used",
"in",
"the",
"pom",
".",
"xml",
"file",
"when",
"building",
"the",
"jDocbook",
"files",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2044-L2056
|
152,477
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setPOMVersion
|
public void setPOMVersion(final String pomVersion) {
if (pomVersion == null && this.pomVersion == null) {
return;
} else if (pomVersion == null) {
removeChild(this.pomVersion);
this.pomVersion = null;
} else if (this.pomVersion == null) {
this.pomVersion = new KeyValueNode<String>(CommonConstants.CS_MAVEN_POM_VERSION_TITLE, pomVersion);
appendChild(this.pomVersion, false);
} else {
this.pomVersion.setValue(pomVersion);
}
}
|
java
|
public void setPOMVersion(final String pomVersion) {
if (pomVersion == null && this.pomVersion == null) {
return;
} else if (pomVersion == null) {
removeChild(this.pomVersion);
this.pomVersion = null;
} else if (this.pomVersion == null) {
this.pomVersion = new KeyValueNode<String>(CommonConstants.CS_MAVEN_POM_VERSION_TITLE, pomVersion);
appendChild(this.pomVersion, false);
} else {
this.pomVersion.setValue(pomVersion);
}
}
|
[
"public",
"void",
"setPOMVersion",
"(",
"final",
"String",
"pomVersion",
")",
"{",
"if",
"(",
"pomVersion",
"==",
"null",
"&&",
"this",
".",
"pomVersion",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"pomVersion",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"pomVersion",
")",
";",
"this",
".",
"pomVersion",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"pomVersion",
"==",
"null",
")",
"{",
"this",
".",
"pomVersion",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_MAVEN_POM_VERSION_TITLE",
",",
"pomVersion",
")",
";",
"appendChild",
"(",
"this",
".",
"pomVersion",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"pomVersion",
".",
"setValue",
"(",
"pomVersion",
")",
";",
"}",
"}"
] |
Set the Maven POM version that is used in the pom.xml file when building the jDocbook files.
@param pomVersion The Maven POM version to be used when building.
|
[
"Set",
"the",
"Maven",
"POM",
"version",
"that",
"is",
"used",
"in",
"the",
"pom",
".",
"xml",
"file",
"when",
"building",
"the",
"jDocbook",
"files",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2081-L2093
|
152,478
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setFiles
|
public void setFiles(final List<File> files) {
if (files == null && this.files == null) {
return;
} else if (files == null) {
removeChild(this.files);
this.files = null;
} else if (this.files == null) {
this.files = new FileList(CommonConstants.CS_FILE_TITLE, files);
appendChild(this.files, false);
} else {
this.files.setValue(files);
}
}
|
java
|
public void setFiles(final List<File> files) {
if (files == null && this.files == null) {
return;
} else if (files == null) {
removeChild(this.files);
this.files = null;
} else if (this.files == null) {
this.files = new FileList(CommonConstants.CS_FILE_TITLE, files);
appendChild(this.files, false);
} else {
this.files.setValue(files);
}
}
|
[
"public",
"void",
"setFiles",
"(",
"final",
"List",
"<",
"File",
">",
"files",
")",
"{",
"if",
"(",
"files",
"==",
"null",
"&&",
"this",
".",
"files",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"files",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"files",
")",
";",
"this",
".",
"files",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"files",
"==",
"null",
")",
"{",
"this",
".",
"files",
"=",
"new",
"FileList",
"(",
"CommonConstants",
".",
"CS_FILE_TITLE",
",",
"files",
")",
";",
"appendChild",
"(",
"this",
".",
"files",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"files",
".",
"setValue",
"(",
"files",
")",
";",
"}",
"}"
] |
Sets the list of additional files needed by the book.
@param files The list of additional Files.
|
[
"Sets",
"the",
"list",
"of",
"additional",
"files",
"needed",
"by",
"the",
"book",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2118-L2130
|
152,479
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setEntities
|
public void setEntities(final String entities) {
if (entities == null && this.entities == null) {
return;
} else if (entities == null) {
removeChild(this.entities);
this.entities = null;
} else if (this.entities == null) {
this.entities = new KeyValueNode<String>(CommonConstants.CS_ENTITIES_TITLE, entities);
appendChild(this.entities, false);
} else {
this.entities.setValue(entities);
}
}
|
java
|
public void setEntities(final String entities) {
if (entities == null && this.entities == null) {
return;
} else if (entities == null) {
removeChild(this.entities);
this.entities = null;
} else if (this.entities == null) {
this.entities = new KeyValueNode<String>(CommonConstants.CS_ENTITIES_TITLE, entities);
appendChild(this.entities, false);
} else {
this.entities.setValue(entities);
}
}
|
[
"public",
"void",
"setEntities",
"(",
"final",
"String",
"entities",
")",
"{",
"if",
"(",
"entities",
"==",
"null",
"&&",
"this",
".",
"entities",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"entities",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"entities",
")",
";",
"this",
".",
"entities",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"entities",
"==",
"null",
")",
"{",
"this",
".",
"entities",
"=",
"new",
"KeyValueNode",
"<",
"String",
">",
"(",
"CommonConstants",
".",
"CS_ENTITIES_TITLE",
",",
"entities",
")",
";",
"appendChild",
"(",
"this",
".",
"entities",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"entities",
".",
"setValue",
"(",
"entities",
")",
";",
"}",
"}"
] |
Set the data that will be appended to the <book>.ent file when built.
@param entities The data to be appended.
|
[
"Set",
"the",
"data",
"that",
"will",
"be",
"appended",
"to",
"the",
"<",
";",
"book>",
";",
".",
"ent",
"file",
"when",
"built",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2155-L2167
|
152,480
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.setIncludeIndex
|
public void setIncludeIndex(final Boolean includeIndex) {
if (includeIndex == null && this.includeIndex == null) {
return;
} else if (includeIndex == null) {
removeChild(this.includeIndex);
this.includeIndex = null;
} else if (this.includeIndex == null) {
this.includeIndex = new KeyValueNode<Boolean>(CommonConstants.CS_INDEX_TITLE, includeIndex);
appendChild(this.includeIndex, false);
} else {
this.includeIndex.setValue(includeIndex);
}
}
|
java
|
public void setIncludeIndex(final Boolean includeIndex) {
if (includeIndex == null && this.includeIndex == null) {
return;
} else if (includeIndex == null) {
removeChild(this.includeIndex);
this.includeIndex = null;
} else if (this.includeIndex == null) {
this.includeIndex = new KeyValueNode<Boolean>(CommonConstants.CS_INDEX_TITLE, includeIndex);
appendChild(this.includeIndex, false);
} else {
this.includeIndex.setValue(includeIndex);
}
}
|
[
"public",
"void",
"setIncludeIndex",
"(",
"final",
"Boolean",
"includeIndex",
")",
"{",
"if",
"(",
"includeIndex",
"==",
"null",
"&&",
"this",
".",
"includeIndex",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"includeIndex",
"==",
"null",
")",
"{",
"removeChild",
"(",
"this",
".",
"includeIndex",
")",
";",
"this",
".",
"includeIndex",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"this",
".",
"includeIndex",
"==",
"null",
")",
"{",
"this",
".",
"includeIndex",
"=",
"new",
"KeyValueNode",
"<",
"Boolean",
">",
"(",
"CommonConstants",
".",
"CS_INDEX_TITLE",
",",
"includeIndex",
")",
";",
"appendChild",
"(",
"this",
".",
"includeIndex",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"includeIndex",
".",
"setValue",
"(",
"includeIndex",
")",
";",
"}",
"}"
] |
Set whether an index should be included in the Content Specification output.
@param includeIndex A boolean value that is true if the index should be used, otherwise false.
|
[
"Set",
"whether",
"an",
"index",
"should",
"be",
"included",
"in",
"the",
"Content",
"Specification",
"output",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2183-L2195
|
152,481
|
pressgang-ccms/PressGangCCMSContentSpec
|
src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java
|
ContentSpec.appendChild
|
protected void appendChild(final Node child, boolean checkForType) {
if (checkForType && child instanceof KeyValueNode) {
appendKeyValueNode((KeyValueNode<?>) child);
} else if (checkForType && child instanceof Level) {
getBaseLevel().appendChild(child);
} else if (checkForType && child instanceof SpecTopic) {
getBaseLevel().appendChild(child);
} else {
nodes.add(child);
if (child.getParent() != null) {
child.removeParent();
}
child.setParent(this);
}
}
|
java
|
protected void appendChild(final Node child, boolean checkForType) {
if (checkForType && child instanceof KeyValueNode) {
appendKeyValueNode((KeyValueNode<?>) child);
} else if (checkForType && child instanceof Level) {
getBaseLevel().appendChild(child);
} else if (checkForType && child instanceof SpecTopic) {
getBaseLevel().appendChild(child);
} else {
nodes.add(child);
if (child.getParent() != null) {
child.removeParent();
}
child.setParent(this);
}
}
|
[
"protected",
"void",
"appendChild",
"(",
"final",
"Node",
"child",
",",
"boolean",
"checkForType",
")",
"{",
"if",
"(",
"checkForType",
"&&",
"child",
"instanceof",
"KeyValueNode",
")",
"{",
"appendKeyValueNode",
"(",
"(",
"KeyValueNode",
"<",
"?",
">",
")",
"child",
")",
";",
"}",
"else",
"if",
"(",
"checkForType",
"&&",
"child",
"instanceof",
"Level",
")",
"{",
"getBaseLevel",
"(",
")",
".",
"appendChild",
"(",
"child",
")",
";",
"}",
"else",
"if",
"(",
"checkForType",
"&&",
"child",
"instanceof",
"SpecTopic",
")",
"{",
"getBaseLevel",
"(",
")",
".",
"appendChild",
"(",
"child",
")",
";",
"}",
"else",
"{",
"nodes",
".",
"add",
"(",
"child",
")",
";",
"if",
"(",
"child",
".",
"getParent",
"(",
")",
"!=",
"null",
")",
"{",
"child",
".",
"removeParent",
"(",
")",
";",
"}",
"child",
".",
"setParent",
"(",
"this",
")",
";",
"}",
"}"
] |
Adds a Child node to the Content Spec. If the Child node already has a parent, then it is removed from that parent and added
to this content spec.
@param child A Child Node to be added to the ContentSpec.
@param checkForType If the method should check the type of the child, and use a type specific method instead.
|
[
"Adds",
"a",
"Child",
"node",
"to",
"the",
"Content",
"Spec",
".",
"If",
"the",
"Child",
"node",
"already",
"has",
"a",
"parent",
"then",
"it",
"is",
"removed",
"from",
"that",
"parent",
"and",
"added",
"to",
"this",
"content",
"spec",
"."
] |
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
|
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2214-L2228
|
152,482
|
jbundle/jbundle
|
base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java
|
ZScreenField.processServletCommand
|
public boolean processServletCommand()
throws DBException
{
String strCommand = this.getProperty(DBParams.COMMAND); // Display record
if (strCommand == null)
strCommand = Constants.BLANK;
boolean bSuccess = false;
if (this.getScreenField() instanceof BasePanel)
{ // Always
if (strCommand.equalsIgnoreCase(ThinMenuConstants.FIRST))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.FIRST_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.PREVIOUS))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.PREVIOUS_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.NEXT))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.NEXT_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.LAST))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.LAST_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.SUBMIT))
bSuccess = ((BasePanel)this.getScreenField()).onAdd();
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.DELETE))
bSuccess = ((BasePanel)this.getScreenField()).onDelete();
else
{ // Must have sent a user-defined command (send command to this screen)
bSuccess = false; // Too dangerous ((BasePanel)this.getScreenField()).handleCommand(strCommand, this.getScreenField(), false);
}
}
return bSuccess;
}
|
java
|
public boolean processServletCommand()
throws DBException
{
String strCommand = this.getProperty(DBParams.COMMAND); // Display record
if (strCommand == null)
strCommand = Constants.BLANK;
boolean bSuccess = false;
if (this.getScreenField() instanceof BasePanel)
{ // Always
if (strCommand.equalsIgnoreCase(ThinMenuConstants.FIRST))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.FIRST_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.PREVIOUS))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.PREVIOUS_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.NEXT))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.NEXT_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.LAST))
bSuccess = ((BasePanel)this.getScreenField()).onMove(DBConstants.LAST_RECORD);
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.SUBMIT))
bSuccess = ((BasePanel)this.getScreenField()).onAdd();
else if (strCommand.equalsIgnoreCase(ThinMenuConstants.DELETE))
bSuccess = ((BasePanel)this.getScreenField()).onDelete();
else
{ // Must have sent a user-defined command (send command to this screen)
bSuccess = false; // Too dangerous ((BasePanel)this.getScreenField()).handleCommand(strCommand, this.getScreenField(), false);
}
}
return bSuccess;
}
|
[
"public",
"boolean",
"processServletCommand",
"(",
")",
"throws",
"DBException",
"{",
"String",
"strCommand",
"=",
"this",
".",
"getProperty",
"(",
"DBParams",
".",
"COMMAND",
")",
";",
"// Display record",
"if",
"(",
"strCommand",
"==",
"null",
")",
"strCommand",
"=",
"Constants",
".",
"BLANK",
";",
"boolean",
"bSuccess",
"=",
"false",
";",
"if",
"(",
"this",
".",
"getScreenField",
"(",
")",
"instanceof",
"BasePanel",
")",
"{",
"// Always",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"ThinMenuConstants",
".",
"FIRST",
")",
")",
"bSuccess",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"onMove",
"(",
"DBConstants",
".",
"FIRST_RECORD",
")",
";",
"else",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"ThinMenuConstants",
".",
"PREVIOUS",
")",
")",
"bSuccess",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"onMove",
"(",
"DBConstants",
".",
"PREVIOUS_RECORD",
")",
";",
"else",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"ThinMenuConstants",
".",
"NEXT",
")",
")",
"bSuccess",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"onMove",
"(",
"DBConstants",
".",
"NEXT_RECORD",
")",
";",
"else",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"ThinMenuConstants",
".",
"LAST",
")",
")",
"bSuccess",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"onMove",
"(",
"DBConstants",
".",
"LAST_RECORD",
")",
";",
"else",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"ThinMenuConstants",
".",
"SUBMIT",
")",
")",
"bSuccess",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"onAdd",
"(",
")",
";",
"else",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"ThinMenuConstants",
".",
"DELETE",
")",
")",
"bSuccess",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"onDelete",
"(",
")",
";",
"else",
"{",
"// Must have sent a user-defined command (send command to this screen)",
"bSuccess",
"=",
"false",
";",
"// Too dangerous ((BasePanel)this.getScreenField()).handleCommand(strCommand, this.getScreenField(), false);",
"}",
"}",
"return",
"bSuccess",
";",
"}"
] |
Move the HTML input format to the fields and do the action requested.
@param bDefaultParamsFound If the params have been found yet.
@return true if input params have been found.
@exception DBException File exception.
|
[
"Move",
"the",
"HTML",
"input",
"format",
"to",
"the",
"fields",
"and",
"do",
"the",
"action",
"requested",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java#L158-L185
|
152,483
|
jbundle/jbundle
|
base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java
|
ZScreenField.getZmlImagePath
|
public String getZmlImagePath()
{
String strImage = null;
if (this.getScreenField().getConverter() != null)
if (this.getScreenField().getConverter().getField() != null)
if (!this.getScreenField().getConverter().getField().isNull())
{
BaseField field = (BaseField)this.getScreenField().getConverter().getField();
Record record = field.getRecord();
String strObjectID = null;
if ((record.getEditMode() == DBConstants.EDIT_CURRENT) || (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
{
try {
strObjectID = record.getHandle(DBConstants.OBJECT_ID_HANDLE).toString();
} catch (DBException ex) {
strObjectID = null;
}
}
if (strObjectID != null) if (strObjectID.length() > 0)
{
String strGraphicFormat = "jpg";
String strImageServlet = HtmlConstants.SERVLET_PATH + '/' + DBParams.IMAGE_PATH;
strImageServlet = Utility.addURLParam(strImageServlet, DBParams.DATATYPE, strGraphicFormat);
strImageServlet = Utility.addURLParam(strImageServlet, DBParams.RECORD, record.getClass().getName());
strImageServlet = Utility.addURLParam(strImageServlet, DBConstants.STRING_OBJECT_ID_HANDLE, strObjectID);
strImageServlet = Utility.addURLParam(strImageServlet, "field", field.getFieldName(false, false));
//? String strImageSize = "";
//+ strSize = " width=" + strWidth + " height=" + strHeight;
strImage = strImageServlet;
}
}
return strImage;
}
|
java
|
public String getZmlImagePath()
{
String strImage = null;
if (this.getScreenField().getConverter() != null)
if (this.getScreenField().getConverter().getField() != null)
if (!this.getScreenField().getConverter().getField().isNull())
{
BaseField field = (BaseField)this.getScreenField().getConverter().getField();
Record record = field.getRecord();
String strObjectID = null;
if ((record.getEditMode() == DBConstants.EDIT_CURRENT) || (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
{
try {
strObjectID = record.getHandle(DBConstants.OBJECT_ID_HANDLE).toString();
} catch (DBException ex) {
strObjectID = null;
}
}
if (strObjectID != null) if (strObjectID.length() > 0)
{
String strGraphicFormat = "jpg";
String strImageServlet = HtmlConstants.SERVLET_PATH + '/' + DBParams.IMAGE_PATH;
strImageServlet = Utility.addURLParam(strImageServlet, DBParams.DATATYPE, strGraphicFormat);
strImageServlet = Utility.addURLParam(strImageServlet, DBParams.RECORD, record.getClass().getName());
strImageServlet = Utility.addURLParam(strImageServlet, DBConstants.STRING_OBJECT_ID_HANDLE, strObjectID);
strImageServlet = Utility.addURLParam(strImageServlet, "field", field.getFieldName(false, false));
//? String strImageSize = "";
//+ strSize = " width=" + strWidth + " height=" + strHeight;
strImage = strImageServlet;
}
}
return strImage;
}
|
[
"public",
"String",
"getZmlImagePath",
"(",
")",
"{",
"String",
"strImage",
"=",
"null",
";",
"if",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
"!=",
"null",
")",
"if",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
"!=",
"null",
")",
"if",
"(",
"!",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
".",
"isNull",
"(",
")",
")",
"{",
"BaseField",
"field",
"=",
"(",
"BaseField",
")",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
";",
"Record",
"record",
"=",
"field",
".",
"getRecord",
"(",
")",
";",
"String",
"strObjectID",
"=",
"null",
";",
"if",
"(",
"(",
"record",
".",
"getEditMode",
"(",
")",
"==",
"DBConstants",
".",
"EDIT_CURRENT",
")",
"||",
"(",
"record",
".",
"getEditMode",
"(",
")",
"==",
"DBConstants",
".",
"EDIT_IN_PROGRESS",
")",
")",
"{",
"try",
"{",
"strObjectID",
"=",
"record",
".",
"getHandle",
"(",
"DBConstants",
".",
"OBJECT_ID_HANDLE",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"DBException",
"ex",
")",
"{",
"strObjectID",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"strObjectID",
"!=",
"null",
")",
"if",
"(",
"strObjectID",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"String",
"strGraphicFormat",
"=",
"\"jpg\"",
";",
"String",
"strImageServlet",
"=",
"HtmlConstants",
".",
"SERVLET_PATH",
"+",
"'",
"'",
"+",
"DBParams",
".",
"IMAGE_PATH",
";",
"strImageServlet",
"=",
"Utility",
".",
"addURLParam",
"(",
"strImageServlet",
",",
"DBParams",
".",
"DATATYPE",
",",
"strGraphicFormat",
")",
";",
"strImageServlet",
"=",
"Utility",
".",
"addURLParam",
"(",
"strImageServlet",
",",
"DBParams",
".",
"RECORD",
",",
"record",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"strImageServlet",
"=",
"Utility",
".",
"addURLParam",
"(",
"strImageServlet",
",",
"DBConstants",
".",
"STRING_OBJECT_ID_HANDLE",
",",
"strObjectID",
")",
";",
"strImageServlet",
"=",
"Utility",
".",
"addURLParam",
"(",
"strImageServlet",
",",
"\"field\"",
",",
"field",
".",
"getFieldName",
"(",
"false",
",",
"false",
")",
")",
";",
"//? String strImageSize = \"\";",
"//+ strSize = \" width=\" + strWidth + \" height=\" + strHeight;",
"strImage",
"=",
"strImageServlet",
";",
"}",
"}",
"return",
"strImage",
";",
"}"
] |
Get the path to the image in this control.
@return
|
[
"Get",
"the",
"path",
"to",
"the",
"image",
"in",
"this",
"control",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java#L232-L264
|
152,484
|
jbundle/jbundle
|
base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java
|
ZScreenField.getDefaultFormsParam
|
public String getDefaultFormsParam()
{
if (this.getScreenField().getParentScreen() != null)
return ((ZScreenField)this.getScreenField().getParentScreen().getScreenFieldView()).getDefaultFormsParam();
else
return null;
}
|
java
|
public String getDefaultFormsParam()
{
if (this.getScreenField().getParentScreen() != null)
return ((ZScreenField)this.getScreenField().getParentScreen().getScreenFieldView()).getDefaultFormsParam();
else
return null;
}
|
[
"public",
"String",
"getDefaultFormsParam",
"(",
")",
"{",
"if",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getParentScreen",
"(",
")",
"!=",
"null",
")",
"return",
"(",
"(",
"ZScreenField",
")",
"this",
".",
"getScreenField",
"(",
")",
".",
"getParentScreen",
"(",
")",
".",
"getScreenFieldView",
"(",
")",
")",
".",
"getDefaultFormsParam",
"(",
")",
";",
"else",
"return",
"null",
";",
"}"
] |
Get the Forms param to be passed on submit.
@return The hidden "forms" param to be passed on submit (input/diplay/both/bothifdata).
|
[
"Get",
"the",
"Forms",
"param",
"to",
"be",
"passed",
"on",
"submit",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java#L358-L364
|
152,485
|
jbundle/jbundle
|
base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java
|
ZScreenField.getJnlpURL
|
public String getJnlpURL(String strJnlpURL, Map<String,Object> propApplet, Map<String,Object> properties)
{
String strBaseURL = (String)properties.get(DBParams.BASE_URL);
if (strBaseURL == null)
strBaseURL = DBConstants.BLANK;
else if ((!strBaseURL.startsWith("/")) && (!strBaseURL.startsWith("http:")))
strBaseURL = "//" + strBaseURL;
if (!strBaseURL.startsWith("http:"))
strBaseURL = "http:" + strBaseURL;
StringBuffer sbJnlpURL = new StringBuffer(strBaseURL);
if ((strJnlpURL == null) || (strJnlpURL.length() == 0))
strJnlpURL = DEFAULT_JNLP_URL;
sbJnlpURL.append(strJnlpURL);
sbJnlpURL.append("&" + DBParams.APPLET + "=" + propApplet.get(DBParams.APPLET));
try {
for (Map.Entry<String,Object> entry : properties.entrySet())
{
String strKey = entry.getKey();
Object objValue = entry.getValue();
String strValue = null;
if (objValue != null)
strValue = objValue.toString();
if (strValue != null)
//x if (strValue.length() > 0)
sbJnlpURL.append("&" + strKey + "=" + URLEncoder.encode(strValue, DBConstants.URL_ENCODING));
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return sbJnlpURL.toString();
}
|
java
|
public String getJnlpURL(String strJnlpURL, Map<String,Object> propApplet, Map<String,Object> properties)
{
String strBaseURL = (String)properties.get(DBParams.BASE_URL);
if (strBaseURL == null)
strBaseURL = DBConstants.BLANK;
else if ((!strBaseURL.startsWith("/")) && (!strBaseURL.startsWith("http:")))
strBaseURL = "//" + strBaseURL;
if (!strBaseURL.startsWith("http:"))
strBaseURL = "http:" + strBaseURL;
StringBuffer sbJnlpURL = new StringBuffer(strBaseURL);
if ((strJnlpURL == null) || (strJnlpURL.length() == 0))
strJnlpURL = DEFAULT_JNLP_URL;
sbJnlpURL.append(strJnlpURL);
sbJnlpURL.append("&" + DBParams.APPLET + "=" + propApplet.get(DBParams.APPLET));
try {
for (Map.Entry<String,Object> entry : properties.entrySet())
{
String strKey = entry.getKey();
Object objValue = entry.getValue();
String strValue = null;
if (objValue != null)
strValue = objValue.toString();
if (strValue != null)
//x if (strValue.length() > 0)
sbJnlpURL.append("&" + strKey + "=" + URLEncoder.encode(strValue, DBConstants.URL_ENCODING));
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return sbJnlpURL.toString();
}
|
[
"public",
"String",
"getJnlpURL",
"(",
"String",
"strJnlpURL",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"propApplet",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strBaseURL",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBParams",
".",
"BASE_URL",
")",
";",
"if",
"(",
"strBaseURL",
"==",
"null",
")",
"strBaseURL",
"=",
"DBConstants",
".",
"BLANK",
";",
"else",
"if",
"(",
"(",
"!",
"strBaseURL",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"&&",
"(",
"!",
"strBaseURL",
".",
"startsWith",
"(",
"\"http:\"",
")",
")",
")",
"strBaseURL",
"=",
"\"//\"",
"+",
"strBaseURL",
";",
"if",
"(",
"!",
"strBaseURL",
".",
"startsWith",
"(",
"\"http:\"",
")",
")",
"strBaseURL",
"=",
"\"http:\"",
"+",
"strBaseURL",
";",
"StringBuffer",
"sbJnlpURL",
"=",
"new",
"StringBuffer",
"(",
"strBaseURL",
")",
";",
"if",
"(",
"(",
"strJnlpURL",
"==",
"null",
")",
"||",
"(",
"strJnlpURL",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"strJnlpURL",
"=",
"DEFAULT_JNLP_URL",
";",
"sbJnlpURL",
".",
"append",
"(",
"strJnlpURL",
")",
";",
"sbJnlpURL",
".",
"append",
"(",
"\"&\"",
"+",
"DBParams",
".",
"APPLET",
"+",
"\"=\"",
"+",
"propApplet",
".",
"get",
"(",
"DBParams",
".",
"APPLET",
")",
")",
";",
"try",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"properties",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"strKey",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"Object",
"objValue",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"String",
"strValue",
"=",
"null",
";",
"if",
"(",
"objValue",
"!=",
"null",
")",
"strValue",
"=",
"objValue",
".",
"toString",
"(",
")",
";",
"if",
"(",
"strValue",
"!=",
"null",
")",
"//x if (strValue.length() > 0)",
"sbJnlpURL",
".",
"append",
"(",
"\"&\"",
"+",
"strKey",
"+",
"\"=\"",
"+",
"URLEncoder",
".",
"encode",
"(",
"strValue",
",",
"DBConstants",
".",
"URL_ENCODING",
")",
")",
";",
"}",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"return",
"sbJnlpURL",
".",
"toString",
"(",
")",
";",
"}"
] |
Create a URL to retrieve the JNLP file.
@param propApplet
@param properties
@return
|
[
"Create",
"a",
"URL",
"to",
"retrieve",
"the",
"JNLP",
"file",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java#L428-L460
|
152,486
|
Stratio/stratio-connector-commons
|
connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java
|
SelectorHelper.getValue
|
public static <T> T getValue(Class<T> type, Selector selector) throws ExecutionException {
return convert(getValue(selector), type);
}
|
java
|
public static <T> T getValue(Class<T> type, Selector selector) throws ExecutionException {
return convert(getValue(selector), type);
}
|
[
"public",
"static",
"<",
"T",
">",
"T",
"getValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Selector",
"selector",
")",
"throws",
"ExecutionException",
"{",
"return",
"convert",
"(",
"getValue",
"(",
"selector",
")",
",",
"type",
")",
";",
"}"
] |
Return the selector value represents in the type class.
@param type the type in witch the value will be return.
@param selector the selector.
@return the type value.
@throws ExecutionException if an error happens.
|
[
"Return",
"the",
"selector",
"value",
"represents",
"in",
"the",
"type",
"class",
"."
] |
d7cc66cb9591344a13055962e87a91f01c3707d1
|
https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java#L53-L56
|
152,487
|
Stratio/stratio-connector-commons
|
connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java
|
SelectorHelper.getRestrictedValue
|
public static Object getRestrictedValue(Selector selector, SelectorType type) throws ExecutionException {
Object field = null;
if (type != null && selector.getType() != type) {
throw new ExecutionException("The selector type expected is: " + type + " but received: "
+ selector.getType());
}
switch (selector.getType()) {
case COLUMN:
field = ((ColumnSelector) selector).getName().getName();
break;
case BOOLEAN:
field = ((BooleanSelector) selector).getValue();
break;
case STRING:
field = ((StringSelector) selector).getValue();
break;
case INTEGER:
field = ((IntegerSelector) selector).getValue();
break;
case FLOATING_POINT:
field = ((FloatingPointSelector) selector).getValue();
break;
case GROUP:
field = getRestrictedValue(((GroupSelector) selector).getFirstValue(), null);
break;
case LIST:
if (((ListSelector) selector).getSelectorsList().isEmpty()){
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
field = getRestrictedValue(((ListSelector)selector).getSelectorsList().get(0), null);
break;
default:
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
return field;
}
|
java
|
public static Object getRestrictedValue(Selector selector, SelectorType type) throws ExecutionException {
Object field = null;
if (type != null && selector.getType() != type) {
throw new ExecutionException("The selector type expected is: " + type + " but received: "
+ selector.getType());
}
switch (selector.getType()) {
case COLUMN:
field = ((ColumnSelector) selector).getName().getName();
break;
case BOOLEAN:
field = ((BooleanSelector) selector).getValue();
break;
case STRING:
field = ((StringSelector) selector).getValue();
break;
case INTEGER:
field = ((IntegerSelector) selector).getValue();
break;
case FLOATING_POINT:
field = ((FloatingPointSelector) selector).getValue();
break;
case GROUP:
field = getRestrictedValue(((GroupSelector) selector).getFirstValue(), null);
break;
case LIST:
if (((ListSelector) selector).getSelectorsList().isEmpty()){
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
field = getRestrictedValue(((ListSelector)selector).getSelectorsList().get(0), null);
break;
default:
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
return field;
}
|
[
"public",
"static",
"Object",
"getRestrictedValue",
"(",
"Selector",
"selector",
",",
"SelectorType",
"type",
")",
"throws",
"ExecutionException",
"{",
"Object",
"field",
"=",
"null",
";",
"if",
"(",
"type",
"!=",
"null",
"&&",
"selector",
".",
"getType",
"(",
")",
"!=",
"type",
")",
"{",
"throw",
"new",
"ExecutionException",
"(",
"\"The selector type expected is: \"",
"+",
"type",
"+",
"\" but received: \"",
"+",
"selector",
".",
"getType",
"(",
")",
")",
";",
"}",
"switch",
"(",
"selector",
".",
"getType",
"(",
")",
")",
"{",
"case",
"COLUMN",
":",
"field",
"=",
"(",
"(",
"ColumnSelector",
")",
"selector",
")",
".",
"getName",
"(",
")",
".",
"getName",
"(",
")",
";",
"break",
";",
"case",
"BOOLEAN",
":",
"field",
"=",
"(",
"(",
"BooleanSelector",
")",
"selector",
")",
".",
"getValue",
"(",
")",
";",
"break",
";",
"case",
"STRING",
":",
"field",
"=",
"(",
"(",
"StringSelector",
")",
"selector",
")",
".",
"getValue",
"(",
")",
";",
"break",
";",
"case",
"INTEGER",
":",
"field",
"=",
"(",
"(",
"IntegerSelector",
")",
"selector",
")",
".",
"getValue",
"(",
")",
";",
"break",
";",
"case",
"FLOATING_POINT",
":",
"field",
"=",
"(",
"(",
"FloatingPointSelector",
")",
"selector",
")",
".",
"getValue",
"(",
")",
";",
"break",
";",
"case",
"GROUP",
":",
"field",
"=",
"getRestrictedValue",
"(",
"(",
"(",
"GroupSelector",
")",
"selector",
")",
".",
"getFirstValue",
"(",
")",
",",
"null",
")",
";",
"break",
";",
"case",
"LIST",
":",
"if",
"(",
"(",
"(",
"ListSelector",
")",
"selector",
")",
".",
"getSelectorsList",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ExecutionException",
"(",
"\"Selector \"",
"+",
"selector",
".",
"getType",
"(",
")",
"+",
"\" not supported get value operation.\"",
")",
";",
"}",
"field",
"=",
"getRestrictedValue",
"(",
"(",
"(",
"ListSelector",
")",
"selector",
")",
".",
"getSelectorsList",
"(",
")",
".",
"get",
"(",
"0",
")",
",",
"null",
")",
";",
"break",
";",
"default",
":",
"throw",
"new",
"ExecutionException",
"(",
"\"Selector \"",
"+",
"selector",
".",
"getType",
"(",
")",
"+",
"\" not supported get value operation.\"",
")",
";",
"}",
"return",
"field",
";",
"}"
] |
Return the selector value only if the type matches with the specified value.
@param selector the selector.
@param type the type of the expected selector
@return the corresponding value or null if the selector type does not match.
@throws ExecutionException if an error happens.
|
[
"Return",
"the",
"selector",
"value",
"only",
"if",
"the",
"type",
"matches",
"with",
"the",
"specified",
"value",
"."
] |
d7cc66cb9591344a13055962e87a91f01c3707d1
|
https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java#L78-L118
|
152,488
|
Stratio/stratio-connector-commons
|
connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java
|
SelectorHelper.getClass
|
public static Class getClass(Selector selector) throws ExecutionException {
Class returnClass = null;
switch (selector.getType()) {
case STRING:
case COLUMN:
returnClass = String.class;
break;
case BOOLEAN:
returnClass = Boolean.class;
break;
case INTEGER:
returnClass = Long.class;
break;
case FLOATING_POINT:
returnClass = Double.class;
break;
case GROUP:
returnClass = getClass(((GroupSelector) selector).getFirstValue());
break;
case LIST:
if (((ListSelector) selector).getSelectorsList().isEmpty()){
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
returnClass = getClass(((ListSelector) selector).getSelectorsList().get(0));
break;
default:
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
return returnClass;
}
|
java
|
public static Class getClass(Selector selector) throws ExecutionException {
Class returnClass = null;
switch (selector.getType()) {
case STRING:
case COLUMN:
returnClass = String.class;
break;
case BOOLEAN:
returnClass = Boolean.class;
break;
case INTEGER:
returnClass = Long.class;
break;
case FLOATING_POINT:
returnClass = Double.class;
break;
case GROUP:
returnClass = getClass(((GroupSelector) selector).getFirstValue());
break;
case LIST:
if (((ListSelector) selector).getSelectorsList().isEmpty()){
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
returnClass = getClass(((ListSelector) selector).getSelectorsList().get(0));
break;
default:
throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation.");
}
return returnClass;
}
|
[
"public",
"static",
"Class",
"getClass",
"(",
"Selector",
"selector",
")",
"throws",
"ExecutionException",
"{",
"Class",
"returnClass",
"=",
"null",
";",
"switch",
"(",
"selector",
".",
"getType",
"(",
")",
")",
"{",
"case",
"STRING",
":",
"case",
"COLUMN",
":",
"returnClass",
"=",
"String",
".",
"class",
";",
"break",
";",
"case",
"BOOLEAN",
":",
"returnClass",
"=",
"Boolean",
".",
"class",
";",
"break",
";",
"case",
"INTEGER",
":",
"returnClass",
"=",
"Long",
".",
"class",
";",
"break",
";",
"case",
"FLOATING_POINT",
":",
"returnClass",
"=",
"Double",
".",
"class",
";",
"break",
";",
"case",
"GROUP",
":",
"returnClass",
"=",
"getClass",
"(",
"(",
"(",
"GroupSelector",
")",
"selector",
")",
".",
"getFirstValue",
"(",
")",
")",
";",
"break",
";",
"case",
"LIST",
":",
"if",
"(",
"(",
"(",
"ListSelector",
")",
"selector",
")",
".",
"getSelectorsList",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ExecutionException",
"(",
"\"Selector \"",
"+",
"selector",
".",
"getType",
"(",
")",
"+",
"\" not supported get value operation.\"",
")",
";",
"}",
"returnClass",
"=",
"getClass",
"(",
"(",
"(",
"ListSelector",
")",
"selector",
")",
".",
"getSelectorsList",
"(",
")",
".",
"get",
"(",
"0",
")",
")",
";",
"break",
";",
"default",
":",
"throw",
"new",
"ExecutionException",
"(",
"\"Selector \"",
"+",
"selector",
".",
"getType",
"(",
")",
"+",
"\" not supported get value operation.\"",
")",
";",
"}",
"return",
"returnClass",
";",
"}"
] |
Return the selector value class.
@param selector the selector.
@return the selector class.
@throws ExecutionException if an error happens.
|
[
"Return",
"the",
"selector",
"value",
"class",
"."
] |
d7cc66cb9591344a13055962e87a91f01c3707d1
|
https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java#L127-L157
|
152,489
|
jbundle/jbundle
|
thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/transport/BaseTransport.java
|
BaseTransport.setProperty
|
public void setProperty(String strProperty, String strValue)
{
if (strValue == null)
strValue = NULL;
if (strValue != null)
m_properties.setProperty(strProperty, strValue);
else
m_properties.remove(strProperty);
}
|
java
|
public void setProperty(String strProperty, String strValue)
{
if (strValue == null)
strValue = NULL;
if (strValue != null)
m_properties.setProperty(strProperty, strValue);
else
m_properties.remove(strProperty);
}
|
[
"public",
"void",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
")",
"{",
"if",
"(",
"strValue",
"==",
"null",
")",
"strValue",
"=",
"NULL",
";",
"if",
"(",
"strValue",
"!=",
"null",
")",
"m_properties",
".",
"setProperty",
"(",
"strProperty",
",",
"strValue",
")",
";",
"else",
"m_properties",
".",
"remove",
"(",
"strProperty",
")",
";",
"}"
] |
Set this comand property.
@param strParam The param name.
@param strValue The param value.
|
[
"Set",
"this",
"comand",
"property",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/transport/BaseTransport.java#L70-L78
|
152,490
|
AlexLandau/gdl-validation
|
src/main/java/net/alloyggp/griddle/generated/ParserHelper.java
|
ParserHelper.parse
|
@SuppressWarnings("unchecked")
public static List<TopLevelGdl> parse(Reader input) throws Exception {
try {
Scanner lexer = new GdlScanner(input);
SymbolFactory symbolFactory = new ComplexSymbolFactory();
Symbol result = new GdlParser(lexer, symbolFactory).parse();
return (List<TopLevelGdl>) result.value;
} finally {
input.close();
}
}
|
java
|
@SuppressWarnings("unchecked")
public static List<TopLevelGdl> parse(Reader input) throws Exception {
try {
Scanner lexer = new GdlScanner(input);
SymbolFactory symbolFactory = new ComplexSymbolFactory();
Symbol result = new GdlParser(lexer, symbolFactory).parse();
return (List<TopLevelGdl>) result.value;
} finally {
input.close();
}
}
|
[
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"TopLevelGdl",
">",
"parse",
"(",
"Reader",
"input",
")",
"throws",
"Exception",
"{",
"try",
"{",
"Scanner",
"lexer",
"=",
"new",
"GdlScanner",
"(",
"input",
")",
";",
"SymbolFactory",
"symbolFactory",
"=",
"new",
"ComplexSymbolFactory",
"(",
")",
";",
"Symbol",
"result",
"=",
"new",
"GdlParser",
"(",
"lexer",
",",
"symbolFactory",
")",
".",
"parse",
"(",
")",
";",
"return",
"(",
"List",
"<",
"TopLevelGdl",
">",
")",
"result",
".",
"value",
";",
"}",
"finally",
"{",
"input",
".",
"close",
"(",
")",
";",
"}",
"}"
] |
This consumes and closes the input.
|
[
"This",
"consumes",
"and",
"closes",
"the",
"input",
"."
] |
ec87cc9fdd8af32d79aa7d130b7cb062f29834fb
|
https://github.com/AlexLandau/gdl-validation/blob/ec87cc9fdd8af32d79aa7d130b7cb062f29834fb/src/main/java/net/alloyggp/griddle/generated/ParserHelper.java#L26-L36
|
152,491
|
carewebframework/carewebframework-vista
|
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java
|
PollingThread.getRequest
|
private Request getRequest(Action action, BrokerSession session) {
switch (action) {
case QUERY:
if (query == null) {
query = new Request(action);
query.addParameter("UID", session.getId());
}
return query;
case PING:
if (ping == null) {
ping = new Request(action);
}
return ping;
default:
return null;
}
}
|
java
|
private Request getRequest(Action action, BrokerSession session) {
switch (action) {
case QUERY:
if (query == null) {
query = new Request(action);
query.addParameter("UID", session.getId());
}
return query;
case PING:
if (ping == null) {
ping = new Request(action);
}
return ping;
default:
return null;
}
}
|
[
"private",
"Request",
"getRequest",
"(",
"Action",
"action",
",",
"BrokerSession",
"session",
")",
"{",
"switch",
"(",
"action",
")",
"{",
"case",
"QUERY",
":",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"query",
"=",
"new",
"Request",
"(",
"action",
")",
";",
"query",
".",
"addParameter",
"(",
"\"UID\"",
",",
"session",
".",
"getId",
"(",
")",
")",
";",
"}",
"return",
"query",
";",
"case",
"PING",
":",
"if",
"(",
"ping",
"==",
"null",
")",
"{",
"ping",
"=",
"new",
"Request",
"(",
"action",
")",
";",
"}",
"return",
"ping",
";",
"default",
":",
"return",
"null",
";",
"}",
"}"
] |
Creates a request packet for the specified action.
@param action Action to perform.
@param session Session receiving the request.
@return The fully formed request.
|
[
"Creates",
"a",
"request",
"packet",
"for",
"the",
"specified",
"action",
"."
] |
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
|
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java#L129-L149
|
152,492
|
carewebframework/carewebframework-vista
|
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java
|
PollingThread.pollHost
|
private void pollHost(BrokerSession session) {
Request request = !enabled ? null : getRequest(session.pollingAction(), session);
if (request == null) {
return;
}
try {
Response response = session.netCall(request, 1000);
String results[] = response.getData().split(Constants.LINE_SEPARATOR, 2);
String params[] = StrUtil.split(results[0], StrUtil.U, 2);
switch (response.getResponseType()) {
case ACK: // A simple server acknowledgement
int i = StrUtil.toInt(params[0]);
if (i > 0) {
pollingInterval = i * 1000;
}
FMDate hostTime = new FMDate(params[1]);
session.setHostTime(hostTime);
break;
case ASYNC: // Completed asynchronous RPC
int asyncHandle = StrUtil.toInt(params[0]);
int asyncError = StrUtil.toInt(params[1]);
if (asyncHandle > 0) {
if (asyncError != 0) {
session.onRPCError(asyncHandle, asyncError, results[1]);
} else {
session.onRPCComplete(asyncHandle, results[1]);
}
}
break;
case EVENT: // Global event for delivery
List<IHostEventHandler> hostEventHandlers = session.getHostEventHandlers();
if (hostEventHandlers != null) {
try {
String eventName = results[0];
Object eventData = SerializationMethod.deserialize(results[1]);
for (IHostEventHandler hostEventHandler : hostEventHandlers) {
try {
hostEventHandler.onHostEvent(eventName, eventData);
} catch (Throwable e) {
log.error("Host event subscriber threw an exception", e);
}
}
} catch (Throwable e) {
log.error("Error processing host event", e);
}
}
break;
}
} catch (Throwable e) {
log.error("Error processing polling response.", e);
terminate();
}
}
|
java
|
private void pollHost(BrokerSession session) {
Request request = !enabled ? null : getRequest(session.pollingAction(), session);
if (request == null) {
return;
}
try {
Response response = session.netCall(request, 1000);
String results[] = response.getData().split(Constants.LINE_SEPARATOR, 2);
String params[] = StrUtil.split(results[0], StrUtil.U, 2);
switch (response.getResponseType()) {
case ACK: // A simple server acknowledgement
int i = StrUtil.toInt(params[0]);
if (i > 0) {
pollingInterval = i * 1000;
}
FMDate hostTime = new FMDate(params[1]);
session.setHostTime(hostTime);
break;
case ASYNC: // Completed asynchronous RPC
int asyncHandle = StrUtil.toInt(params[0]);
int asyncError = StrUtil.toInt(params[1]);
if (asyncHandle > 0) {
if (asyncError != 0) {
session.onRPCError(asyncHandle, asyncError, results[1]);
} else {
session.onRPCComplete(asyncHandle, results[1]);
}
}
break;
case EVENT: // Global event for delivery
List<IHostEventHandler> hostEventHandlers = session.getHostEventHandlers();
if (hostEventHandlers != null) {
try {
String eventName = results[0];
Object eventData = SerializationMethod.deserialize(results[1]);
for (IHostEventHandler hostEventHandler : hostEventHandlers) {
try {
hostEventHandler.onHostEvent(eventName, eventData);
} catch (Throwable e) {
log.error("Host event subscriber threw an exception", e);
}
}
} catch (Throwable e) {
log.error("Error processing host event", e);
}
}
break;
}
} catch (Throwable e) {
log.error("Error processing polling response.", e);
terminate();
}
}
|
[
"private",
"void",
"pollHost",
"(",
"BrokerSession",
"session",
")",
"{",
"Request",
"request",
"=",
"!",
"enabled",
"?",
"null",
":",
"getRequest",
"(",
"session",
".",
"pollingAction",
"(",
")",
",",
"session",
")",
";",
"if",
"(",
"request",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"Response",
"response",
"=",
"session",
".",
"netCall",
"(",
"request",
",",
"1000",
")",
";",
"String",
"results",
"[",
"]",
"=",
"response",
".",
"getData",
"(",
")",
".",
"split",
"(",
"Constants",
".",
"LINE_SEPARATOR",
",",
"2",
")",
";",
"String",
"params",
"[",
"]",
"=",
"StrUtil",
".",
"split",
"(",
"results",
"[",
"0",
"]",
",",
"StrUtil",
".",
"U",
",",
"2",
")",
";",
"switch",
"(",
"response",
".",
"getResponseType",
"(",
")",
")",
"{",
"case",
"ACK",
":",
"// A simple server acknowledgement",
"int",
"i",
"=",
"StrUtil",
".",
"toInt",
"(",
"params",
"[",
"0",
"]",
")",
";",
"if",
"(",
"i",
">",
"0",
")",
"{",
"pollingInterval",
"=",
"i",
"*",
"1000",
";",
"}",
"FMDate",
"hostTime",
"=",
"new",
"FMDate",
"(",
"params",
"[",
"1",
"]",
")",
";",
"session",
".",
"setHostTime",
"(",
"hostTime",
")",
";",
"break",
";",
"case",
"ASYNC",
":",
"// Completed asynchronous RPC",
"int",
"asyncHandle",
"=",
"StrUtil",
".",
"toInt",
"(",
"params",
"[",
"0",
"]",
")",
";",
"int",
"asyncError",
"=",
"StrUtil",
".",
"toInt",
"(",
"params",
"[",
"1",
"]",
")",
";",
"if",
"(",
"asyncHandle",
">",
"0",
")",
"{",
"if",
"(",
"asyncError",
"!=",
"0",
")",
"{",
"session",
".",
"onRPCError",
"(",
"asyncHandle",
",",
"asyncError",
",",
"results",
"[",
"1",
"]",
")",
";",
"}",
"else",
"{",
"session",
".",
"onRPCComplete",
"(",
"asyncHandle",
",",
"results",
"[",
"1",
"]",
")",
";",
"}",
"}",
"break",
";",
"case",
"EVENT",
":",
"// Global event for delivery",
"List",
"<",
"IHostEventHandler",
">",
"hostEventHandlers",
"=",
"session",
".",
"getHostEventHandlers",
"(",
")",
";",
"if",
"(",
"hostEventHandlers",
"!=",
"null",
")",
"{",
"try",
"{",
"String",
"eventName",
"=",
"results",
"[",
"0",
"]",
";",
"Object",
"eventData",
"=",
"SerializationMethod",
".",
"deserialize",
"(",
"results",
"[",
"1",
"]",
")",
";",
"for",
"(",
"IHostEventHandler",
"hostEventHandler",
":",
"hostEventHandlers",
")",
"{",
"try",
"{",
"hostEventHandler",
".",
"onHostEvent",
"(",
"eventName",
",",
"eventData",
")",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"log",
".",
"error",
"(",
"\"Host event subscriber threw an exception\"",
",",
"e",
")",
";",
"}",
"}",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"log",
".",
"error",
"(",
"\"Error processing host event\"",
",",
"e",
")",
";",
"}",
"}",
"break",
";",
"}",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"log",
".",
"error",
"(",
"\"Error processing polling response.\"",
",",
"e",
")",
";",
"terminate",
"(",
")",
";",
"}",
"}"
] |
Polls the host at the specified interval for asynchronous activity.
@param session Session whose host is to be polled.
|
[
"Polls",
"the",
"host",
"at",
"the",
"specified",
"interval",
"for",
"asynchronous",
"activity",
"."
] |
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
|
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java#L156-L218
|
152,493
|
carewebframework/carewebframework-vista
|
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java
|
PollingThread.run
|
@Override
public void run() {
synchronized (monitor) {
while (!terminated) {
try {
BrokerSession session = this.sessionRef.get();
if (session == null) {
break;
} else {
pollHost(session);
}
session = null;
monitor.wait(pollingInterval);
} catch (InterruptedException e) {}
}
}
log.debug(getName() + " has exited.");
}
|
java
|
@Override
public void run() {
synchronized (monitor) {
while (!terminated) {
try {
BrokerSession session = this.sessionRef.get();
if (session == null) {
break;
} else {
pollHost(session);
}
session = null;
monitor.wait(pollingInterval);
} catch (InterruptedException e) {}
}
}
log.debug(getName() + " has exited.");
}
|
[
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"synchronized",
"(",
"monitor",
")",
"{",
"while",
"(",
"!",
"terminated",
")",
"{",
"try",
"{",
"BrokerSession",
"session",
"=",
"this",
".",
"sessionRef",
".",
"get",
"(",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"break",
";",
"}",
"else",
"{",
"pollHost",
"(",
"session",
")",
";",
"}",
"session",
"=",
"null",
";",
"monitor",
".",
"wait",
"(",
"pollingInterval",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"}",
"}",
"}",
"log",
".",
"debug",
"(",
"getName",
"(",
")",
"+",
"\" has exited.\"",
")",
";",
"}"
] |
Main polling loop.
|
[
"Main",
"polling",
"loop",
"."
] |
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
|
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java#L239-L258
|
152,494
|
glookast/commons-timecode
|
src/main/java/com/glookast/commons/timecode/MutableTimecodeDuration.java
|
MutableTimecodeDuration.valueOf
|
public static MutableTimecodeDuration valueOf(String timecode) throws IllegalArgumentException
{
MutableTimecodeDuration td = new MutableTimecodeDuration();
return (MutableTimecodeDuration) td.parse(timecode);
}
|
java
|
public static MutableTimecodeDuration valueOf(String timecode) throws IllegalArgumentException
{
MutableTimecodeDuration td = new MutableTimecodeDuration();
return (MutableTimecodeDuration) td.parse(timecode);
}
|
[
"public",
"static",
"MutableTimecodeDuration",
"valueOf",
"(",
"String",
"timecode",
")",
"throws",
"IllegalArgumentException",
"{",
"MutableTimecodeDuration",
"td",
"=",
"new",
"MutableTimecodeDuration",
"(",
")",
";",
"return",
"(",
"MutableTimecodeDuration",
")",
"td",
".",
"parse",
"(",
"timecode",
")",
";",
"}"
] |
Returns a UnmodifiableTimecodeDuration instance for given TimecodeDuration storage string. Will return null in case the storage string represents a null TimecodeDuration
@param timecode
@return the TimecodeDuration
@throws IllegalArgumentException
|
[
"Returns",
"a",
"UnmodifiableTimecodeDuration",
"instance",
"for",
"given",
"TimecodeDuration",
"storage",
"string",
".",
"Will",
"return",
"null",
"in",
"case",
"the",
"storage",
"string",
"represents",
"a",
"null",
"TimecodeDuration"
] |
ec2f682a51d1cc435d0b42d80de48ff15adb4ee8
|
https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/MutableTimecodeDuration.java#L60-L64
|
152,495
|
jbundle/jbundle
|
base/remote/src/main/java/org/jbundle/base/remote/db/Session.java
|
Session.getRemoteTable
|
public RemoteTable getRemoteTable(String strRecordName) throws RemoteException
{
if ((strRecordName == null) || (strRecordName.length() == 0))
strRecordName = this.getMainRecord().getTableNames(false); // Main Record
if (strRecordName.lastIndexOf('.') != -1) // Correct this if a class name is passed
strRecordName = strRecordName.substring(strRecordName.lastIndexOf('.') + 1);
Record record = this.getRecord(strRecordName);
if (record == null)
return null; // It must be one of this session's files
if (this instanceof TableSession)
{
if (this.getMainRecord() == record)
return (RemoteTable)this;
}
RemoteTable table = null;
for (int iIndex = 0; iIndex < this.getSessionObjectCount(); iIndex++)
{
BaseSession sessionObject = this.getSessionObjectAt(iIndex);
if (sessionObject instanceof TableSession)
{
if (sessionObject.getMainRecord() != null)
if (sessionObject.getMainRecord().getTableNames(false).equals(strRecordName))
return (RemoteTable)sessionObject;
}
}
// Not wrapped yet, wrap in a new TableSessionObject
try {
RecordOwner recordOwner = record.getRecordOwner();
boolean bMainQuery = false;
if (recordOwner != null)
if (record == recordOwner.getMainRecord())
bMainQuery = true;
table = new TableSession(this, record, null);
if (recordOwner != null)
if (bMainQuery)
{
recordOwner.addRecord(record, bMainQuery); // If the session wanted to access this record too, make sure it still can.
Utility.getLogger().info("Should not create a sub-session for the main record!"); // It is common to do this for thin sessions
}
} catch (Exception ex) {
table = null;
}
return table;
}
|
java
|
public RemoteTable getRemoteTable(String strRecordName) throws RemoteException
{
if ((strRecordName == null) || (strRecordName.length() == 0))
strRecordName = this.getMainRecord().getTableNames(false); // Main Record
if (strRecordName.lastIndexOf('.') != -1) // Correct this if a class name is passed
strRecordName = strRecordName.substring(strRecordName.lastIndexOf('.') + 1);
Record record = this.getRecord(strRecordName);
if (record == null)
return null; // It must be one of this session's files
if (this instanceof TableSession)
{
if (this.getMainRecord() == record)
return (RemoteTable)this;
}
RemoteTable table = null;
for (int iIndex = 0; iIndex < this.getSessionObjectCount(); iIndex++)
{
BaseSession sessionObject = this.getSessionObjectAt(iIndex);
if (sessionObject instanceof TableSession)
{
if (sessionObject.getMainRecord() != null)
if (sessionObject.getMainRecord().getTableNames(false).equals(strRecordName))
return (RemoteTable)sessionObject;
}
}
// Not wrapped yet, wrap in a new TableSessionObject
try {
RecordOwner recordOwner = record.getRecordOwner();
boolean bMainQuery = false;
if (recordOwner != null)
if (record == recordOwner.getMainRecord())
bMainQuery = true;
table = new TableSession(this, record, null);
if (recordOwner != null)
if (bMainQuery)
{
recordOwner.addRecord(record, bMainQuery); // If the session wanted to access this record too, make sure it still can.
Utility.getLogger().info("Should not create a sub-session for the main record!"); // It is common to do this for thin sessions
}
} catch (Exception ex) {
table = null;
}
return table;
}
|
[
"public",
"RemoteTable",
"getRemoteTable",
"(",
"String",
"strRecordName",
")",
"throws",
"RemoteException",
"{",
"if",
"(",
"(",
"strRecordName",
"==",
"null",
")",
"||",
"(",
"strRecordName",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"strRecordName",
"=",
"this",
".",
"getMainRecord",
"(",
")",
".",
"getTableNames",
"(",
"false",
")",
";",
"// Main Record",
"if",
"(",
"strRecordName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"// Correct this if a class name is passed",
"strRecordName",
"=",
"strRecordName",
".",
"substring",
"(",
"strRecordName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
";",
"Record",
"record",
"=",
"this",
".",
"getRecord",
"(",
"strRecordName",
")",
";",
"if",
"(",
"record",
"==",
"null",
")",
"return",
"null",
";",
"// It must be one of this session's files",
"if",
"(",
"this",
"instanceof",
"TableSession",
")",
"{",
"if",
"(",
"this",
".",
"getMainRecord",
"(",
")",
"==",
"record",
")",
"return",
"(",
"RemoteTable",
")",
"this",
";",
"}",
"RemoteTable",
"table",
"=",
"null",
";",
"for",
"(",
"int",
"iIndex",
"=",
"0",
";",
"iIndex",
"<",
"this",
".",
"getSessionObjectCount",
"(",
")",
";",
"iIndex",
"++",
")",
"{",
"BaseSession",
"sessionObject",
"=",
"this",
".",
"getSessionObjectAt",
"(",
"iIndex",
")",
";",
"if",
"(",
"sessionObject",
"instanceof",
"TableSession",
")",
"{",
"if",
"(",
"sessionObject",
".",
"getMainRecord",
"(",
")",
"!=",
"null",
")",
"if",
"(",
"sessionObject",
".",
"getMainRecord",
"(",
")",
".",
"getTableNames",
"(",
"false",
")",
".",
"equals",
"(",
"strRecordName",
")",
")",
"return",
"(",
"RemoteTable",
")",
"sessionObject",
";",
"}",
"}",
"// Not wrapped yet, wrap in a new TableSessionObject",
"try",
"{",
"RecordOwner",
"recordOwner",
"=",
"record",
".",
"getRecordOwner",
"(",
")",
";",
"boolean",
"bMainQuery",
"=",
"false",
";",
"if",
"(",
"recordOwner",
"!=",
"null",
")",
"if",
"(",
"record",
"==",
"recordOwner",
".",
"getMainRecord",
"(",
")",
")",
"bMainQuery",
"=",
"true",
";",
"table",
"=",
"new",
"TableSession",
"(",
"this",
",",
"record",
",",
"null",
")",
";",
"if",
"(",
"recordOwner",
"!=",
"null",
")",
"if",
"(",
"bMainQuery",
")",
"{",
"recordOwner",
".",
"addRecord",
"(",
"record",
",",
"bMainQuery",
")",
";",
"// If the session wanted to access this record too, make sure it still can.",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"Should not create a sub-session for the main record!\"",
")",
";",
"// It is common to do this for thin sessions",
"}",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"table",
"=",
"null",
";",
"}",
"return",
"table",
";",
"}"
] |
Get the remote table for this session.
@param strRecordName Table Name or Class Name of the record to find
Note: This method is used when the SessionObject is used as an application's remote peer.
|
[
"Get",
"the",
"remote",
"table",
"for",
"this",
"session",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/Session.java#L101-L144
|
152,496
|
jbundle/jbundle
|
base/remote/src/main/java/org/jbundle/base/remote/db/Session.java
|
Session.setupRemoteFilter
|
public BaseMessageFilter setupRemoteFilter(BaseMessageFilter messageFilter)
{
Map<String,Object> propertiesForFilter = messageFilter.getProperties();
if (propertiesForFilter != null)
{
String strClassName = (String)propertiesForFilter.get(MessageConstants.CLASS_NAME);
if (strClassName != null)
{
if (strClassName.indexOf(MessageConstants.GRID_FILTER) != -1)
{
Record record = this.getMainRecord();
if (record != null)
messageFilter = new GridRecordMessageFilter(record, null, true);
messageFilter.setMessageSource(null); // Since this filter auto sets the source
}
else if (strClassName.indexOf(MessageConstants.RECORD_FILTER) != -1)
{
Record record = this.getMainRecord();
if (record != null)
messageFilter = new RecordMessageFilter(record, null);
messageFilter.setMessageSource(null);
}
else
{
BaseMessageFilter newMessageFilter = (BaseMessageFilter)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName);
if (newMessageFilter != null)
newMessageFilter.init(messageFilter.getQueueName(), messageFilter.getQueueType(), null, null);
if (newMessageFilter != null)
messageFilter = newMessageFilter;
}
}
}
return messageFilter; // By default, don't change
}
|
java
|
public BaseMessageFilter setupRemoteFilter(BaseMessageFilter messageFilter)
{
Map<String,Object> propertiesForFilter = messageFilter.getProperties();
if (propertiesForFilter != null)
{
String strClassName = (String)propertiesForFilter.get(MessageConstants.CLASS_NAME);
if (strClassName != null)
{
if (strClassName.indexOf(MessageConstants.GRID_FILTER) != -1)
{
Record record = this.getMainRecord();
if (record != null)
messageFilter = new GridRecordMessageFilter(record, null, true);
messageFilter.setMessageSource(null); // Since this filter auto sets the source
}
else if (strClassName.indexOf(MessageConstants.RECORD_FILTER) != -1)
{
Record record = this.getMainRecord();
if (record != null)
messageFilter = new RecordMessageFilter(record, null);
messageFilter.setMessageSource(null);
}
else
{
BaseMessageFilter newMessageFilter = (BaseMessageFilter)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName);
if (newMessageFilter != null)
newMessageFilter.init(messageFilter.getQueueName(), messageFilter.getQueueType(), null, null);
if (newMessageFilter != null)
messageFilter = newMessageFilter;
}
}
}
return messageFilter; // By default, don't change
}
|
[
"public",
"BaseMessageFilter",
"setupRemoteFilter",
"(",
"BaseMessageFilter",
"messageFilter",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"propertiesForFilter",
"=",
"messageFilter",
".",
"getProperties",
"(",
")",
";",
"if",
"(",
"propertiesForFilter",
"!=",
"null",
")",
"{",
"String",
"strClassName",
"=",
"(",
"String",
")",
"propertiesForFilter",
".",
"get",
"(",
"MessageConstants",
".",
"CLASS_NAME",
")",
";",
"if",
"(",
"strClassName",
"!=",
"null",
")",
"{",
"if",
"(",
"strClassName",
".",
"indexOf",
"(",
"MessageConstants",
".",
"GRID_FILTER",
")",
"!=",
"-",
"1",
")",
"{",
"Record",
"record",
"=",
"this",
".",
"getMainRecord",
"(",
")",
";",
"if",
"(",
"record",
"!=",
"null",
")",
"messageFilter",
"=",
"new",
"GridRecordMessageFilter",
"(",
"record",
",",
"null",
",",
"true",
")",
";",
"messageFilter",
".",
"setMessageSource",
"(",
"null",
")",
";",
"// Since this filter auto sets the source",
"}",
"else",
"if",
"(",
"strClassName",
".",
"indexOf",
"(",
"MessageConstants",
".",
"RECORD_FILTER",
")",
"!=",
"-",
"1",
")",
"{",
"Record",
"record",
"=",
"this",
".",
"getMainRecord",
"(",
")",
";",
"if",
"(",
"record",
"!=",
"null",
")",
"messageFilter",
"=",
"new",
"RecordMessageFilter",
"(",
"record",
",",
"null",
")",
";",
"messageFilter",
".",
"setMessageSource",
"(",
"null",
")",
";",
"}",
"else",
"{",
"BaseMessageFilter",
"newMessageFilter",
"=",
"(",
"BaseMessageFilter",
")",
"ClassServiceUtility",
".",
"getClassService",
"(",
")",
".",
"makeObjectFromClassName",
"(",
"strClassName",
")",
";",
"if",
"(",
"newMessageFilter",
"!=",
"null",
")",
"newMessageFilter",
".",
"init",
"(",
"messageFilter",
".",
"getQueueName",
"(",
")",
",",
"messageFilter",
".",
"getQueueType",
"(",
")",
",",
"null",
",",
"null",
")",
";",
"if",
"(",
"newMessageFilter",
"!=",
"null",
")",
"messageFilter",
"=",
"newMessageFilter",
";",
"}",
"}",
"}",
"return",
"messageFilter",
";",
"// By default, don't change",
"}"
] |
Give a copy of the message filter, set up a remote filter.
@oaram messageFilter The message filter to setup (in relation to this class).
@return The same message filter.
|
[
"Give",
"a",
"copy",
"of",
"the",
"message",
"filter",
"set",
"up",
"a",
"remote",
"filter",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/Session.java#L183-L216
|
152,497
|
jbundle/jbundle
|
thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java
|
MessageReceiverFilterList.addMessageFilter
|
public void addMessageFilter(BaseMessageFilter messageFilter)
{
if (messageFilter == null)
return;
m_mapFilters.put(m_intNext, messageFilter);
messageFilter.setMessageReceiver(this.getMessageReceiver(), m_intNext);
int i = m_intNext.intValue();
if (i == Integer.MAX_VALUE)
i = 0;
m_intNext = new Integer(i + 1);
}
|
java
|
public void addMessageFilter(BaseMessageFilter messageFilter)
{
if (messageFilter == null)
return;
m_mapFilters.put(m_intNext, messageFilter);
messageFilter.setMessageReceiver(this.getMessageReceiver(), m_intNext);
int i = m_intNext.intValue();
if (i == Integer.MAX_VALUE)
i = 0;
m_intNext = new Integer(i + 1);
}
|
[
"public",
"void",
"addMessageFilter",
"(",
"BaseMessageFilter",
"messageFilter",
")",
"{",
"if",
"(",
"messageFilter",
"==",
"null",
")",
"return",
";",
"m_mapFilters",
".",
"put",
"(",
"m_intNext",
",",
"messageFilter",
")",
";",
"messageFilter",
".",
"setMessageReceiver",
"(",
"this",
".",
"getMessageReceiver",
"(",
")",
",",
"m_intNext",
")",
";",
"int",
"i",
"=",
"m_intNext",
".",
"intValue",
"(",
")",
";",
"if",
"(",
"i",
"==",
"Integer",
".",
"MAX_VALUE",
")",
"i",
"=",
"0",
";",
"m_intNext",
"=",
"new",
"Integer",
"(",
"i",
"+",
"1",
")",
";",
"}"
] |
Add this message filter to this receive queue.
@param The message filter to add.
|
[
"Add",
"this",
"message",
"filter",
"to",
"this",
"receive",
"queue",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java#L139-L149
|
152,498
|
jbundle/jbundle
|
thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java
|
MessageReceiverFilterList.findMessageFilter
|
public BaseMessageFilter findMessageFilter(JMessageListener listener)
{
Iterator<BaseMessageFilter> iterator = m_mapFilters.values().iterator();
while (iterator.hasNext())
{
BaseMessageFilter filter = iterator.next();
for (int i = 0; (filter.getMessageListener(i) != null); i++)
{
if (filter.getMessageListener(i) == listener)
return filter;
}
}
return null; // Error, not found.
}
|
java
|
public BaseMessageFilter findMessageFilter(JMessageListener listener)
{
Iterator<BaseMessageFilter> iterator = m_mapFilters.values().iterator();
while (iterator.hasNext())
{
BaseMessageFilter filter = iterator.next();
for (int i = 0; (filter.getMessageListener(i) != null); i++)
{
if (filter.getMessageListener(i) == listener)
return filter;
}
}
return null; // Error, not found.
}
|
[
"public",
"BaseMessageFilter",
"findMessageFilter",
"(",
"JMessageListener",
"listener",
")",
"{",
"Iterator",
"<",
"BaseMessageFilter",
">",
"iterator",
"=",
"m_mapFilters",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"BaseMessageFilter",
"filter",
"=",
"iterator",
".",
"next",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"(",
"filter",
".",
"getMessageListener",
"(",
"i",
")",
"!=",
"null",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"filter",
".",
"getMessageListener",
"(",
"i",
")",
"==",
"listener",
")",
"return",
"filter",
";",
"}",
"}",
"return",
"null",
";",
"// Error, not found.",
"}"
] |
Lookup this message listener.
This message looks through my list to see if the listener's filter is there.
@param listener The listener to find.
@return The filter for this listener (or null if not found).
|
[
"Lookup",
"this",
"message",
"listener",
".",
"This",
"message",
"looks",
"through",
"my",
"list",
"to",
"see",
"if",
"the",
"listener",
"s",
"filter",
"is",
"there",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/MessageReceiverFilterList.java#L199-L212
|
152,499
|
jbundle/jbundle
|
base/db/jdbc/src/main/java/org/jbundle/base/db/jdbc/service/JdbcBundleActivator.java
|
JdbcBundleActivator.start
|
public void start(BundleContext context) throws Exception {
Util.getLogger().info("Starting Jdbc bundle");
//xthis.setProperty(BundleActivatorModel.PACKAGE_NAME, Util.getPackageName(JdbcDatabase.class.getName()));
//x this.setProperty(BundleService.INTERFACE, BaseDatabase.class.getName());
this.setProperty(BundleConstants.TYPE, DBParams.JDBC);
super.start(context);
}
|
java
|
public void start(BundleContext context) throws Exception {
Util.getLogger().info("Starting Jdbc bundle");
//xthis.setProperty(BundleActivatorModel.PACKAGE_NAME, Util.getPackageName(JdbcDatabase.class.getName()));
//x this.setProperty(BundleService.INTERFACE, BaseDatabase.class.getName());
this.setProperty(BundleConstants.TYPE, DBParams.JDBC);
super.start(context);
}
|
[
"public",
"void",
"start",
"(",
"BundleContext",
"context",
")",
"throws",
"Exception",
"{",
"Util",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"Starting Jdbc bundle\"",
")",
";",
"//xthis.setProperty(BundleActivatorModel.PACKAGE_NAME, Util.getPackageName(JdbcDatabase.class.getName()));",
"//x this.setProperty(BundleService.INTERFACE, BaseDatabase.class.getName());",
"this",
".",
"setProperty",
"(",
"BundleConstants",
".",
"TYPE",
",",
"DBParams",
".",
"JDBC",
")",
";",
"super",
".",
"start",
"(",
"context",
")",
";",
"}"
] |
Bundle starting up.
|
[
"Bundle",
"starting",
"up",
"."
] |
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
|
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/jdbc/src/main/java/org/jbundle/base/db/jdbc/service/JdbcBundleActivator.java#L25-L33
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.