repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
j256/ormlite-jdbc | src/main/java/com/j256/ormlite/jdbc/JdbcConnectionSource.java | JdbcConnectionSource.makeConnection | @SuppressWarnings("resource")
protected DatabaseConnection makeConnection(Logger logger) throws SQLException {
Properties properties = new Properties();
if (username != null) {
properties.setProperty("user", username);
}
if (password != null) {
properties.setProperty("password", password);
}
Database... | java | @SuppressWarnings("resource")
protected DatabaseConnection makeConnection(Logger logger) throws SQLException {
Properties properties = new Properties();
if (username != null) {
properties.setProperty("user", username);
}
if (password != null) {
properties.setProperty("password", password);
}
Database... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"protected",
"DatabaseConnection",
"makeConnection",
"(",
"Logger",
"logger",
")",
"throws",
"SQLException",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"if",
"(",
"username",
"!=",
... | Make a connection to the database.
@param logger
This is here so we can use the right logger associated with the sub-class. | [
"Make",
"a",
"connection",
"to",
"the",
"database",
"."
] | a5ce794ce34bce7000730ebe8e15f3fb3a8a5381 | https://github.com/j256/ormlite-jdbc/blob/a5ce794ce34bce7000730ebe8e15f3fb3a8a5381/src/main/java/com/j256/ormlite/jdbc/JdbcConnectionSource.java#L257-L274 | train |
j256/ormlite-jdbc | src/main/java/com/j256/ormlite/spring/TableCreator.java | TableCreator.initialize | public void initialize() throws SQLException {
if (!Boolean.parseBoolean(System.getProperty(AUTO_CREATE_TABLES))) {
return;
}
if (configuredDaos == null) {
throw new SQLException("configuredDaos was not set in " + getClass().getSimpleName());
}
// find all of the daos and create the tables
for (Dao<... | java | public void initialize() throws SQLException {
if (!Boolean.parseBoolean(System.getProperty(AUTO_CREATE_TABLES))) {
return;
}
if (configuredDaos == null) {
throw new SQLException("configuredDaos was not set in " + getClass().getSimpleName());
}
// find all of the daos and create the tables
for (Dao<... | [
"public",
"void",
"initialize",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"Boolean",
".",
"parseBoolean",
"(",
"System",
".",
"getProperty",
"(",
"AUTO_CREATE_TABLES",
")",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"configuredDaos",
"=="... | If you are using the Spring type wiring, this should be called after all of the set methods. | [
"If",
"you",
"are",
"using",
"the",
"Spring",
"type",
"wiring",
"this",
"should",
"be",
"called",
"after",
"all",
"of",
"the",
"set",
"methods",
"."
] | a5ce794ce34bce7000730ebe8e15f3fb3a8a5381 | https://github.com/j256/ormlite-jdbc/blob/a5ce794ce34bce7000730ebe8e15f3fb3a8a5381/src/main/java/com/j256/ormlite/spring/TableCreator.java#L71-L99 | train |
j256/ormlite-jdbc | src/main/java/com/j256/ormlite/jdbc/JdbcDatabaseConnection.java | JdbcDatabaseConnection.getIdColumnData | private Number getIdColumnData(ResultSet resultSet, ResultSetMetaData metaData, int columnIndex)
throws SQLException {
int typeVal = metaData.getColumnType(columnIndex);
switch (typeVal) {
case Types.BIGINT:
case Types.DECIMAL:
case Types.NUMERIC:
return (Number) resultSet.getLong(columnIndex);
c... | java | private Number getIdColumnData(ResultSet resultSet, ResultSetMetaData metaData, int columnIndex)
throws SQLException {
int typeVal = metaData.getColumnType(columnIndex);
switch (typeVal) {
case Types.BIGINT:
case Types.DECIMAL:
case Types.NUMERIC:
return (Number) resultSet.getLong(columnIndex);
c... | [
"private",
"Number",
"getIdColumnData",
"(",
"ResultSet",
"resultSet",
",",
"ResultSetMetaData",
"metaData",
",",
"int",
"columnIndex",
")",
"throws",
"SQLException",
"{",
"int",
"typeVal",
"=",
"metaData",
".",
"getColumnType",
"(",
"columnIndex",
")",
";",
"swit... | Return the id associated with the column. | [
"Return",
"the",
"id",
"associated",
"with",
"the",
"column",
"."
] | a5ce794ce34bce7000730ebe8e15f3fb3a8a5381 | https://github.com/j256/ormlite-jdbc/blob/a5ce794ce34bce7000730ebe8e15f3fb3a8a5381/src/main/java/com/j256/ormlite/jdbc/JdbcDatabaseConnection.java#L330-L346 | train |
j256/ormlite-jdbc | src/main/java/com/j256/ormlite/jdbc/TypeValMapper.java | TypeValMapper.getTypeValForSqlType | public static int getTypeValForSqlType(SqlType sqlType) throws SQLException {
int[] typeVals = typeToValMap.get(sqlType);
if (typeVals == null) {
throw new SQLException("SqlType is unknown to type val mapping: " + sqlType);
}
if (typeVals.length == 0) {
throw new SQLException("SqlType does not have any JD... | java | public static int getTypeValForSqlType(SqlType sqlType) throws SQLException {
int[] typeVals = typeToValMap.get(sqlType);
if (typeVals == null) {
throw new SQLException("SqlType is unknown to type val mapping: " + sqlType);
}
if (typeVals.length == 0) {
throw new SQLException("SqlType does not have any JD... | [
"public",
"static",
"int",
"getTypeValForSqlType",
"(",
"SqlType",
"sqlType",
")",
"throws",
"SQLException",
"{",
"int",
"[",
"]",
"typeVals",
"=",
"typeToValMap",
".",
"get",
"(",
"sqlType",
")",
";",
"if",
"(",
"typeVals",
"==",
"null",
")",
"{",
"throw"... | Returns the primary type value associated with the SqlType argument. | [
"Returns",
"the",
"primary",
"type",
"value",
"associated",
"with",
"the",
"SqlType",
"argument",
"."
] | a5ce794ce34bce7000730ebe8e15f3fb3a8a5381 | https://github.com/j256/ormlite-jdbc/blob/a5ce794ce34bce7000730ebe8e15f3fb3a8a5381/src/main/java/com/j256/ormlite/jdbc/TypeValMapper.java#L88-L98 | train |
j256/ormlite-jdbc | src/main/java/com/j256/ormlite/jdbc/TypeValMapper.java | TypeValMapper.getSqlTypeForTypeVal | public static SqlType getSqlTypeForTypeVal(int typeVal) {
// iterate through to save on the extra HashMap since only for errors
for (Map.Entry<SqlType, int[]> entry : typeToValMap.entrySet()) {
for (int val : entry.getValue()) {
if (val == typeVal) {
return entry.getKey();
}
}
}
return SqlTyp... | java | public static SqlType getSqlTypeForTypeVal(int typeVal) {
// iterate through to save on the extra HashMap since only for errors
for (Map.Entry<SqlType, int[]> entry : typeToValMap.entrySet()) {
for (int val : entry.getValue()) {
if (val == typeVal) {
return entry.getKey();
}
}
}
return SqlTyp... | [
"public",
"static",
"SqlType",
"getSqlTypeForTypeVal",
"(",
"int",
"typeVal",
")",
"{",
"// iterate through to save on the extra HashMap since only for errors",
"for",
"(",
"Map",
".",
"Entry",
"<",
"SqlType",
",",
"int",
"[",
"]",
">",
"entry",
":",
"typeToValMap",
... | Returns the SqlType value associated with the typeVal argument. Can be slow-er. | [
"Returns",
"the",
"SqlType",
"value",
"associated",
"with",
"the",
"typeVal",
"argument",
".",
"Can",
"be",
"slow",
"-",
"er",
"."
] | a5ce794ce34bce7000730ebe8e15f3fb3a8a5381 | https://github.com/j256/ormlite-jdbc/blob/a5ce794ce34bce7000730ebe8e15f3fb3a8a5381/src/main/java/com/j256/ormlite/jdbc/TypeValMapper.java#L103-L113 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java | CSSColorHelper.isColorValue | public static boolean isColorValue (@Nullable final String sValue)
{
final String sRealValue = StringHelper.trim (sValue);
if (StringHelper.hasNoText (sRealValue))
return false;
return isRGBColorValue (sRealValue) ||
isRGBAColorValue (sRealValue) ||
isHSLColorValue (sRealValue... | java | public static boolean isColorValue (@Nullable final String sValue)
{
final String sRealValue = StringHelper.trim (sValue);
if (StringHelper.hasNoText (sRealValue))
return false;
return isRGBColorValue (sRealValue) ||
isRGBAColorValue (sRealValue) ||
isHSLColorValue (sRealValue... | [
"public",
"static",
"boolean",
"isColorValue",
"(",
"@",
"Nullable",
"final",
"String",
"sValue",
")",
"{",
"final",
"String",
"sRealValue",
"=",
"StringHelper",
".",
"trim",
"(",
"sValue",
")",
";",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sRealVa... | Check if the passed string is any color value.
@param sValue
The value to check. May be <code>null</code>.
@return <code>true</code> if the passed value is not <code>null</code>, not
empty and a valid CSS color value.
@see #isRGBColorValue(String)
@see #isRGBAColorValue(String)
@see #isHSLColorValue(String)
@see #isHS... | [
"Check",
"if",
"the",
"passed",
"string",
"is",
"any",
"color",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L141-L156 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java | CSSColorHelper.getRGBColorValue | @Nonnull
@Nonempty
public static String getRGBColorValue (final int nRed, final int nGreen, final int nBlue)
{
return new StringBuilder (16).append (CCSSValue.PREFIX_RGB_OPEN)
.append (getRGBValue (nRed))
.append (',')
... | java | @Nonnull
@Nonempty
public static String getRGBColorValue (final int nRed, final int nGreen, final int nBlue)
{
return new StringBuilder (16).append (CCSSValue.PREFIX_RGB_OPEN)
.append (getRGBValue (nRed))
.append (',')
... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getRGBColorValue",
"(",
"final",
"int",
"nRed",
",",
"final",
"int",
"nGreen",
",",
"final",
"int",
"nBlue",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"16",
")",
".",
"append",
"(",
"... | Get the passed values as CSS RGB color value
@param nRed
Red - is scaled to 0-255
@param nGreen
Green - is scaled to 0-255
@param nBlue
Blue - is scaled to 0-255
@return The CSS string to use | [
"Get",
"the",
"passed",
"values",
"as",
"CSS",
"RGB",
"color",
"value"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L365-L377 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java | CSSColorHelper.getRGBAColorValue | @Nonnull
@Nonempty
public static String getRGBAColorValue (final int nRed, final int nGreen, final int nBlue, final float fOpacity)
{
return new StringBuilder (24).append (CCSSValue.PREFIX_RGBA_OPEN)
.append (getRGBValue (nRed))
.append (',')
... | java | @Nonnull
@Nonempty
public static String getRGBAColorValue (final int nRed, final int nGreen, final int nBlue, final float fOpacity)
{
return new StringBuilder (24).append (CCSSValue.PREFIX_RGBA_OPEN)
.append (getRGBValue (nRed))
.append (',')
... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getRGBAColorValue",
"(",
"final",
"int",
"nRed",
",",
"final",
"int",
"nGreen",
",",
"final",
"int",
"nBlue",
",",
"final",
"float",
"fOpacity",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
... | Get the passed values as CSS RGBA color value
@param nRed
Red - is scaled to 0-255
@param nGreen
Green - is scaled to 0-255
@param nBlue
Blue - is scaled to 0-255
@param fOpacity
Opacity to use - is scaled to 0-1.
@return The CSS string to use | [
"Get",
"the",
"passed",
"values",
"as",
"CSS",
"RGBA",
"color",
"value"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L392-L406 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/parser/CSSCharStream.java | CSSCharStream.adjustBeginLineColumn | public void adjustBeginLineColumn (final int nNewLine, final int newCol)
{
int start = m_nTokenBegin;
int newLine = nNewLine;
int len;
if (m_nBufpos >= m_nTokenBegin)
{
len = m_nBufpos - m_nTokenBegin + m_nInBuf + 1;
}
else
{
len = m_nBufsize - m_nTokenBegin + m_nBufpos + ... | java | public void adjustBeginLineColumn (final int nNewLine, final int newCol)
{
int start = m_nTokenBegin;
int newLine = nNewLine;
int len;
if (m_nBufpos >= m_nTokenBegin)
{
len = m_nBufpos - m_nTokenBegin + m_nInBuf + 1;
}
else
{
len = m_nBufsize - m_nTokenBegin + m_nBufpos + ... | [
"public",
"void",
"adjustBeginLineColumn",
"(",
"final",
"int",
"nNewLine",
",",
"final",
"int",
"newCol",
")",
"{",
"int",
"start",
"=",
"m_nTokenBegin",
";",
"int",
"newLine",
"=",
"nNewLine",
";",
"int",
"len",
";",
"if",
"(",
"m_nBufpos",
">=",
"m_nTok... | Method to adjust line and column numbers for the start of a token.
@param nNewLine
line index
@param newCol
column index | [
"Method",
"to",
"adjust",
"line",
"and",
"column",
"numbers",
"for",
"the",
"start",
"of",
"a",
"token",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/parser/CSSCharStream.java#L385-L441 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/parser/CSSParseHelper.java | CSSParseHelper.unescapeURL | @Nonnull
public static String unescapeURL (@Nonnull final String sEscapedURL)
{
int nIndex = sEscapedURL.indexOf (URL_ESCAPE_CHAR);
if (nIndex < 0)
{
// No escape sequence found
return sEscapedURL;
}
final StringBuilder aSB = new StringBuilder (sEscapedURL.length ());
int nPrevI... | java | @Nonnull
public static String unescapeURL (@Nonnull final String sEscapedURL)
{
int nIndex = sEscapedURL.indexOf (URL_ESCAPE_CHAR);
if (nIndex < 0)
{
// No escape sequence found
return sEscapedURL;
}
final StringBuilder aSB = new StringBuilder (sEscapedURL.length ());
int nPrevI... | [
"@",
"Nonnull",
"public",
"static",
"String",
"unescapeURL",
"(",
"@",
"Nonnull",
"final",
"String",
"sEscapedURL",
")",
"{",
"int",
"nIndex",
"=",
"sEscapedURL",
".",
"indexOf",
"(",
"URL_ESCAPE_CHAR",
")",
";",
"if",
"(",
"nIndex",
"<",
"0",
")",
"{",
... | Unescape all escaped characters in a CSS URL. All characters masked with a
'\\' character replaced.
@param sEscapedURL
The escaped URL. May not be <code>null</code>!
@return The unescaped URL or the original string, if not a single escape
sequence is found. | [
"Unescape",
"all",
"escaped",
"characters",
"in",
"a",
"CSS",
"URL",
".",
"All",
"characters",
"masked",
"with",
"a",
"\\\\",
"character",
"replaced",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/parser/CSSParseHelper.java#L90-L116 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java | CSSSimpleValueWithUnit.setValue | @Nonnull
public CSSSimpleValueWithUnit setValue (@Nonnull final BigDecimal aValue)
{
m_aValue = ValueEnforcer.notNull (aValue, "Value");
return this;
} | java | @Nonnull
public CSSSimpleValueWithUnit setValue (@Nonnull final BigDecimal aValue)
{
m_aValue = ValueEnforcer.notNull (aValue, "Value");
return this;
} | [
"@",
"Nonnull",
"public",
"CSSSimpleValueWithUnit",
"setValue",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aValue",
")",
"{",
"m_aValue",
"=",
"ValueEnforcer",
".",
"notNull",
"(",
"aValue",
",",
"\"Value\"",
")",
";",
"return",
"this",
";",
"}"
] | Set the numerical value.
@param aValue
The new value to set. May not be <code>null</code>.
@return this
@since 3.7.3 | [
"Set",
"the",
"numerical",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java#L82-L87 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java | CSSSimpleValueWithUnit.setUnit | @Nonnull
public CSSSimpleValueWithUnit setUnit (@Nonnull final ECSSUnit eUnit)
{
m_eUnit = ValueEnforcer.notNull (eUnit, "Unit");
return this;
} | java | @Nonnull
public CSSSimpleValueWithUnit setUnit (@Nonnull final ECSSUnit eUnit)
{
m_eUnit = ValueEnforcer.notNull (eUnit, "Unit");
return this;
} | [
"@",
"Nonnull",
"public",
"CSSSimpleValueWithUnit",
"setUnit",
"(",
"@",
"Nonnull",
"final",
"ECSSUnit",
"eUnit",
")",
"{",
"m_eUnit",
"=",
"ValueEnforcer",
".",
"notNull",
"(",
"eUnit",
",",
"\"Unit\"",
")",
";",
"return",
"this",
";",
"}"
] | Set the unit type.
@param eUnit
The new unit to set. May not be <code>null</code>.
@return this
@since 3.7.3 | [
"Set",
"the",
"unit",
"type",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java#L147-L152 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java | CSSSimpleValueWithUnit.add | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit add (@Nonnull final BigDecimal aDelta)
{
return new CSSSimpleValueWithUnit (m_aValue.add (aDelta), m_eUnit);
} | java | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit add (@Nonnull final BigDecimal aDelta)
{
return new CSSSimpleValueWithUnit (m_aValue.add (aDelta), m_eUnit);
} | [
"@",
"Nonnull",
"@",
"CheckReturnValue",
"public",
"CSSSimpleValueWithUnit",
"add",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aDelta",
")",
"{",
"return",
"new",
"CSSSimpleValueWithUnit",
"(",
"m_aValue",
".",
"add",
"(",
"aDelta",
")",
",",
"m_eUnit",
")",
... | Get a new object with the same unit but an added value.
@param aDelta
The delta to be added. May not be <code>null</code>.
@return A new object. Never <code>null</code>.
@since 3.7.3 | [
"Get",
"a",
"new",
"object",
"with",
"the",
"same",
"unit",
"but",
"an",
"added",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java#L183-L188 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java | CSSSimpleValueWithUnit.substract | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit substract (@Nonnull final BigDecimal aDelta)
{
return new CSSSimpleValueWithUnit (m_aValue.subtract (aDelta), m_eUnit);
} | java | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit substract (@Nonnull final BigDecimal aDelta)
{
return new CSSSimpleValueWithUnit (m_aValue.subtract (aDelta), m_eUnit);
} | [
"@",
"Nonnull",
"@",
"CheckReturnValue",
"public",
"CSSSimpleValueWithUnit",
"substract",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aDelta",
")",
"{",
"return",
"new",
"CSSSimpleValueWithUnit",
"(",
"m_aValue",
".",
"subtract",
"(",
"aDelta",
")",
",",
"m_eUnit... | Get a new object with the same unit but a subtracted value.
@param aDelta
The delta to be subtracted. May not be <code>null</code>.
@return A new object. Never <code>null</code>.
@since 3.7.3 | [
"Get",
"a",
"new",
"object",
"with",
"the",
"same",
"unit",
"but",
"a",
"subtracted",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java#L212-L217 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java | CSSSimpleValueWithUnit.multiply | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit multiply (@Nonnull final BigDecimal aValue)
{
return new CSSSimpleValueWithUnit (m_aValue.multiply (aValue), m_eUnit);
} | java | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit multiply (@Nonnull final BigDecimal aValue)
{
return new CSSSimpleValueWithUnit (m_aValue.multiply (aValue), m_eUnit);
} | [
"@",
"Nonnull",
"@",
"CheckReturnValue",
"public",
"CSSSimpleValueWithUnit",
"multiply",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aValue",
")",
"{",
"return",
"new",
"CSSSimpleValueWithUnit",
"(",
"m_aValue",
".",
"multiply",
"(",
"aValue",
")",
",",
"m_eUnit"... | Get a new object with the same unit but a multiplied value.
@param aValue
The value to be multiply with this value. May not be
<code>null</code>.
@return A new object. Never <code>null</code>.
@since 3.7.3 | [
"Get",
"a",
"new",
"object",
"with",
"the",
"same",
"unit",
"but",
"a",
"multiplied",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java#L242-L247 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java | CSSSimpleValueWithUnit.divide | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit divide (@Nonnull final BigDecimal aDivisor,
@Nonnegative final int nScale,
@Nonnull final RoundingMode eRoundingMode)
{
return new CSSSimpleValueWithUnit (m_aValue.divide (a... | java | @Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit divide (@Nonnull final BigDecimal aDivisor,
@Nonnegative final int nScale,
@Nonnull final RoundingMode eRoundingMode)
{
return new CSSSimpleValueWithUnit (m_aValue.divide (a... | [
"@",
"Nonnull",
"@",
"CheckReturnValue",
"public",
"CSSSimpleValueWithUnit",
"divide",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aDivisor",
",",
"@",
"Nonnegative",
"final",
"int",
"nScale",
",",
"@",
"Nonnull",
"final",
"RoundingMode",
"eRoundingMode",
")",
"{... | Get a new object with the same unit but an divided value.
@param aDivisor
The divisor to use. May not be <code>null</code>.
@param nScale
The maximum fraction digits to use.
@param eRoundingMode
The rounding mode to use. May not be <code>null</code>.
@return A new object. Never <code>null</code>.
@since 3.7.3 | [
"Get",
"a",
"new",
"object",
"with",
"the",
"same",
"unit",
"but",
"an",
"divided",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/propertyvalue/CSSSimpleValueWithUnit.java#L275-L282 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSRectHelper.java | CSSRectHelper.getRectValues | @Nullable
public static String [] getRectValues (@Nullable final String sCSSValue)
{
String [] ret = null;
final String sRealValue = StringHelper.trim (sCSSValue);
if (StringHelper.hasText (sRealValue))
{
ret = RegExHelper.getAllMatchingGroupValues (PATTERN_CURRENT_SYNTAX, sRealValue);
i... | java | @Nullable
public static String [] getRectValues (@Nullable final String sCSSValue)
{
String [] ret = null;
final String sRealValue = StringHelper.trim (sCSSValue);
if (StringHelper.hasText (sRealValue))
{
ret = RegExHelper.getAllMatchingGroupValues (PATTERN_CURRENT_SYNTAX, sRealValue);
i... | [
"@",
"Nullable",
"public",
"static",
"String",
"[",
"]",
"getRectValues",
"(",
"@",
"Nullable",
"final",
"String",
"sCSSValue",
")",
"{",
"String",
"[",
"]",
"ret",
"=",
"null",
";",
"final",
"String",
"sRealValue",
"=",
"StringHelper",
".",
"trim",
"(",
... | Get all the values from within a CSS rectangle definition.
@param sCSSValue
The CSS values to check. May be <code>null</code>.
@return <code>null</code> if the passed String is not a CSS rectangle. An
array with 4 Strings if the passed value is a CSS rectangle. | [
"Get",
"all",
"the",
"values",
"from",
"within",
"a",
"CSS",
"rectangle",
"definition",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSRectHelper.java#L107-L119 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java | AbstractHasTopLevelRules.removeRules | @Nonnull
public EChange removeRules (@Nonnull final Predicate <? super ICSSTopLevelRule> aFilter)
{
return EChange.valueOf (m_aRules.removeIf (aFilter));
} | java | @Nonnull
public EChange removeRules (@Nonnull final Predicate <? super ICSSTopLevelRule> aFilter)
{
return EChange.valueOf (m_aRules.removeIf (aFilter));
} | [
"@",
"Nonnull",
"public",
"EChange",
"removeRules",
"(",
"@",
"Nonnull",
"final",
"Predicate",
"<",
"?",
"super",
"ICSSTopLevelRule",
">",
"aFilter",
")",
"{",
"return",
"EChange",
".",
"valueOf",
"(",
"m_aRules",
".",
"removeIf",
"(",
"aFilter",
")",
")",
... | Remove all rules matching the passed predicate.
@param aFilter
The predicate to apply for deletion. May not be <code>null</code>.
@return {@link EChange#CHANGED} it at least one rule was removed,
{@link EChange#UNCHANGED} otherwise.
@since 5.0.0 | [
"Remove",
"all",
"rules",
"matching",
"the",
"passed",
"predicate",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java#L186-L190 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java | AbstractHasTopLevelRules.getStyleRuleAtIndex | @Nullable
public CSSStyleRule getStyleRuleAtIndex (@Nonnegative final int nIndex)
{
return m_aRules.getAtIndexMapped (r -> r instanceof CSSStyleRule, nIndex, r -> (CSSStyleRule) r);
} | java | @Nullable
public CSSStyleRule getStyleRuleAtIndex (@Nonnegative final int nIndex)
{
return m_aRules.getAtIndexMapped (r -> r instanceof CSSStyleRule, nIndex, r -> (CSSStyleRule) r);
} | [
"@",
"Nullable",
"public",
"CSSStyleRule",
"getStyleRuleAtIndex",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
")",
"{",
"return",
"m_aRules",
".",
"getAtIndexMapped",
"(",
"r",
"->",
"r",
"instanceof",
"CSSStyleRule",
",",
"nIndex",
",",
"r",
"->",
"(",... | Get the style rule at the specified index.
@param nIndex
The index to be resolved. Should be ≥ 0 and <
{@link #getStyleRuleCount()}.
@return <code>null</code> if an invalid index was specified.
@since 3.7.4 | [
"Get",
"the",
"style",
"rule",
"at",
"the",
"specified",
"index",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java#L268-L272 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java | AbstractHasTopLevelRules.getUnknownRuleAtIndex | @Nullable
public CSSUnknownRule getUnknownRuleAtIndex (@Nonnegative final int nIndex)
{
return m_aRules.getAtIndexMapped (r -> r instanceof CSSUnknownRule, nIndex, r -> (CSSUnknownRule) r);
} | java | @Nullable
public CSSUnknownRule getUnknownRuleAtIndex (@Nonnegative final int nIndex)
{
return m_aRules.getAtIndexMapped (r -> r instanceof CSSUnknownRule, nIndex, r -> (CSSUnknownRule) r);
} | [
"@",
"Nullable",
"public",
"CSSUnknownRule",
"getUnknownRuleAtIndex",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
")",
"{",
"return",
"m_aRules",
".",
"getAtIndexMapped",
"(",
"r",
"->",
"r",
"instanceof",
"CSSUnknownRule",
",",
"nIndex",
",",
"r",
"->",
... | Get the unknown rule at the specified index.
@param nIndex
The index to be resolved. Should be ≥ 0 and <
{@link #getUnknownRuleCount()}.
@return <code>null</code> if an invalid index was specified.
@since 3.7.4 | [
"Get",
"the",
"unknown",
"rule",
"at",
"the",
"specified",
"index",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java#L643-L647 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSMediaQuery.java | CSSMediaQuery.addMediaExpression | @Nonnull
public CSSMediaQuery addMediaExpression (@Nonnull final CSSMediaExpression aMediaExpression)
{
ValueEnforcer.notNull (aMediaExpression, "MediaExpression");
m_aMediaExpressions.add (aMediaExpression);
return this;
} | java | @Nonnull
public CSSMediaQuery addMediaExpression (@Nonnull final CSSMediaExpression aMediaExpression)
{
ValueEnforcer.notNull (aMediaExpression, "MediaExpression");
m_aMediaExpressions.add (aMediaExpression);
return this;
} | [
"@",
"Nonnull",
"public",
"CSSMediaQuery",
"addMediaExpression",
"(",
"@",
"Nonnull",
"final",
"CSSMediaExpression",
"aMediaExpression",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aMediaExpression",
",",
"\"MediaExpression\"",
")",
";",
"m_aMediaExpressions",
".",... | Append a media expression to the list.
@param aMediaExpression
The media expression to be added. May not be <code>null</code>.
@return this | [
"Append",
"a",
"media",
"expression",
"to",
"the",
"list",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSMediaQuery.java#L163-L170 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSMediaQuery.java | CSSMediaQuery.addMediaExpression | @Nonnull
public CSSMediaQuery addMediaExpression (@Nonnegative final int nIndex,
@Nonnull final CSSMediaExpression aMediaExpression)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aMediaExpression, "MediaExpression");
if (nIndex >= getMediaExp... | java | @Nonnull
public CSSMediaQuery addMediaExpression (@Nonnegative final int nIndex,
@Nonnull final CSSMediaExpression aMediaExpression)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aMediaExpression, "MediaExpression");
if (nIndex >= getMediaExp... | [
"@",
"Nonnull",
"public",
"CSSMediaQuery",
"addMediaExpression",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"@",
"Nonnull",
"final",
"CSSMediaExpression",
"aMediaExpression",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nIndex",
",",
"\"Index\"",
")... | Add a media expression to the list at the specified index.
@param nIndex
The index where the media expression should be added. Must be ≥
0.
@param aMediaExpression
The media expression to be added. May not be <code>null</code>.
@return this | [
"Add",
"a",
"media",
"expression",
"to",
"the",
"list",
"at",
"the",
"specified",
"index",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSMediaQuery.java#L182-L194 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java | CSSReaderDeclarationList.setDefaultInterpretErrorHandler | public static void setDefaultInterpretErrorHandler (@Nonnull final ICSSInterpretErrorHandler aDefaultErrorHandler)
{
ValueEnforcer.notNull (aDefaultErrorHandler, "DefaultErrorHandler");
s_aRWLock.writeLocked ( () -> s_aDefaultInterpretErrorHandler = aDefaultErrorHandler);
} | java | public static void setDefaultInterpretErrorHandler (@Nonnull final ICSSInterpretErrorHandler aDefaultErrorHandler)
{
ValueEnforcer.notNull (aDefaultErrorHandler, "DefaultErrorHandler");
s_aRWLock.writeLocked ( () -> s_aDefaultInterpretErrorHandler = aDefaultErrorHandler);
} | [
"public",
"static",
"void",
"setDefaultInterpretErrorHandler",
"(",
"@",
"Nonnull",
"final",
"ICSSInterpretErrorHandler",
"aDefaultErrorHandler",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aDefaultErrorHandler",
",",
"\"DefaultErrorHandler\"",
")",
";",
"s_aRWLock",
... | Set the default interpret error handler to handle interpretation errors in
successfully parsed CSS.
@param aDefaultErrorHandler
The default error handler to be used. May not be <code>null</code>.
@since 5.0.2 | [
"Set",
"the",
"default",
"interpret",
"error",
"handler",
"to",
"handle",
"interpretation",
"errors",
"in",
"successfully",
"parsed",
"CSS",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java#L162-L167 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java | CSSReaderDeclarationList.isValidCSS | public static boolean isValidCSS (@Nonnull final File aFile,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion)
{
return isValidCSS (new FileSystemResource (aFile), aCharset, eVersion);
} | java | public static boolean isValidCSS (@Nonnull final File aFile,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion)
{
return isValidCSS (new FileSystemResource (aFile), aCharset, eVersion);
} | [
"public",
"static",
"boolean",
"isValidCSS",
"(",
"@",
"Nonnull",
"final",
"File",
"aFile",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
")",
"{",
"return",
"isValidCSS",
"(",
"new",
"FileSystemR... | Check if the passed CSS file can be parsed without error
@param aFile
The file to be parsed. May not be <code>null</code>.
@param aCharset
The charset to be used for reading the CSS file. May not be
<code>null</code>.
@param eVersion
The CSS version to be used for scanning. May not be
<code>null</code>.
@return <code>... | [
"Check",
"if",
"the",
"passed",
"CSS",
"file",
"can",
"be",
"parsed",
"without",
"error"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java#L233-L238 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java | CSSURLHelper.isURLValue | public static boolean isURLValue (@Nullable final String sValue)
{
final String sRealValue = StringHelper.trim (sValue);
if (StringHelper.hasNoText (sRealValue))
return false;
if (sRealValue.equals (CCSSValue.NONE))
return true;
// 5 = "url(".length () + ")".length
return sRealValue.... | java | public static boolean isURLValue (@Nullable final String sValue)
{
final String sRealValue = StringHelper.trim (sValue);
if (StringHelper.hasNoText (sRealValue))
return false;
if (sRealValue.equals (CCSSValue.NONE))
return true;
// 5 = "url(".length () + ")".length
return sRealValue.... | [
"public",
"static",
"boolean",
"isURLValue",
"(",
"@",
"Nullable",
"final",
"String",
"sValue",
")",
"{",
"final",
"String",
"sRealValue",
"=",
"StringHelper",
".",
"trim",
"(",
"sValue",
")",
";",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sRealValu... | Check if the passed CSS value is an URL value. This is either a URL
starting with "url(" or it is the string "none".
@param sValue
The value to be checked.
@return <code>true</code> if the passed value starts with "url(" and ends
with ")" - <code>false</code> otherwise. | [
"Check",
"if",
"the",
"passed",
"CSS",
"value",
"is",
"an",
"URL",
"value",
".",
"This",
"is",
"either",
"a",
"URL",
"starting",
"with",
"url",
"(",
"or",
"it",
"is",
"the",
"string",
"none",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java#L57-L70 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java | CSSURLHelper.getURLValue | @Nullable
public static String getURLValue (@Nullable final String sValue)
{
if (isURLValue (sValue))
{
return CSSParseHelper.trimUrl (sValue);
}
return null;
} | java | @Nullable
public static String getURLValue (@Nullable final String sValue)
{
if (isURLValue (sValue))
{
return CSSParseHelper.trimUrl (sValue);
}
return null;
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getURLValue",
"(",
"@",
"Nullable",
"final",
"String",
"sValue",
")",
"{",
"if",
"(",
"isURLValue",
"(",
"sValue",
")",
")",
"{",
"return",
"CSSParseHelper",
".",
"trimUrl",
"(",
"sValue",
")",
";",
"}",
"r... | Extract the real URL contained in a CSS URL value.
@param sValue
The value containing the CSS value
@return <code>null</code> if the passed value is not an URL value
@see #isURLValue | [
"Extract",
"the",
"real",
"URL",
"contained",
"in",
"a",
"CSS",
"URL",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java#L80-L88 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java | CSSURLHelper.isCSSURLRequiringQuotes | public static boolean isCSSURLRequiringQuotes (@Nonnull final String sURL)
{
ValueEnforcer.notNull (sURL, "URL");
for (final char c : sURL.toCharArray ())
if (!isValidCSSURLChar (c))
return true;
return false;
} | java | public static boolean isCSSURLRequiringQuotes (@Nonnull final String sURL)
{
ValueEnforcer.notNull (sURL, "URL");
for (final char c : sURL.toCharArray ())
if (!isValidCSSURLChar (c))
return true;
return false;
} | [
"public",
"static",
"boolean",
"isCSSURLRequiringQuotes",
"(",
"@",
"Nonnull",
"final",
"String",
"sURL",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sURL",
",",
"\"URL\"",
")",
";",
"for",
"(",
"final",
"char",
"c",
":",
"sURL",
".",
"toCharArray",
"... | Check if any character inside the passed URL needs escaping.
@param sURL
The URL to be checked. May not be <code>null</code>.
@return <code>true</code> if any of the contained characters needs
escaping, <code>false</code> if the URL can be used as is. | [
"Check",
"if",
"any",
"character",
"inside",
"the",
"passed",
"URL",
"needs",
"escaping",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java#L138-L146 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java | CSSURLHelper.getEscapedCSSURL | @Nonnull
@Nonempty
public static String getEscapedCSSURL (@Nonnull final String sURL, final char cQuoteChar)
{
ValueEnforcer.notNull (sURL, "URL");
if (sURL.indexOf (cQuoteChar) < 0 && sURL.indexOf (CSSParseHelper.URL_ESCAPE_CHAR) < 0)
{
// Found nothing to quote
return sURL;
}
f... | java | @Nonnull
@Nonempty
public static String getEscapedCSSURL (@Nonnull final String sURL, final char cQuoteChar)
{
ValueEnforcer.notNull (sURL, "URL");
if (sURL.indexOf (cQuoteChar) < 0 && sURL.indexOf (CSSParseHelper.URL_ESCAPE_CHAR) < 0)
{
// Found nothing to quote
return sURL;
}
f... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getEscapedCSSURL",
"(",
"@",
"Nonnull",
"final",
"String",
"sURL",
",",
"final",
"char",
"cQuoteChar",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sURL",
",",
"\"URL\"",
")",
";",
"if",
"... | Internal method to escape a CSS URL. Because this method is only called for
quoted URLs, only the quote character itself needs to be quoted.
@param sURL
The URL to be escaped. May not be <code>null</code>.
@param cQuoteChar
The quote char that is used. Either '\'' or '"'
@return The escaped string. Never <code>null</c... | [
"Internal",
"method",
"to",
"escape",
"a",
"CSS",
"URL",
".",
"Because",
"this",
"method",
"is",
"only",
"called",
"for",
"quoted",
"URLs",
"only",
"the",
"quote",
"character",
"itself",
"needs",
"to",
"be",
"quoted",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java#L158-L179 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSMediaRule.java | CSSMediaRule.addMediaQuery | @Nonnull
public CSSMediaRule addMediaQuery (@Nonnull @Nonempty final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
m_aMediaQueries.add (aMediaQuery);
return this;
} | java | @Nonnull
public CSSMediaRule addMediaQuery (@Nonnull @Nonempty final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
m_aMediaQueries.add (aMediaQuery);
return this;
} | [
"@",
"Nonnull",
"public",
"CSSMediaRule",
"addMediaQuery",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"CSSMediaQuery",
"aMediaQuery",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aMediaQuery",
",",
"\"MediaQuery\"",
")",
";",
"m_aMediaQueries",
".",
"add",... | Add a new media query.
@param aMediaQuery
The media query to be added. May not be <code>null</code>.
@return this for chaining | [
"Add",
"a",
"new",
"media",
"query",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSMediaRule.java#L83-L90 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSMediaRule.java | CSSMediaRule.addMediaQuery | @Nonnull
public CSSMediaRule addMediaQuery (@Nonnegative final int nIndex, @Nonnull @Nonempty final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
if (nIndex >= getMediaQueryCount ())
m_aMediaQueries.add (aMediaQuery);
el... | java | @Nonnull
public CSSMediaRule addMediaQuery (@Nonnegative final int nIndex, @Nonnull @Nonempty final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
if (nIndex >= getMediaQueryCount ())
m_aMediaQueries.add (aMediaQuery);
el... | [
"@",
"Nonnull",
"public",
"CSSMediaRule",
"addMediaQuery",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"CSSMediaQuery",
"aMediaQuery",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nIndex",
",",
"\"Index\"",... | Add a media query at the specified index.
@param nIndex
The index to use. Must be ≥ 0. If the index is ≥
{@link #getMediaQueryCount()} than the media query is appended like
in {@link #addMediaQuery(CSSMediaQuery)}.
@param aMediaQuery
The media query to be added. May not be <code>null</code>.
@return this for cha... | [
"Add",
"a",
"media",
"query",
"at",
"the",
"specified",
"index",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSMediaRule.java#L103-L114 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReader.java | CSSReader.isValidCSS | public static boolean isValidCSS (@Nonnull final IReadableResource aRes,
@Nonnull final Charset aFallbackCharset,
@Nonnull final ECSSVersion eVersion)
{
ValueEnforcer.notNull (aRes, "Resource");
ValueEnforcer.notNull (aFallbackCharset, "F... | java | public static boolean isValidCSS (@Nonnull final IReadableResource aRes,
@Nonnull final Charset aFallbackCharset,
@Nonnull final ECSSVersion eVersion)
{
ValueEnforcer.notNull (aRes, "Resource");
ValueEnforcer.notNull (aFallbackCharset, "F... | [
"public",
"static",
"boolean",
"isValidCSS",
"(",
"@",
"Nonnull",
"final",
"IReadableResource",
"aRes",
",",
"@",
"Nonnull",
"final",
"Charset",
"aFallbackCharset",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
")",
"{",
"ValueEnforcer",
".",
"notNull",... | Check if the passed CSS resource can be parsed without error
@param aRes
The resource to be parsed. May not be <code>null</code>.
@param aFallbackCharset
The charset to be used for reading the CSS file in case neither a
<code>@charset</code> rule nor a BOM is present. May not be
<code>null</code>.
@param eVersion
The ... | [
"Check",
"if",
"the",
"passed",
"CSS",
"resource",
"can",
"be",
"parsed",
"without",
"error"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReader.java#L272-L287 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSRect.java | CSSRect.setTop | @Nonnull
public CSSRect setTop (@Nonnull @Nonempty final String sTop)
{
ValueEnforcer.notEmpty (sTop, "Top");
m_sTop = sTop;
return this;
} | java | @Nonnull
public CSSRect setTop (@Nonnull @Nonempty final String sTop)
{
ValueEnforcer.notEmpty (sTop, "Top");
m_sTop = sTop;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSRect",
"setTop",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sTop",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sTop",
",",
"\"Top\"",
")",
";",
"m_sTop",
"=",
"sTop",
";",
"return",
"this",
";",
"}"
] | Set the top coordinate.
@param sTop
May neither be <code>null</code> nor empty.
@return this | [
"Set",
"the",
"top",
"coordinate",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSRect.java#L95-L102 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSRect.java | CSSRect.setRight | @Nonnull
public CSSRect setRight (@Nonnull @Nonempty final String sRight)
{
ValueEnforcer.notEmpty (sRight, "Right");
m_sRight = sRight;
return this;
} | java | @Nonnull
public CSSRect setRight (@Nonnull @Nonempty final String sRight)
{
ValueEnforcer.notEmpty (sRight, "Right");
m_sRight = sRight;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSRect",
"setRight",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sRight",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sRight",
",",
"\"Right\"",
")",
";",
"m_sRight",
"=",
"sRight",
";",
"return",
"this",
";"... | Set the right coordinate.
@param sRight
May neither be <code>null</code> nor empty.
@return this | [
"Set",
"the",
"right",
"coordinate",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSRect.java#L121-L128 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSRect.java | CSSRect.setBottom | @Nonnull
public CSSRect setBottom (@Nonnull @Nonempty final String sBottom)
{
ValueEnforcer.notEmpty (sBottom, "Bottom");
m_sBottom = sBottom;
return this;
} | java | @Nonnull
public CSSRect setBottom (@Nonnull @Nonempty final String sBottom)
{
ValueEnforcer.notEmpty (sBottom, "Bottom");
m_sBottom = sBottom;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSRect",
"setBottom",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sBottom",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sBottom",
",",
"\"Bottom\"",
")",
";",
"m_sBottom",
"=",
"sBottom",
";",
"return",
"this",... | Set the bottom coordinate.
@param sBottom
May neither be <code>null</code> nor empty.
@return this | [
"Set",
"the",
"bottom",
"coordinate",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSRect.java#L147-L154 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSRect.java | CSSRect.setLeft | @Nonnull
public CSSRect setLeft (@Nonnull @Nonempty final String sLeft)
{
ValueEnforcer.notEmpty (sLeft, "Left");
m_sLeft = sLeft;
return this;
} | java | @Nonnull
public CSSRect setLeft (@Nonnull @Nonempty final String sLeft)
{
ValueEnforcer.notEmpty (sLeft, "Left");
m_sLeft = sLeft;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSRect",
"setLeft",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sLeft",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sLeft",
",",
"\"Left\"",
")",
";",
"m_sLeft",
"=",
"sLeft",
";",
"return",
"this",
";",
"}... | Set the left coordinate.
@param sLeft
May neither be <code>null</code> nor empty.
@return this | [
"Set",
"the",
"left",
"coordinate",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSRect.java#L173-L180 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/media/CSSMediaList.java | CSSMediaList.addMedium | @Nonnull
public CSSMediaList addMedium (@Nonnull final ECSSMedium eMedium)
{
ValueEnforcer.notNull (eMedium, "Medium");
m_aMedia.add (eMedium);
return this;
} | java | @Nonnull
public CSSMediaList addMedium (@Nonnull final ECSSMedium eMedium)
{
ValueEnforcer.notNull (eMedium, "Medium");
m_aMedia.add (eMedium);
return this;
} | [
"@",
"Nonnull",
"public",
"CSSMediaList",
"addMedium",
"(",
"@",
"Nonnull",
"final",
"ECSSMedium",
"eMedium",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"eMedium",
",",
"\"Medium\"",
")",
";",
"m_aMedia",
".",
"add",
"(",
"eMedium",
")",
";",
"return",
... | Add a new medium to the list
@param eMedium
The medium to be added. May not be <code>null</code>.
@return <code>this</code> | [
"Add",
"a",
"new",
"medium",
"to",
"the",
"list"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/media/CSSMediaList.java#L124-L131 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/writer/CSSWriter.java | CSSWriter.getCSSAsString | @Nonnull
public String getCSSAsString (@Nonnull final CascadingStyleSheet aCSS)
{
final NonBlockingStringWriter aSW = new NonBlockingStringWriter ();
try
{
writeCSS (aCSS, aSW);
}
catch (final IOException ex)
{
// Should never occur since NonBlockingStringWriter does not throw su... | java | @Nonnull
public String getCSSAsString (@Nonnull final CascadingStyleSheet aCSS)
{
final NonBlockingStringWriter aSW = new NonBlockingStringWriter ();
try
{
writeCSS (aCSS, aSW);
}
catch (final IOException ex)
{
// Should never occur since NonBlockingStringWriter does not throw su... | [
"@",
"Nonnull",
"public",
"String",
"getCSSAsString",
"(",
"@",
"Nonnull",
"final",
"CascadingStyleSheet",
"aCSS",
")",
"{",
"final",
"NonBlockingStringWriter",
"aSW",
"=",
"new",
"NonBlockingStringWriter",
"(",
")",
";",
"try",
"{",
"writeCSS",
"(",
"aCSS",
","... | Create the CSS without a specific charset.
@param aCSS
The CSS object to be converted to text. May not be <code>null</code>
.
@return The text representation of the CSS.
@see #writeCSS(CascadingStyleSheet, Writer) | [
"Create",
"the",
"CSS",
"without",
"a",
"specific",
"charset",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/writer/CSSWriter.java#L363-L378 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpressionMemberTermURI.java | CSSExpressionMemberTermURI.setURI | @Nonnull
public CSSExpressionMemberTermURI setURI (@Nonnull final CSSURI aURI)
{
m_aURI = ValueEnforcer.notNull (aURI, "URI");
return this;
} | java | @Nonnull
public CSSExpressionMemberTermURI setURI (@Nonnull final CSSURI aURI)
{
m_aURI = ValueEnforcer.notNull (aURI, "URI");
return this;
} | [
"@",
"Nonnull",
"public",
"CSSExpressionMemberTermURI",
"setURI",
"(",
"@",
"Nonnull",
"final",
"CSSURI",
"aURI",
")",
"{",
"m_aURI",
"=",
"ValueEnforcer",
".",
"notNull",
"(",
"aURI",
",",
"\"URI\"",
")",
";",
"return",
"this",
";",
"}"
] | Set a new URI
@param aURI
The new URI to set. May not be <code>null</code>.
@return this | [
"Set",
"a",
"new",
"URI"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpressionMemberTermURI.java#L78-L83 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/tools/MediaQueryTools.java | MediaQueryTools.canWrapInMediaQuery | public static boolean canWrapInMediaQuery (@Nullable final CascadingStyleSheet aCSS,
final boolean bAllowNestedMediaQueries)
{
if (aCSS == null)
return false;
if (bAllowNestedMediaQueries)
return true;
// Nested media queries are not allowed, theref... | java | public static boolean canWrapInMediaQuery (@Nullable final CascadingStyleSheet aCSS,
final boolean bAllowNestedMediaQueries)
{
if (aCSS == null)
return false;
if (bAllowNestedMediaQueries)
return true;
// Nested media queries are not allowed, theref... | [
"public",
"static",
"boolean",
"canWrapInMediaQuery",
"(",
"@",
"Nullable",
"final",
"CascadingStyleSheet",
"aCSS",
",",
"final",
"boolean",
"bAllowNestedMediaQueries",
")",
"{",
"if",
"(",
"aCSS",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"bAllowNes... | Check if the passed CSS can be wrapped in an external media rule.
@param aCSS
The CSS to be checked for wrapping. May be <code>null</code>.
@param bAllowNestedMediaQueries
if <code>true</code> nested media queries are allowed,
<code>false</code> if they are prohibited.
@return <code>true</code> if the CSS can be wrapp... | [
"Check",
"if",
"the",
"passed",
"CSS",
"can",
"be",
"wrapped",
"in",
"an",
"external",
"media",
"rule",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/tools/MediaQueryTools.java#L92-L102 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/CSSFilenameHelper.java | CSSFilenameHelper.getMinifiedCSSFilename | @Nonnull
public static String getMinifiedCSSFilename (@Nonnull final String sCSSFilename)
{
if (!isCSSFilename (sCSSFilename))
throw new IllegalArgumentException ("Passed file name '" + sCSSFilename + "' is not a CSS file name!");
if (isMinifiedCSSFilename (sCSSFilename))
return sCSSFilename;
... | java | @Nonnull
public static String getMinifiedCSSFilename (@Nonnull final String sCSSFilename)
{
if (!isCSSFilename (sCSSFilename))
throw new IllegalArgumentException ("Passed file name '" + sCSSFilename + "' is not a CSS file name!");
if (isMinifiedCSSFilename (sCSSFilename))
return sCSSFilename;
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getMinifiedCSSFilename",
"(",
"@",
"Nonnull",
"final",
"String",
"sCSSFilename",
")",
"{",
"if",
"(",
"!",
"isCSSFilename",
"(",
"sCSSFilename",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Passed fil... | Get the minified CSS filename from the passed filename. If the passed
filename is already minified, it is returned as is.
@param sCSSFilename
The filename to get minified. May not be <code>null</code>.
@return The minified filename | [
"Get",
"the",
"minified",
"CSS",
"filename",
"from",
"the",
"passed",
"filename",
".",
"If",
"the",
"passed",
"filename",
"is",
"already",
"minified",
"it",
"is",
"returned",
"as",
"is",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/CSSFilenameHelper.java#L86-L94 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderSettings.java | CSSReaderSettings.setCSSVersion | @Nonnull
public CSSReaderSettings setCSSVersion (@Nonnull final ECSSVersion eCSSVersion)
{
ValueEnforcer.notNull (eCSSVersion, "CSSVersion");
m_eCSSVersion = eCSSVersion;
return this;
} | java | @Nonnull
public CSSReaderSettings setCSSVersion (@Nonnull final ECSSVersion eCSSVersion)
{
ValueEnforcer.notNull (eCSSVersion, "CSSVersion");
m_eCSSVersion = eCSSVersion;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSReaderSettings",
"setCSSVersion",
"(",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eCSSVersion",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"eCSSVersion",
",",
"\"CSSVersion\"",
")",
";",
"m_eCSSVersion",
"=",
"eCSSVersion",
";",
"r... | Set the CSS version to be read.
@param eCSSVersion
The version number to use. May not be <code>null</code>.
@return this | [
"Set",
"the",
"CSS",
"version",
"to",
"be",
"read",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderSettings.java#L88-L94 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderSettings.java | CSSReaderSettings.setTabSize | @Nonnull
public CSSReaderSettings setTabSize (@Nonnegative final int nTabSize)
{
ValueEnforcer.isGT0 (nTabSize, "TabSize");
m_nTabSize = nTabSize;
return this;
} | java | @Nonnull
public CSSReaderSettings setTabSize (@Nonnegative final int nTabSize)
{
ValueEnforcer.isGT0 (nTabSize, "TabSize");
m_nTabSize = nTabSize;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSReaderSettings",
"setTabSize",
"(",
"@",
"Nonnegative",
"final",
"int",
"nTabSize",
")",
"{",
"ValueEnforcer",
".",
"isGT0",
"(",
"nTabSize",
",",
"\"TabSize\"",
")",
";",
"m_nTabSize",
"=",
"nTabSize",
";",
"return",
"this",
";",... | Set the tab size to be used to determine the source location.
@param nTabSize
The tab size to use. Must be > 0.
@return this for chaining
@since 5.0.2 | [
"Set",
"the",
"tab",
"size",
"to",
"be",
"used",
"to",
"determine",
"the",
"source",
"location",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderSettings.java#L224-L230 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSDataURLHelper.java | CSSDataURLHelper.parseDataURL | @Nullable
public static CSSDataURL parseDataURL (@Nullable final String sDataURL)
{
if (!isDataURL (sDataURL))
return null;
// Skip the constant prefix
final String sRest = sDataURL.trim ().substring (PREFIX_DATA_URL.length ());
if (StringHelper.hasNoText (sRest))
{
// Plain "data:"... | java | @Nullable
public static CSSDataURL parseDataURL (@Nullable final String sDataURL)
{
if (!isDataURL (sDataURL))
return null;
// Skip the constant prefix
final String sRest = sDataURL.trim ().substring (PREFIX_DATA_URL.length ());
if (StringHelper.hasNoText (sRest))
{
// Plain "data:"... | [
"@",
"Nullable",
"public",
"static",
"CSSDataURL",
"parseDataURL",
"(",
"@",
"Nullable",
"final",
"String",
"sDataURL",
")",
"{",
"if",
"(",
"!",
"isDataURL",
"(",
"sDataURL",
")",
")",
"return",
"null",
";",
"// Skip the constant prefix",
"final",
"String",
"... | Parse a data URL into this type.
<pre>
Syntax
dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
mediatype := [ type "/" subtype ] *( ";" parameter )
data := *urlchar
parameter := attribute "=" value
</pre>
@param sDataURL
The data URL to be parsed. May be <code>null</code>.
@return <code>null</code> ... | [
"Parse",
"a",
"data",
"URL",
"into",
"this",
"type",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSDataURLHelper.java#L110-L243 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSImportRule.java | CSSImportRule.addMediaQuery | @Nonnull
public CSSImportRule addMediaQuery (@Nonnull final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
m_aMediaQueries.add (aMediaQuery);
return this;
} | java | @Nonnull
public CSSImportRule addMediaQuery (@Nonnull final CSSMediaQuery aMediaQuery)
{
ValueEnforcer.notNull (aMediaQuery, "MediaQuery");
m_aMediaQueries.add (aMediaQuery);
return this;
} | [
"@",
"Nonnull",
"public",
"CSSImportRule",
"addMediaQuery",
"(",
"@",
"Nonnull",
"final",
"CSSMediaQuery",
"aMediaQuery",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aMediaQuery",
",",
"\"MediaQuery\"",
")",
";",
"m_aMediaQueries",
".",
"add",
"(",
"aMediaQue... | Add a media query at the end of the list.
@param aMediaQuery
The media query to be added. May not be <code>null</code>.
@return this | [
"Add",
"a",
"media",
"query",
"at",
"the",
"end",
"of",
"the",
"list",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSImportRule.java#L87-L94 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSImportRule.java | CSSImportRule.setLocation | @Nonnull
public CSSImportRule setLocation (@Nonnull final CSSURI aLocation)
{
ValueEnforcer.notNull (aLocation, "Location");
m_aLocation = aLocation;
return this;
} | java | @Nonnull
public CSSImportRule setLocation (@Nonnull final CSSURI aLocation)
{
ValueEnforcer.notNull (aLocation, "Location");
m_aLocation = aLocation;
return this;
} | [
"@",
"Nonnull",
"public",
"CSSImportRule",
"setLocation",
"(",
"@",
"Nonnull",
"final",
"CSSURI",
"aLocation",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aLocation",
",",
"\"Location\"",
")",
";",
"m_aLocation",
"=",
"aLocation",
";",
"return",
"this",
"... | Set the URI of the file to be imported.
@param aLocation
The location to use. May not be <code>null</code>.
@return this; | [
"Set",
"the",
"URI",
"of",
"the",
"file",
"to",
"be",
"imported",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSImportRule.java#L193-L200 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSNumberHelper.java | CSSNumberHelper.isNumberValue | public static boolean isNumberValue (@Nullable final String sCSSValue)
{
final String sRealValue = StringHelper.trim (sCSSValue);
return StringHelper.hasText (sRealValue) && StringParser.isDouble (sRealValue);
} | java | public static boolean isNumberValue (@Nullable final String sCSSValue)
{
final String sRealValue = StringHelper.trim (sCSSValue);
return StringHelper.hasText (sRealValue) && StringParser.isDouble (sRealValue);
} | [
"public",
"static",
"boolean",
"isNumberValue",
"(",
"@",
"Nullable",
"final",
"String",
"sCSSValue",
")",
"{",
"final",
"String",
"sRealValue",
"=",
"StringHelper",
".",
"trim",
"(",
"sCSSValue",
")",
";",
"return",
"StringHelper",
".",
"hasText",
"(",
"sReal... | Check if the passed value is a pure numeric value without a unit.
@param sCSSValue
The value to be checked. May be <code>null</code> and is
automatically trimmed inside.
@return <code>true</code> if the passed value is a pure decimal numeric
value after trimming, <code>false</code> otherwise. | [
"Check",
"if",
"the",
"passed",
"value",
"is",
"a",
"pure",
"numeric",
"value",
"without",
"a",
"unit",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSNumberHelper.java#L110-L114 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/parser/CSSNode.java | CSSNode.jjtAddChild | public void jjtAddChild (final Node aNode, final int nIndex)
{
if (m_aChildren == null)
m_aChildren = new CSSNode [nIndex + 1];
else
if (nIndex >= m_aChildren.length)
{
// Does not really occur here
final CSSNode [] aTmpArray = new CSSNode [nIndex + 1];
System.arrayco... | java | public void jjtAddChild (final Node aNode, final int nIndex)
{
if (m_aChildren == null)
m_aChildren = new CSSNode [nIndex + 1];
else
if (nIndex >= m_aChildren.length)
{
// Does not really occur here
final CSSNode [] aTmpArray = new CSSNode [nIndex + 1];
System.arrayco... | [
"public",
"void",
"jjtAddChild",
"(",
"final",
"Node",
"aNode",
",",
"final",
"int",
"nIndex",
")",
"{",
"if",
"(",
"m_aChildren",
"==",
"null",
")",
"m_aChildren",
"=",
"new",
"CSSNode",
"[",
"nIndex",
"+",
"1",
"]",
";",
"else",
"if",
"(",
"nIndex",
... | Called from the highest index to the lowest index! | [
"Called",
"from",
"the",
"highest",
"index",
"to",
"the",
"lowest",
"index!"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/parser/CSSNode.java#L84-L97 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.addTermSimple | @Nonnull
public CSSExpression addTermSimple (@Nonnull @Nonempty final String sValue)
{
return addMember (new CSSExpressionMemberTermSimple (sValue));
} | java | @Nonnull
public CSSExpression addTermSimple (@Nonnull @Nonempty final String sValue)
{
return addMember (new CSSExpressionMemberTermSimple (sValue));
} | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addTermSimple",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sValue",
")",
"{",
"return",
"addMember",
"(",
"new",
"CSSExpressionMemberTermSimple",
"(",
"sValue",
")",
")",
";",
"}"
] | Shortcut method to add a simple text value.
@param sValue
The value to be added. May neither be <code>null</code> nor empty.
@return this | [
"Shortcut",
"method",
"to",
"add",
"a",
"simple",
"text",
"value",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L97-L101 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.addString | @Nonnull
public CSSExpression addString (@Nonnegative final int nIndex, @Nonnull final String sValue)
{
return addTermSimple (nIndex, getQuotedStringValue (sValue));
} | java | @Nonnull
public CSSExpression addString (@Nonnegative final int nIndex, @Nonnull final String sValue)
{
return addTermSimple (nIndex, getQuotedStringValue (sValue));
} | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addString",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"@",
"Nonnull",
"final",
"String",
"sValue",
")",
"{",
"return",
"addTermSimple",
"(",
"nIndex",
",",
"getQuotedStringValue",
"(",
"sValue",
")",
")... | Shortcut method to add a string value that is automatically quoted inside
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param sValue
The value to be quoted and than added. May not be <code>null</code>.
@return this | [
"Shortcut",
"method",
"to",
"add",
"a",
"string",
"value",
"that",
"is",
"automatically",
"quoted",
"inside"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L272-L276 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.addURI | @Nonnull
public CSSExpression addURI (@Nonnull @Nonempty final String sURI)
{
return addMember (new CSSExpressionMemberTermURI (sURI));
} | java | @Nonnull
public CSSExpression addURI (@Nonnull @Nonempty final String sURI)
{
return addMember (new CSSExpressionMemberTermURI (sURI));
} | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addURI",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sURI",
")",
"{",
"return",
"addMember",
"(",
"new",
"CSSExpressionMemberTermURI",
"(",
"sURI",
")",
")",
";",
"}"
] | Shortcut method to add a URI value
@param sURI
The value to be added. May neither be <code>null</code> nor empty
@return this | [
"Shortcut",
"method",
"to",
"add",
"a",
"URI",
"value"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L285-L289 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.createSimple | @Nonnull
public static CSSExpression createSimple (@Nonnull @Nonempty final String sValue)
{
return new CSSExpression ().addTermSimple (sValue);
} | java | @Nonnull
public static CSSExpression createSimple (@Nonnull @Nonempty final String sValue)
{
return new CSSExpression ().addTermSimple (sValue);
} | [
"@",
"Nonnull",
"public",
"static",
"CSSExpression",
"createSimple",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sValue",
")",
"{",
"return",
"new",
"CSSExpression",
"(",
")",
".",
"addTermSimple",
"(",
"sValue",
")",
";",
"}"
] | Create a CSS expression only containing a text value
@param sValue
The value to be wrapped in an expression
@return The CSS expression to be used. | [
"Create",
"a",
"CSS",
"expression",
"only",
"containing",
"a",
"text",
"value"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L450-L454 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.createString | @Nonnull
public static CSSExpression createString (@Nonnull @Nonempty final String sValue)
{
return new CSSExpression ().addString (sValue);
} | java | @Nonnull
public static CSSExpression createString (@Nonnull @Nonempty final String sValue)
{
return new CSSExpression ().addString (sValue);
} | [
"@",
"Nonnull",
"public",
"static",
"CSSExpression",
"createString",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sValue",
")",
"{",
"return",
"new",
"CSSExpression",
"(",
")",
".",
"addString",
"(",
"sValue",
")",
";",
"}"
] | Create a CSS expression only containing a string
@param sValue
The value to be wrapped in a string
@return The CSS expression to be used. | [
"Create",
"a",
"CSS",
"expression",
"only",
"containing",
"a",
"string"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L463-L467 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.createURI | @Nonnull
public static CSSExpression createURI (@Nonnull @Nonempty final String sURI)
{
return new CSSExpression ().addURI (sURI);
} | java | @Nonnull
public static CSSExpression createURI (@Nonnull @Nonempty final String sURI)
{
return new CSSExpression ().addURI (sURI);
} | [
"@",
"Nonnull",
"public",
"static",
"CSSExpression",
"createURI",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sURI",
")",
"{",
"return",
"new",
"CSSExpression",
"(",
")",
".",
"addURI",
"(",
"sURI",
")",
";",
"}"
] | Create a CSS expression only containing a URI
@param sURI
The URI to be wrapped in an expression
@return The CSS expression to be used. | [
"Create",
"a",
"CSS",
"expression",
"only",
"containing",
"a",
"URI"
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L528-L532 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java | CSSDataURL.getCharsetFromMimeTypeOrDefault | @Nonnull
public static Charset getCharsetFromMimeTypeOrDefault (@Nullable final IMimeType aMimeType)
{
final Charset ret = MimeTypeHelper.getCharsetFromMimeType (aMimeType);
return ret != null ? ret : CSSDataURLHelper.DEFAULT_CHARSET;
} | java | @Nonnull
public static Charset getCharsetFromMimeTypeOrDefault (@Nullable final IMimeType aMimeType)
{
final Charset ret = MimeTypeHelper.getCharsetFromMimeType (aMimeType);
return ret != null ? ret : CSSDataURLHelper.DEFAULT_CHARSET;
} | [
"@",
"Nonnull",
"public",
"static",
"Charset",
"getCharsetFromMimeTypeOrDefault",
"(",
"@",
"Nullable",
"final",
"IMimeType",
"aMimeType",
")",
"{",
"final",
"Charset",
"ret",
"=",
"MimeTypeHelper",
".",
"getCharsetFromMimeType",
"(",
"aMimeType",
")",
";",
"return"... | Determine the charset from the passed MIME type. If no charset was found,
return the default charset.
@param aMimeType
The MIME type to investigate.
@return Never <code>null</code>. | [
"Determine",
"the",
"charset",
"from",
"the",
"passed",
"MIME",
"type",
".",
"If",
"no",
"charset",
"was",
"found",
"return",
"the",
"default",
"charset",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java#L69-L74 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java | CSSDataURL.writeContentBytes | public void writeContentBytes (@Nonnull @WillNotClose final OutputStream aOS) throws IOException
{
aOS.write (m_aContent, 0, m_aContent.length);
} | java | public void writeContentBytes (@Nonnull @WillNotClose final OutputStream aOS) throws IOException
{
aOS.write (m_aContent, 0, m_aContent.length);
} | [
"public",
"void",
"writeContentBytes",
"(",
"@",
"Nonnull",
"@",
"WillNotClose",
"final",
"OutputStream",
"aOS",
")",
"throws",
"IOException",
"{",
"aOS",
".",
"write",
"(",
"m_aContent",
",",
"0",
",",
"m_aContent",
".",
"length",
")",
";",
"}"
] | Write all the binary content to the passed output stream. No Base64
encoding is performed in this method.
@param aOS
The output stream to write to. May not be <code>null</code>.
@throws IOException
from OutputStream | [
"Write",
"all",
"the",
"binary",
"content",
"to",
"the",
"passed",
"output",
"stream",
".",
"No",
"Base64",
"encoding",
"is",
"performed",
"in",
"this",
"method",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java#L244-L247 | train |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java | CSSDataURL.getContentAsString | @Nonnull
public String getContentAsString (@Nonnull final Charset aCharset)
{
if (m_aCharset.equals (aCharset))
{
// Potentially return cached version
return getContentAsString ();
}
return new String (m_aContent, aCharset);
} | java | @Nonnull
public String getContentAsString (@Nonnull final Charset aCharset)
{
if (m_aCharset.equals (aCharset))
{
// Potentially return cached version
return getContentAsString ();
}
return new String (m_aContent, aCharset);
} | [
"@",
"Nonnull",
"public",
"String",
"getContentAsString",
"(",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"if",
"(",
"m_aCharset",
".",
"equals",
"(",
"aCharset",
")",
")",
"{",
"// Potentially return cached version",
"return",
"getContentAsString",
... | Get the data content of this Data URL as String in the specified charset.
No Base64 encoding is performed in this method.
@param aCharset
The charset to be used. May not be <code>null</code>.
@return The content in a String representation using the provided charset.
Never <code>null</code>. | [
"Get",
"the",
"data",
"content",
"of",
"this",
"Data",
"URL",
"as",
"String",
"in",
"the",
"specified",
"charset",
".",
"No",
"Base64",
"encoding",
"is",
"performed",
"in",
"this",
"method",
"."
] | c9da5bb4decc681de6e27ce31712aad4c00adafa | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java#L304-L313 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriterFactory.java | DelimiterWriterFactory.addColumnTitles | public DelimiterWriterFactory addColumnTitles(final Collection<String> columnTitles) {
if (columnTitles != null) {
for (final String columnTitle : columnTitles) {
addColumnTitle(columnTitle);
}
}
return this;
} | java | public DelimiterWriterFactory addColumnTitles(final Collection<String> columnTitles) {
if (columnTitles != null) {
for (final String columnTitle : columnTitles) {
addColumnTitle(columnTitle);
}
}
return this;
} | [
"public",
"DelimiterWriterFactory",
"addColumnTitles",
"(",
"final",
"Collection",
"<",
"String",
">",
"columnTitles",
")",
"{",
"if",
"(",
"columnTitles",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"String",
"columnTitle",
":",
"columnTitles",
")",
"{",
"ad... | Convenience method to add a series of cols in one go.
@param columnTitles
@return this
@since 4.0 | [
"Convenience",
"method",
"to",
"add",
"a",
"series",
"of",
"cols",
"in",
"one",
"go",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriterFactory.java#L81-L88 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.getDelimiterOffset | public static int getDelimiterOffset(final String line, final int start, final char delimiter) {
int idx = line.indexOf(delimiter, start);
if (idx >= 0) {
idx -= start - 1;
}
return idx;
} | java | public static int getDelimiterOffset(final String line, final int start, final char delimiter) {
int idx = line.indexOf(delimiter, start);
if (idx >= 0) {
idx -= start - 1;
}
return idx;
} | [
"public",
"static",
"int",
"getDelimiterOffset",
"(",
"final",
"String",
"line",
",",
"final",
"int",
"start",
",",
"final",
"char",
"delimiter",
")",
"{",
"int",
"idx",
"=",
"line",
".",
"indexOf",
"(",
"delimiter",
",",
"start",
")",
";",
"if",
"(",
... | reads from the specified point in the line and returns how many chars to
the specified delimiter
@param line
@param start
@param delimiter
@return int | [
"reads",
"from",
"the",
"specified",
"point",
"in",
"the",
"line",
"and",
"returns",
"how",
"many",
"chars",
"to",
"the",
"specified",
"delimiter"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L301-L307 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.lTrim | public static String lTrim(final String value) {
if (value == null) {
return null;
}
String trimmed = value;
int offset = 0;
final int maxLength = value.length();
while (offset < maxLength && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t... | java | public static String lTrim(final String value) {
if (value == null) {
return null;
}
String trimmed = value;
int offset = 0;
final int maxLength = value.length();
while (offset < maxLength && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t... | [
"public",
"static",
"String",
"lTrim",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"trimmed",
"=",
"value",
";",
"int",
"offset",
"=",
"0",
";",
"final",
"int",
"maxLeng... | Removes empty space from the beginning of a string
@param value -
to be trimmed
@return String | [
"Removes",
"empty",
"space",
"from",
"the",
"beginning",
"of",
"a",
"string"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L316-L333 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.rTrim | public static String rTrim(final String value) {
if (value == null) {
return null;
}
String trimmed = value;
int offset = value.length() - 1;
while (offset > -1 && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t')) {
offset--;
... | java | public static String rTrim(final String value) {
if (value == null) {
return null;
}
String trimmed = value;
int offset = value.length() - 1;
while (offset > -1 && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t')) {
offset--;
... | [
"public",
"static",
"String",
"rTrim",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"trimmed",
"=",
"value",
";",
"int",
"offset",
"=",
"value",
".",
"length",
"(",
")",
... | Removes empty space from the end of a string
@param value -
to be trimmed
@return String | [
"Removes",
"empty",
"space",
"from",
"the",
"end",
"of",
"a",
"string"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L368-L384 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.getPZMetaDataFromFile | public static MetaData getPZMetaDataFromFile(final String line, final char delimiter, final char qualifier, final Parser p,
final boolean addSuffixToDuplicateColumnNames) {
final List<ColumnMetaData> results = new ArrayList<>();
final Set<String> dupCheck = new HashSet<>();
fin... | java | public static MetaData getPZMetaDataFromFile(final String line, final char delimiter, final char qualifier, final Parser p,
final boolean addSuffixToDuplicateColumnNames) {
final List<ColumnMetaData> results = new ArrayList<>();
final Set<String> dupCheck = new HashSet<>();
fin... | [
"public",
"static",
"MetaData",
"getPZMetaDataFromFile",
"(",
"final",
"String",
"line",
",",
"final",
"char",
"delimiter",
",",
"final",
"char",
"qualifier",
",",
"final",
"Parser",
"p",
",",
"final",
"boolean",
"addSuffixToDuplicateColumnNames",
")",
"{",
"final... | Returns a list of ColumnMetaData objects. This is for use with delimited
files. The first line of the file which contains data will be used as the
column names
@param line
@param delimiter
@param qualifier
@param p
PZParser used to specify additional option when working with the ColumnMetaData. Can be null
@param addS... | [
"Returns",
"a",
"list",
"of",
"ColumnMetaData",
"objects",
".",
"This",
"is",
"for",
"use",
"with",
"delimited",
"files",
".",
"The",
"first",
"line",
"of",
"the",
"file",
"which",
"contains",
"data",
"will",
"be",
"used",
"as",
"the",
"column",
"names"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L399-L425 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.isMultiLine | public static boolean isMultiLine(final char[] chrArry, final char delimiter, final char qualifier) {
// check if the last char is the qualifier, if so then this a good
// chance it is not multiline
if (chrArry[chrArry.length - 1] != qualifier) {
// could be a potential line br... | java | public static boolean isMultiLine(final char[] chrArry, final char delimiter, final char qualifier) {
// check if the last char is the qualifier, if so then this a good
// chance it is not multiline
if (chrArry[chrArry.length - 1] != qualifier) {
// could be a potential line br... | [
"public",
"static",
"boolean",
"isMultiLine",
"(",
"final",
"char",
"[",
"]",
"chrArry",
",",
"final",
"char",
"delimiter",
",",
"final",
"char",
"qualifier",
")",
"{",
"// check if the last char is the qualifier, if so then this a good\r",
"// chance it is not multiline\r"... | Determines if the given line is the first part of a multiline record. It does this by verifying that the
qualifer on the last element is not closed
@param chrArry -
char data of the line
@param delimiter -
delimiter being used
@param qualifier -
qualifier being used
@return boolean | [
"Determines",
"if",
"the",
"given",
"line",
"is",
"the",
"first",
"part",
"of",
"a",
"multiline",
"record",
".",
"It",
"does",
"this",
"by",
"verifying",
"that",
"the",
"qualifer",
"on",
"the",
"last",
"element",
"is",
"not",
"closed"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L439-L532 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.stripNonLongChars | public static String stripNonLongChars(final String value) {
final StringBuilder newString = new StringBuilder();
for (int i = 0; i < value.length(); i++) {
final char c = value.charAt(i);
if (c == '.') {
// stop if we hit a decimal point
b... | java | public static String stripNonLongChars(final String value) {
final StringBuilder newString = new StringBuilder();
for (int i = 0; i < value.length(); i++) {
final char c = value.charAt(i);
if (c == '.') {
// stop if we hit a decimal point
b... | [
"public",
"static",
"String",
"stripNonLongChars",
"(",
"final",
"String",
"value",
")",
"{",
"final",
"StringBuilder",
"newString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"value",
".",
"length",
"(",... | Removes chars from the String that could not
be parsed into a Long value
PZStringUtils.stripNonLongChars("1000.25") = "1000"
Method will truncate everything to the right of the decimal
place when encountered.
@param value
@return String | [
"Removes",
"chars",
"from",
"the",
"String",
"that",
"could",
"not",
"be",
"parsed",
"into",
"a",
"Long",
"value"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L696-L717 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.isListElementsEmpty | public static boolean isListElementsEmpty(final List<String> l) {
for (final String s : l) {
if (s != null && s.trim().length() > 0) {
return false;
}
}
return true;
} | java | public static boolean isListElementsEmpty(final List<String> l) {
for (final String s : l) {
if (s != null && s.trim().length() > 0) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isListElementsEmpty",
"(",
"final",
"List",
"<",
"String",
">",
"l",
")",
"{",
"for",
"(",
"final",
"String",
"s",
":",
"l",
")",
"{",
"if",
"(",
"s",
"!=",
"null",
"&&",
"s",
".",
"trim",
"(",
")",
".",
"length",
... | Checks a list of <String> elements to see if every element
in the list is empty.
@param l
List of <String>
@return boolean
true when all elements are empty | [
"Checks",
"a",
"list",
"of",
"<",
";",
"String>",
";",
"elements",
"to",
"see",
"if",
"every",
"element",
"in",
"the",
"list",
"is",
"empty",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L769-L776 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.runPzConverter | public static Object runPzConverter(final Properties classXref, final String value, final Class<?> typeToReturn) {
final String sConverter = classXref.getProperty(typeToReturn.getName());
if (sConverter == null) {
throw new FPConvertException(typeToReturn.getName() + " is not registered i... | java | public static Object runPzConverter(final Properties classXref, final String value, final Class<?> typeToReturn) {
final String sConverter = classXref.getProperty(typeToReturn.getName());
if (sConverter == null) {
throw new FPConvertException(typeToReturn.getName() + " is not registered i... | [
"public",
"static",
"Object",
"runPzConverter",
"(",
"final",
"Properties",
"classXref",
",",
"final",
"String",
"value",
",",
"final",
"Class",
"<",
"?",
">",
"typeToReturn",
")",
"{",
"final",
"String",
"sConverter",
"=",
"classXref",
".",
"getProperty",
"("... | Converts a String value to the appropriate Object via
the correct net.sf.flatpack.converter.PZConverter implementation
@param classXref
Properties holding class cross reference
@param value
Value to be converted to the Object
@param typeToReturn
Type of object to be returned
@throws FPConvertException
@return Object | [
"Converts",
"a",
"String",
"value",
"to",
"the",
"appropriate",
"Object",
"via",
"the",
"correct",
"net",
".",
"sf",
".",
"flatpack",
".",
"converter",
".",
"PZConverter",
"implementation"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L791-L802 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.buildMDFromSQLTable | public static List<ColumnMetaData> buildMDFromSQLTable(final Connection con, final String dataDefinition, final Parser parser)
throws SQLException {
final List<ColumnMetaData> cmds = new ArrayList<>();
final String dfTbl = parser != null ? parser.getDataFileTable() : "DATAFILE";
... | java | public static List<ColumnMetaData> buildMDFromSQLTable(final Connection con, final String dataDefinition, final Parser parser)
throws SQLException {
final List<ColumnMetaData> cmds = new ArrayList<>();
final String dfTbl = parser != null ? parser.getDataFileTable() : "DATAFILE";
... | [
"public",
"static",
"List",
"<",
"ColumnMetaData",
">",
"buildMDFromSQLTable",
"(",
"final",
"Connection",
"con",
",",
"final",
"String",
"dataDefinition",
",",
"final",
"Parser",
"parser",
")",
"throws",
"SQLException",
"{",
"final",
"List",
"<",
"ColumnMetaData"... | Returns a definition of pz column metadata from a given
pz datastructure held in an SQL database
@param con
Database connection containing the Datafile and Datastructure
tables
@param dataDefinition
Name of the data definition stored in the Datafile table
@param parser
Instance of the parser being used for the file. ... | [
"Returns",
"a",
"definition",
"of",
"pz",
"column",
"metadata",
"from",
"a",
"given",
"pz",
"datastructure",
"held",
"in",
"an",
"SQL",
"database"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L819-L854 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java | FixedWidthParserUtils.splitFixedText | public static List<String> splitFixedText(final List<ColumnMetaData> columnMetaData, final String lineToParse,
final boolean preserveLeadingWhitespace, final boolean preserveTrailingWhitespace) {
final List<String> splitResult = new ArrayList<>();
int recPosition = 1;
for (final ... | java | public static List<String> splitFixedText(final List<ColumnMetaData> columnMetaData, final String lineToParse,
final boolean preserveLeadingWhitespace, final boolean preserveTrailingWhitespace) {
final List<String> splitResult = new ArrayList<>();
int recPosition = 1;
for (final ... | [
"public",
"static",
"List",
"<",
"String",
">",
"splitFixedText",
"(",
"final",
"List",
"<",
"ColumnMetaData",
">",
"columnMetaData",
",",
"final",
"String",
"lineToParse",
",",
"final",
"boolean",
"preserveLeadingWhitespace",
",",
"final",
"boolean",
"preserveTrail... | Splits up a fixed width line of text
@param columnMetaData
Collection of ColumnMetaData to parse the line
@param lineToParse
Line of text to be parsed against the ColumnMetaData
@param preserveLeadingWhitespace
Keep any leading spaces
@param preserveTrailingWhitespace
Keep any trailing spaces
@return List Collection o... | [
"Splits",
"up",
"a",
"fixed",
"width",
"line",
"of",
"text"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java#L66-L86 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java | FixedWidthParserUtils.getCMDKey | public static String getCMDKey(final MetaData columnMD, final String line) {
if (!columnMD.isAnyRecordFormatSpecified()) {
// no <RECORD> elements were specified for this parse, just return the
// detail id
return FPConstants.DETAIL_ID;
}
final Iterator<... | java | public static String getCMDKey(final MetaData columnMD, final String line) {
if (!columnMD.isAnyRecordFormatSpecified()) {
// no <RECORD> elements were specified for this parse, just return the
// detail id
return FPConstants.DETAIL_ID;
}
final Iterator<... | [
"public",
"static",
"String",
"getCMDKey",
"(",
"final",
"MetaData",
"columnMD",
",",
"final",
"String",
"line",
")",
"{",
"if",
"(",
"!",
"columnMD",
".",
"isAnyRecordFormatSpecified",
"(",
")",
")",
"{",
"// no <RECORD> elements were specified for this parse, just r... | Returns the key to the list of ColumnMetaData objects. Returns the
correct MetaData per the mapping file and the data contained on the line
@param columnMD
@param line
@return List - ColumMetaData | [
"Returns",
"the",
"key",
"to",
"the",
"list",
"of",
"ColumnMetaData",
"objects",
".",
"Returns",
"the",
"correct",
"MetaData",
"per",
"the",
"mapping",
"file",
"and",
"the",
"data",
"contained",
"on",
"the",
"line"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java#L97-L127 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/xml/XMLRecordElement.java | XMLRecordElement.getColumnIndex | public int getColumnIndex(final String colName) {
int idx = -1;
if (columnIndex != null) {
final Integer i = columnIndex.get(colName);
if (i != null) {
idx = i.intValue();
}
}
return idx;
} | java | public int getColumnIndex(final String colName) {
int idx = -1;
if (columnIndex != null) {
final Integer i = columnIndex.get(colName);
if (i != null) {
idx = i.intValue();
}
}
return idx;
} | [
"public",
"int",
"getColumnIndex",
"(",
"final",
"String",
"colName",
")",
"{",
"int",
"idx",
"=",
"-",
"1",
";",
"if",
"(",
"columnIndex",
"!=",
"null",
")",
"{",
"final",
"Integer",
"i",
"=",
"columnIndex",
".",
"get",
"(",
"colName",
")",
";",
"if... | Returns the index of the column name.
@author Benoit Xhenseval
@param colName
@return -1 if the column name does not exist. | [
"Returns",
"the",
"index",
"of",
"the",
"column",
"name",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/xml/XMLRecordElement.java#L124-L133 | train |
Appendium/flatpack | flatpack-excel/src/main/java/net/sf/flatpack/excel/ExcelTransformer.java | ExcelTransformer.writeExcelFile | public void writeExcelFile() throws IOException, WriteException {
WritableWorkbook excelWrkBook = null;
int curDsPointer = 0;
try {
final String[] columnNames = ds.getColumns();
final List<String> exportOnlyColumnsList = getExportOnlyColumns() != null ? Arrays.asLi... | java | public void writeExcelFile() throws IOException, WriteException {
WritableWorkbook excelWrkBook = null;
int curDsPointer = 0;
try {
final String[] columnNames = ds.getColumns();
final List<String> exportOnlyColumnsList = getExportOnlyColumns() != null ? Arrays.asLi... | [
"public",
"void",
"writeExcelFile",
"(",
")",
"throws",
"IOException",
",",
"WriteException",
"{",
"WritableWorkbook",
"excelWrkBook",
"=",
"null",
";",
"int",
"curDsPointer",
"=",
"0",
";",
"try",
"{",
"final",
"String",
"[",
"]",
"columnNames",
"=",
"ds",
... | Writes the Excel file to disk
@throws IOException
@throws WriteException | [
"Writes",
"the",
"Excel",
"file",
"to",
"disk"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack-excel/src/main/java/net/sf/flatpack/excel/ExcelTransformer.java#L74-L147 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java | DefaultDataSet.absolute | @Override
public void absolute(final int localPointer) {
if (localPointer < 0 || localPointer >= rows.size()) {
throw new IndexOutOfBoundsException("INVALID POINTER LOCATION: " + localPointer);
}
pointer = localPointer;
currentRecord = new RowRecord(rows.get(point... | java | @Override
public void absolute(final int localPointer) {
if (localPointer < 0 || localPointer >= rows.size()) {
throw new IndexOutOfBoundsException("INVALID POINTER LOCATION: " + localPointer);
}
pointer = localPointer;
currentRecord = new RowRecord(rows.get(point... | [
"@",
"Override",
"public",
"void",
"absolute",
"(",
"final",
"int",
"localPointer",
")",
"{",
"if",
"(",
"localPointer",
"<",
"0",
"||",
"localPointer",
">=",
"rows",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"INV... | Sets the absolute position of the record pointer
@param localPointer
- int
@exception IndexOutOfBoundsException if wrong index | [
"Sets",
"the",
"absolute",
"position",
"of",
"the",
"record",
"pointer"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java#L421-L430 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java | MapParser.convertAttributeToInt | private static int convertAttributeToInt(final String attribute) {
if (attribute == null) {
return 0;
}
try {
return Integer.parseInt(attribute);
} catch (final Exception ignore) {
return 0;
}
} | java | private static int convertAttributeToInt(final String attribute) {
if (attribute == null) {
return 0;
}
try {
return Integer.parseInt(attribute);
} catch (final Exception ignore) {
return 0;
}
} | [
"private",
"static",
"int",
"convertAttributeToInt",
"(",
"final",
"String",
"attribute",
")",
"{",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"attribute",
")",
";",
"}"... | helper to convert to integer | [
"helper",
"to",
"convert",
"to",
"integer"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java#L195-L205 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/FlatpackWriterUtil.java | FlatpackWriterUtil.buildParametersForColumns | public static Map<String, Object> buildParametersForColumns(final String colsAsCsv) {
final Map<String, Object> mapping = new HashMap<>();
mapping.put(FPConstants.DETAIL_ID, buildColumns(colsAsCsv));
return mapping;
} | java | public static Map<String, Object> buildParametersForColumns(final String colsAsCsv) {
final Map<String, Object> mapping = new HashMap<>();
mapping.put(FPConstants.DETAIL_ID, buildColumns(colsAsCsv));
return mapping;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"buildParametersForColumns",
"(",
"final",
"String",
"colsAsCsv",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"mapping",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"mapping",
... | Creates a Mapping for a WriterFactory for the given list of columns.
@param colsAsCsv comma-separated column names
@return a map to be used in, for instance, DelimiterWriterFactory | [
"Creates",
"a",
"Mapping",
"for",
"a",
"WriterFactory",
"for",
"the",
"given",
"list",
"of",
"columns",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/FlatpackWriterUtil.java#L27-L31 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/FlatpackWriterUtil.java | FlatpackWriterUtil.buildColumns | public static List<ColumnMetaData> buildColumns(final String colsAsCsv) {
final List<ColumnMetaData> listCol = new ArrayList<>();
buildColumns(listCol, colsAsCsv);
return listCol;
} | java | public static List<ColumnMetaData> buildColumns(final String colsAsCsv) {
final List<ColumnMetaData> listCol = new ArrayList<>();
buildColumns(listCol, colsAsCsv);
return listCol;
} | [
"public",
"static",
"List",
"<",
"ColumnMetaData",
">",
"buildColumns",
"(",
"final",
"String",
"colsAsCsv",
")",
"{",
"final",
"List",
"<",
"ColumnMetaData",
">",
"listCol",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"buildColumns",
"(",
"listCol",
",",
... | Create a new list of ColumnMetaData based on a CSV list of column titles.
@param colsAsCsv
@return new list | [
"Create",
"a",
"new",
"list",
"of",
"ColumnMetaData",
"based",
"on",
"a",
"CSV",
"list",
"of",
"column",
"titles",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/FlatpackWriterUtil.java#L38-L42 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/AbstractParser.java | AbstractParser.addToCloseReaderList | protected void addToCloseReaderList(final Reader r) {
if (readersToClose == null) {
readersToClose = new ArrayList<>();
}
readersToClose.add(r);
} | java | protected void addToCloseReaderList(final Reader r) {
if (readersToClose == null) {
readersToClose = new ArrayList<>();
}
readersToClose.add(r);
} | [
"protected",
"void",
"addToCloseReaderList",
"(",
"final",
"Reader",
"r",
")",
"{",
"if",
"(",
"readersToClose",
"==",
"null",
")",
"{",
"readersToClose",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"readersToClose",
".",
"add",
"(",
"r",
")",
";"... | is completed. | [
"is",
"completed",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java#L211-L216 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java | AbstractDelimiterParser.fetchNextRecord | protected String fetchNextRecord(final BufferedReader br, final char qual, final char delim) throws IOException {
String line = null;
final StringBuilder lineData = new StringBuilder();
boolean processingMultiLine = false;
while ((line = br.readLine()) != null) {
lineC... | java | protected String fetchNextRecord(final BufferedReader br, final char qual, final char delim) throws IOException {
String line = null;
final StringBuilder lineData = new StringBuilder();
boolean processingMultiLine = false;
while ((line = br.readLine()) != null) {
lineC... | [
"protected",
"String",
"fetchNextRecord",
"(",
"final",
"BufferedReader",
"br",
",",
"final",
"char",
"qual",
",",
"final",
"char",
"delim",
")",
"throws",
"IOException",
"{",
"String",
"line",
"=",
"null",
";",
"final",
"StringBuilder",
"lineData",
"=",
"new"... | Reads a record from a delimited file. This will account for records which
could span multiple lines.
NULL will be returned when the end of the file is reached
@param br
Open reader being used to read through the file
@param qual
Qualifier being used for parse
@param delim
Delimiter being used for parse
@return String... | [
"Reads",
"a",
"record",
"from",
"a",
"delimited",
"file",
".",
"This",
"will",
"account",
"for",
"records",
"which",
"could",
"span",
"multiple",
"lines",
".",
"NULL",
"will",
"be",
"returned",
"when",
"the",
"end",
"of",
"the",
"file",
"is",
"reached"
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java#L249-L335 | train |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java | OrderBy.compare | @Override
public int compare(final Row row0, final Row row1) {
int result = 0;
for (int i = 0; i < orderbys.size(); i++) {
final OrderColumn oc = orderbys.get(i);
// null indicates "detail" record which is what the parser assigns
// to <column> 's setup ou... | java | @Override
public int compare(final Row row0, final Row row1) {
int result = 0;
for (int i = 0; i < orderbys.size(); i++) {
final OrderColumn oc = orderbys.get(i);
// null indicates "detail" record which is what the parser assigns
// to <column> 's setup ou... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"final",
"Row",
"row0",
",",
"final",
"Row",
"row1",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"orderbys",
".",
"size",
"(",
")",
";",
"i",
"++",... | overridden from the Comparator class.
Performs the sort
@return int | [
"overridden",
"from",
"the",
"Comparator",
"class",
"."
] | 5e09875d97db7038e3ba6af9468f5313d99b0082 | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java#L84-L114 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/PaxExamRuntime.java | PaxExamRuntime.createContainer | public static TestContainer createContainer(String configurationClassName) throws Exception {
Option[] options = getConfigurationOptions(configurationClassName);
ExamSystem system = DefaultExamSystem.create(options);
TestContainer testContainer = PaxExamRuntime.createContainer(system);
t... | java | public static TestContainer createContainer(String configurationClassName) throws Exception {
Option[] options = getConfigurationOptions(configurationClassName);
ExamSystem system = DefaultExamSystem.create(options);
TestContainer testContainer = PaxExamRuntime.createContainer(system);
t... | [
"public",
"static",
"TestContainer",
"createContainer",
"(",
"String",
"configurationClassName",
")",
"throws",
"Exception",
"{",
"Option",
"[",
"]",
"options",
"=",
"getConfigurationOptions",
"(",
"configurationClassName",
")",
";",
"ExamSystem",
"system",
"=",
"Defa... | Creates and starts a test container using options from a configuration class.
@param configurationClassName
fully qualified class name of a configuration class.
@return started test container
@throws Exception when options cannot be parsed | [
"Creates",
"and",
"starts",
"a",
"test",
"container",
"using",
"options",
"from",
"a",
"configuration",
"class",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/PaxExamRuntime.java#L108-L114 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/PaxExamRuntime.java | PaxExamRuntime.waitForStop | private static void waitForStop(TestContainer testContainer, int localPort) {
try {
ServerSocket serverSocket = new ServerSocket(localPort);
Socket socket = serverSocket.accept();
InputStreamReader isr = new InputStreamReader(socket.getInputStream(), "UTF-8");
Bu... | java | private static void waitForStop(TestContainer testContainer, int localPort) {
try {
ServerSocket serverSocket = new ServerSocket(localPort);
Socket socket = serverSocket.accept();
InputStreamReader isr = new InputStreamReader(socket.getInputStream(), "UTF-8");
Bu... | [
"private",
"static",
"void",
"waitForStop",
"(",
"TestContainer",
"testContainer",
",",
"int",
"localPort",
")",
"{",
"try",
"{",
"ServerSocket",
"serverSocket",
"=",
"new",
"ServerSocket",
"(",
"localPort",
")",
";",
"Socket",
"socket",
"=",
"serverSocket",
"."... | Opens a server socket listening for text commands on the given port.
Each command is terminated by a newline. The server expects a "stop" command
followed by a "quit" command.
@param testContainer
@param localPort | [
"Opens",
"a",
"server",
"socket",
"listening",
"for",
"text",
"commands",
"on",
"the",
"given",
"port",
".",
"Each",
"command",
"is",
"terminated",
"by",
"a",
"newline",
".",
"The",
"server",
"expects",
"a",
"stop",
"command",
"followed",
"by",
"a",
"quit"... | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/PaxExamRuntime.java#L124-L156 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/PaxExamRuntime.java | PaxExamRuntime.sanityCheck | private static void sanityCheck() {
List<TestContainerFactory> factories = new ArrayList<TestContainerFactory>();
Iterator<TestContainerFactory> iter = ServiceLoader.load(TestContainerFactory.class)
.iterator();
while (iter.hasNext()) {
factories.add(iter.next());
... | java | private static void sanityCheck() {
List<TestContainerFactory> factories = new ArrayList<TestContainerFactory>();
Iterator<TestContainerFactory> iter = ServiceLoader.load(TestContainerFactory.class)
.iterator();
while (iter.hasNext()) {
factories.add(iter.next());
... | [
"private",
"static",
"void",
"sanityCheck",
"(",
")",
"{",
"List",
"<",
"TestContainerFactory",
">",
"factories",
"=",
"new",
"ArrayList",
"<",
"TestContainerFactory",
">",
"(",
")",
";",
"Iterator",
"<",
"TestContainerFactory",
">",
"iter",
"=",
"ServiceLoader"... | Exits with an exception if Classpath not set up properly. | [
"Exits",
"with",
"an",
"exception",
"if",
"Classpath",
"not",
"set",
"up",
"properly",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/PaxExamRuntime.java#L253-L274 | train |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-forked/src/main/java/org/ops4j/pax/exam/forked/provision/PlatformImpl.java | PlatformImpl.determineCachingName | String determineCachingName(final File file, final String defaultBundleSymbolicName) {
String bundleSymbolicName = null;
String bundleVersion = null;
JarFile jar = null;
try {
// verify that is a valid jar. Do not verify that is signed (the false param).
jar = new... | java | String determineCachingName(final File file, final String defaultBundleSymbolicName) {
String bundleSymbolicName = null;
String bundleVersion = null;
JarFile jar = null;
try {
// verify that is a valid jar. Do not verify that is signed (the false param).
jar = new... | [
"String",
"determineCachingName",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"defaultBundleSymbolicName",
")",
"{",
"String",
"bundleSymbolicName",
"=",
"null",
";",
"String",
"bundleVersion",
"=",
"null",
";",
"JarFile",
"jar",
"=",
"null",
";",
"try... | Determine name to be used for caching on local file system.
@param file
file to be validated
@param defaultBundleSymbolicName
default bundle symbolic name to be used if manifest does not have a bundle
symbolic name
@return file name based on bundle symbolic name and version | [
"Determine",
"name",
"to",
"be",
"used",
"for",
"caching",
"on",
"local",
"file",
"system",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-forked/src/main/java/org/ops4j/pax/exam/forked/provision/PlatformImpl.java#L306-L347 | train |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-forked/src/main/java/org/ops4j/pax/exam/forked/ForkedFrameworkFactory.java | ForkedFrameworkFactory.join | public void join() {
try {
UnicastRemoteObject.unexportObject(registry, true);
/*
* NOTE: javaRunner.waitForExit() works for Equinox and Felix, but not for Knopflerfish,
* need to investigate why. OTOH, it may be better to kill the process as we're doing
... | java | public void join() {
try {
UnicastRemoteObject.unexportObject(registry, true);
/*
* NOTE: javaRunner.waitForExit() works for Equinox and Felix, but not for Knopflerfish,
* need to investigate why. OTOH, it may be better to kill the process as we're doing
... | [
"public",
"void",
"join",
"(",
")",
"{",
"try",
"{",
"UnicastRemoteObject",
".",
"unexportObject",
"(",
"registry",
",",
"true",
")",
";",
"/*\n * NOTE: javaRunner.waitForExit() works for Equinox and Felix, but not for Knopflerfish,\n * need to investigate w... | Waits for the remote framework to shutdown and frees all resources. | [
"Waits",
"for",
"the",
"remote",
"framework",
"to",
"shutdown",
"and",
"frees",
"all",
"resources",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-forked/src/main/java/org/ops4j/pax/exam/forked/ForkedFrameworkFactory.java#L239-L252 | train |
ops4j/org.ops4j.pax.exam2 | samples/pax-exam-sample9-pde/src/org/ops4j/pax/exam/sample9/pde/impl/Activator.java | Activator.stop | public void stop(BundleContext bc) throws Exception {
String blockOnStop = System.getProperty("pax.exam.regression.blockOnStop", "false");
if (Boolean.valueOf(blockOnStop)) {
Thread.sleep(Long.MAX_VALUE);
}
} | java | public void stop(BundleContext bc) throws Exception {
String blockOnStop = System.getProperty("pax.exam.regression.blockOnStop", "false");
if (Boolean.valueOf(blockOnStop)) {
Thread.sleep(Long.MAX_VALUE);
}
} | [
"public",
"void",
"stop",
"(",
"BundleContext",
"bc",
")",
"throws",
"Exception",
"{",
"String",
"blockOnStop",
"=",
"System",
".",
"getProperty",
"(",
"\"pax.exam.regression.blockOnStop\"",
",",
"\"false\"",
")",
";",
"if",
"(",
"Boolean",
".",
"valueOf",
"(",
... | Optionally blocks framework shutdown for a shutdown timeout regression test. | [
"Optionally",
"blocks",
"framework",
"shutdown",
"for",
"a",
"shutdown",
"timeout",
"regression",
"test",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/samples/pax-exam-sample9-pde/src/org/ops4j/pax/exam/sample9/pde/impl/Activator.java#L61-L67 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-cdi/src/main/java/org/ops4j/pax/exam/cdi/impl/CdiInjector.java | CdiInjector.injectFields | @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void injectFields(Object target) {
BeanManager mgr = BeanManagerLookup.getBeanManager();
AnnotatedType annotatedType = mgr.createAnnotatedType(target.getClass());
InjectionTarget injectionTarget = mgr.createInjectionTarget(a... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void injectFields(Object target) {
BeanManager mgr = BeanManagerLookup.getBeanManager();
AnnotatedType annotatedType = mgr.createAnnotatedType(target.getClass());
InjectionTarget injectionTarget = mgr.createInjectionTarget(a... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"@",
"Override",
"public",
"void",
"injectFields",
"(",
"Object",
"target",
")",
"{",
"BeanManager",
"mgr",
"=",
"BeanManagerLookup",
".",
"getBeanManager",
"(",
")",
";",
"Anno... | Injects dependencies into the given target object whose lifecycle is not managed by the
BeanManager itself.
@param target
an object with injection points | [
"Injects",
"dependencies",
"into",
"the",
"given",
"target",
"object",
"whose",
"lifecycle",
"is",
"not",
"managed",
"by",
"the",
"BeanManager",
"itself",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-cdi/src/main/java/org/ops4j/pax/exam/cdi/impl/CdiInjector.java#L43-L51 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam/src/main/java/org/ops4j/pax/exam/options/JarProbeOption.java | JarProbeOption.classes | public JarProbeOption classes(Class<?>... klass) {
for (Class<?> c : klass) {
String resource = c.getName().replaceAll("\\.", "/") + ".class";
resources.add(resource);
}
return this;
} | java | public JarProbeOption classes(Class<?>... klass) {
for (Class<?> c : klass) {
String resource = c.getName().replaceAll("\\.", "/") + ".class";
resources.add(resource);
}
return this;
} | [
"public",
"JarProbeOption",
"classes",
"(",
"Class",
"<",
"?",
">",
"...",
"klass",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"c",
":",
"klass",
")",
"{",
"String",
"resource",
"=",
"c",
".",
"getName",
"(",
")",
".",
"replaceAll",
"(",
"\"\\\\... | Adds the given classes to the JAR.
@param klass
list of classes
@return {@code this} for fluent syntax | [
"Adds",
"the",
"given",
"classes",
"to",
"the",
"JAR",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam/src/main/java/org/ops4j/pax/exam/options/JarProbeOption.java#L76-L82 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam/src/main/java/org/ops4j/pax/exam/options/JarProbeOption.java | JarProbeOption.resources | public JarProbeOption resources(String... resourcePaths) {
for (String resource : resourcePaths) {
resources.add(resource);
}
return this;
} | java | public JarProbeOption resources(String... resourcePaths) {
for (String resource : resourcePaths) {
resources.add(resource);
}
return this;
} | [
"public",
"JarProbeOption",
"resources",
"(",
"String",
"...",
"resourcePaths",
")",
"{",
"for",
"(",
"String",
"resource",
":",
"resourcePaths",
")",
"{",
"resources",
".",
"add",
"(",
"resource",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Adds the given resources from the current class path to the JAR.
@param resourcePaths
list of resource paths, relative to the class path root
@return {@code this} for fluent syntax | [
"Adds",
"the",
"given",
"resources",
"from",
"the",
"current",
"class",
"path",
"to",
"the",
"JAR",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam/src/main/java/org/ops4j/pax/exam/options/JarProbeOption.java#L91-L96 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/JarBuilder.java | JarBuilder.buildJar | public URI buildJar() {
if (option.getName() == null) {
option.name(UUID.randomUUID().toString());
}
try {
File explodedJarDir = getExplodedJarDir();
File probeJar = new File(tempDir, option.getName() + ".jar");
ZipBuilder builder = new ZipBuilder(... | java | public URI buildJar() {
if (option.getName() == null) {
option.name(UUID.randomUUID().toString());
}
try {
File explodedJarDir = getExplodedJarDir();
File probeJar = new File(tempDir, option.getName() + ".jar");
ZipBuilder builder = new ZipBuilder(... | [
"public",
"URI",
"buildJar",
"(",
")",
"{",
"if",
"(",
"option",
".",
"getName",
"(",
")",
"==",
"null",
")",
"{",
"option",
".",
"name",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"}",
"try",
"{",
"File",
"e... | Builds a JAR from the given option.
@return file URI referencing the JAR in a temporary directory | [
"Builds",
"a",
"JAR",
"from",
"the",
"given",
"option",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/JarBuilder.java#L71-L88 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam/src/main/java/org/ops4j/pax/exam/CoreOptions.java | CoreOptions.mavenWar | public static MavenArtifactDeploymentOption mavenWar(final String groupId,
final String artifactId, final String version) {
return mavenWar().groupId(groupId).artifactId(artifactId).version(version).type("war");
} | java | public static MavenArtifactDeploymentOption mavenWar(final String groupId,
final String artifactId, final String version) {
return mavenWar().groupId(groupId).artifactId(artifactId).version(version).type("war");
} | [
"public",
"static",
"MavenArtifactDeploymentOption",
"mavenWar",
"(",
"final",
"String",
"groupId",
",",
"final",
"String",
"artifactId",
",",
"final",
"String",
"version",
")",
"{",
"return",
"mavenWar",
"(",
")",
".",
"groupId",
"(",
"groupId",
")",
".",
"ar... | Deploys a Maven WAR artifact with the given Maven coordinates.
@param groupId
group ID
@param artifactId
artifact ID
@param version
artifact version
@return Maven artifact option | [
"Deploys",
"a",
"Maven",
"WAR",
"artifact",
"with",
"the",
"given",
"Maven",
"coordinates",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam/src/main/java/org/ops4j/pax/exam/CoreOptions.java#L834-L837 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/DefaultExamSystem.java | DefaultExamSystem.createTemp | private synchronized File createTemp(File workingDirectory) throws IOException {
if (workingDirectory == null) {
return createTempDir();
}
else {
workingDirectory.mkdirs();
return workingDirectory;
}
} | java | private synchronized File createTemp(File workingDirectory) throws IOException {
if (workingDirectory == null) {
return createTempDir();
}
else {
workingDirectory.mkdirs();
return workingDirectory;
}
} | [
"private",
"synchronized",
"File",
"createTemp",
"(",
"File",
"workingDirectory",
")",
"throws",
"IOException",
"{",
"if",
"(",
"workingDirectory",
"==",
"null",
")",
"{",
"return",
"createTempDir",
"(",
")",
";",
"}",
"else",
"{",
"workingDirectory",
".",
"mk... | Creates a fresh temp folder under the mentioned working folder. If workingFolder is null,
system wide temp location will be used.
@param workingDirectory | [
"Creates",
"a",
"fresh",
"temp",
"folder",
"under",
"the",
"mentioned",
"working",
"folder",
".",
"If",
"workingFolder",
"is",
"null",
"system",
"wide",
"temp",
"location",
"will",
"be",
"used",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/DefaultExamSystem.java#L155-L163 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-bnd/src/main/java/org/ops4j/pax/exam/bnd/BndtoolsOption.java | BndtoolsOption.bundle | public Option bundle(String bsn) {
Collection<Option> urls = new ArrayList<>();
try {
for (File file : workspace.getProject(bsn).getBuildFiles()) {
urls.add(url(file.toURI().toASCIIString()));
}
} catch (Exception e) {
throw new RuntimeExceptio... | java | public Option bundle(String bsn) {
Collection<Option> urls = new ArrayList<>();
try {
for (File file : workspace.getProject(bsn).getBuildFiles()) {
urls.add(url(file.toURI().toASCIIString()));
}
} catch (Exception e) {
throw new RuntimeExceptio... | [
"public",
"Option",
"bundle",
"(",
"String",
"bsn",
")",
"{",
"Collection",
"<",
"Option",
">",
"urls",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"for",
"(",
"File",
"file",
":",
"workspace",
".",
"getProject",
"(",
"bsn",
")",
".",
... | Add workspace-built bundle of name symbolicName to system-under-test.
@param bsn BSN of bundle to be installed. Will be queried from Bnd Workspace.
@return this. | [
"Add",
"workspace",
"-",
"built",
"bundle",
"of",
"name",
"symbolicName",
"to",
"system",
"-",
"under",
"-",
"test",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-bnd/src/main/java/org/ops4j/pax/exam/bnd/BndtoolsOption.java#L34-L44 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-bnd/src/main/java/org/ops4j/pax/exam/bnd/BndtoolsOption.java | BndtoolsOption.fromBndrun | public Option fromBndrun(String runFileSpec) {
try {
File runFile = workspace.getFile(runFileSpec);
Run bndRunInstruction = new Run(workspace, runFile.getParentFile(), runFile);
return bndToExam(bndRunInstruction);
} catch (Exception e) {
throw new Runtim... | java | public Option fromBndrun(String runFileSpec) {
try {
File runFile = workspace.getFile(runFileSpec);
Run bndRunInstruction = new Run(workspace, runFile.getParentFile(), runFile);
return bndToExam(bndRunInstruction);
} catch (Exception e) {
throw new Runtim... | [
"public",
"Option",
"fromBndrun",
"(",
"String",
"runFileSpec",
")",
"{",
"try",
"{",
"File",
"runFile",
"=",
"workspace",
".",
"getFile",
"(",
"runFileSpec",
")",
";",
"Run",
"bndRunInstruction",
"=",
"new",
"Run",
"(",
"workspace",
",",
"runFile",
".",
"... | Add all bundles resolved by bndrun file to system-under-test.
@param runFileSpec bndrun file to be used.
@return this. | [
"Add",
"all",
"bundles",
"resolved",
"by",
"bndrun",
"file",
"to",
"system",
"-",
"under",
"-",
"test",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-bnd/src/main/java/org/ops4j/pax/exam/bnd/BndtoolsOption.java#L53-L61 | train |
ops4j/org.ops4j.pax.exam2 | legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java | GenerateConfigMojo.getProvisionableDependencies | private List<Dependency> getProvisionableDependencies()
{
List<Dependency> dependencies = new ArrayList<Dependency>();
getLog().info( "Adding dependencies in scope " + dependencyScope );
for( Dependency d : getDependencies() )
{
if( d.getScope() != null && d.getScope().eq... | java | private List<Dependency> getProvisionableDependencies()
{
List<Dependency> dependencies = new ArrayList<Dependency>();
getLog().info( "Adding dependencies in scope " + dependencyScope );
for( Dependency d : getDependencies() )
{
if( d.getScope() != null && d.getScope().eq... | [
"private",
"List",
"<",
"Dependency",
">",
"getProvisionableDependencies",
"(",
")",
"{",
"List",
"<",
"Dependency",
">",
"dependencies",
"=",
"new",
"ArrayList",
"<",
"Dependency",
">",
"(",
")",
";",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Adding dependen... | Dependency resolution inspired by servicemix depends-maven-plguin
@return list of dependencies to be written to disk. | [
"Dependency",
"resolution",
"inspired",
"by",
"servicemix",
"depends",
"-",
"maven",
"-",
"plguin"
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java#L196-L209 | train |
ops4j/org.ops4j.pax.exam2 | legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java | GenerateConfigMojo.createPaxRunnerScan | private String createPaxRunnerScan( Artifact artifact, String optionTokens )
{
return "scan-bundle:" + artifact.getFile().toURI().normalize().toString() + "@update" + optionTokens;
} | java | private String createPaxRunnerScan( Artifact artifact, String optionTokens )
{
return "scan-bundle:" + artifact.getFile().toURI().normalize().toString() + "@update" + optionTokens;
} | [
"private",
"String",
"createPaxRunnerScan",
"(",
"Artifact",
"artifact",
",",
"String",
"optionTokens",
")",
"{",
"return",
"\"scan-bundle:\"",
"+",
"artifact",
".",
"getFile",
"(",
")",
".",
"toURI",
"(",
")",
".",
"normalize",
"(",
")",
".",
"toString",
"(... | Creates scanner directives from artifact to be parsed by pax runner.
Also includes options found and matched in settings part of configuration.
@param artifact to be used to create scanner directive.
@param optionTokens to be used to create scanner directive.
@return pax runner compatible scanner directive. | [
"Creates",
"scanner",
"directives",
"from",
"artifact",
"to",
"be",
"parsed",
"by",
"pax",
"runner",
".",
"Also",
"includes",
"options",
"found",
"and",
"matched",
"in",
"settings",
"part",
"of",
"configuration",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/legacy/maven-paxexam-plugin/src/main/java/org/ops4j/pax/exam/mavenplugin/GenerateConfigMojo.java#L310-L313 | train |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-wildfly80/src/main/java/org/ops4j/pax/exam/wildfly80/ZipInstaller.java | ZipInstaller.downloadAndInstall | public void downloadAndInstall() throws IOException {
installDir.mkdirs();
File tempFile = File.createTempFile("pax-exam", ".zip");
FileOutputStream os = null;
LOG.info("downloading {} to {}", zipUrl, tempFile);
try {
os = new FileOutputStream(tempFile);
... | java | public void downloadAndInstall() throws IOException {
installDir.mkdirs();
File tempFile = File.createTempFile("pax-exam", ".zip");
FileOutputStream os = null;
LOG.info("downloading {} to {}", zipUrl, tempFile);
try {
os = new FileOutputStream(tempFile);
... | [
"public",
"void",
"downloadAndInstall",
"(",
")",
"throws",
"IOException",
"{",
"installDir",
".",
"mkdirs",
"(",
")",
";",
"File",
"tempFile",
"=",
"File",
".",
"createTempFile",
"(",
"\"pax-exam\"",
",",
"\".zip\"",
")",
";",
"FileOutputStream",
"os",
"=",
... | Download and unpacks the archive.
@throws IOException on I/O errors | [
"Download",
"and",
"unpacks",
"the",
"archive",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-wildfly80/src/main/java/org/ops4j/pax/exam/wildfly80/ZipInstaller.java#L59-L76 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam/src/main/java/org/ops4j/pax/exam/options/WarProbeOption.java | WarProbeOption.overlay | public WarProbeOption overlay(String overlayPath) {
overlays.add(new File(overlayPath).toURI().toString());
return this;
} | java | public WarProbeOption overlay(String overlayPath) {
overlays.add(new File(overlayPath).toURI().toString());
return this;
} | [
"public",
"WarProbeOption",
"overlay",
"(",
"String",
"overlayPath",
")",
"{",
"overlays",
".",
"add",
"(",
"new",
"File",
"(",
"overlayPath",
")",
".",
"toURI",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds an overlay from the given path to the WAR. This is similar to the overlay concept of the
Maven WAR Plugin. If the overlay path is a directory, its contents are copied recursively to
the root of the WAR. If the overlay path is an archive, its exploded contents are copied to
the root of the WAR. All overlays are cop... | [
"Adds",
"an",
"overlay",
"from",
"the",
"given",
"path",
"to",
"the",
"WAR",
".",
"This",
"is",
"similar",
"to",
"the",
"overlay",
"concept",
"of",
"the",
"Maven",
"WAR",
"Plugin",
".",
"If",
"the",
"overlay",
"path",
"is",
"a",
"directory",
"its",
"co... | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam/src/main/java/org/ops4j/pax/exam/options/WarProbeOption.java#L148-L151 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam/src/main/java/org/ops4j/pax/exam/options/WarProbeOption.java | WarProbeOption.autoClasspath | public WarProbeOption autoClasspath(boolean includeDefaultFilters) {
useClasspath = true;
if (includeDefaultFilters) {
for (String filter : DEFAULT_CLASS_PATH_EXCLUDES) {
classpathFilters.add(filter);
}
}
return this;
} | java | public WarProbeOption autoClasspath(boolean includeDefaultFilters) {
useClasspath = true;
if (includeDefaultFilters) {
for (String filter : DEFAULT_CLASS_PATH_EXCLUDES) {
classpathFilters.add(filter);
}
}
return this;
} | [
"public",
"WarProbeOption",
"autoClasspath",
"(",
"boolean",
"includeDefaultFilters",
")",
"{",
"useClasspath",
"=",
"true",
";",
"if",
"(",
"includeDefaultFilters",
")",
"{",
"for",
"(",
"String",
"filter",
":",
"DEFAULT_CLASS_PATH_EXCLUDES",
")",
"{",
"classpathFi... | Automatically add libraries and class folders from the current classpath.
@param includeDefaultFilters
should the default classpath excludes be applied?
@return {@code this} for fluent syntax | [
"Automatically",
"add",
"libraries",
"and",
"class",
"folders",
"from",
"the",
"current",
"classpath",
"."
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam/src/main/java/org/ops4j/pax/exam/options/WarProbeOption.java#L228-L236 | train |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java | KarafDistributionOption.karafDistributionConfiguration | public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(
String frameworkURL, String name, String karafVersion) {
return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
} | java | public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(
String frameworkURL, String name, String karafVersion) {
return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
} | [
"public",
"static",
"KarafDistributionBaseConfigurationOption",
"karafDistributionConfiguration",
"(",
"String",
"frameworkURL",
",",
"String",
"name",
",",
"String",
"karafVersion",
")",
"{",
"return",
"new",
"KarafDistributionConfigurationOption",
"(",
"frameworkURL",
",",
... | Configures which distribution options to use. Relevant are the frameworkURL, the
frameworkName and the Karaf version since all of those params are relevant to decide which
wrapper configurations to use.
@param frameworkURL
frameworkURL
@param name
framework name
@param karafVersion
Karaf version
@return option | [
"Configures",
"which",
"distribution",
"options",
"to",
"use",
".",
"Relevant",
"are",
"the",
"frameworkURL",
"the",
"frameworkName",
"and",
"the",
"Karaf",
"version",
"since",
"all",
"of",
"those",
"params",
"are",
"relevant",
"to",
"decide",
"which",
"wrapper"... | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java#L126-L129 | train |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java | KarafDistributionOption.editConfigurationFilePut | public static Option[] editConfigurationFilePut(final String configurationFilePath,
File source, String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, Object value) {
re... | java | public static Option[] editConfigurationFilePut(final String configurationFilePath,
File source, String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, Object value) {
re... | [
"public",
"static",
"Option",
"[",
"]",
"editConfigurationFilePut",
"(",
"final",
"String",
"configurationFilePath",
",",
"File",
"source",
",",
"String",
"...",
"keysToUseFromSource",
")",
"{",
"return",
"createOptionListFromFile",
"(",
"source",
",",
"new",
"FileO... | This option allows to configure each configuration file based on the karaf.home location. The
value is "put" which means it is either replaced or added. For simpler configuration you can
add a file source. If you want to put all values from this file do not configure any
keysToUseFromSource; otherwise define them to us... | [
"This",
"option",
"allows",
"to",
"configure",
"each",
"configuration",
"file",
"based",
"on",
"the",
"karaf",
".",
"home",
"location",
".",
"The",
"value",
"is",
"put",
"which",
"means",
"it",
"is",
"either",
"replaced",
"or",
"added",
".",
"For",
"simple... | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java#L194-L204 | train |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java | KarafDistributionOption.editConfigurationFileExtend | public static Option[] editConfigurationFileExtend(final String configurationFilePath,
File source, String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, Object value) {
... | java | public static Option[] editConfigurationFileExtend(final String configurationFilePath,
File source, String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, Object value) {
... | [
"public",
"static",
"Option",
"[",
"]",
"editConfigurationFileExtend",
"(",
"final",
"String",
"configurationFilePath",
",",
"File",
"source",
",",
"String",
"...",
"keysToUseFromSource",
")",
"{",
"return",
"createOptionListFromFile",
"(",
"source",
",",
"new",
"Fi... | This option allows to configure each configuration file based on the karaf.home location. The
value is "extend" which means it is either replaced or added. For simpler configuration you
can add a file source. If you want to put all values from this file do not configure any
keysToUseFromSource; otherwise define them to... | [
"This",
"option",
"allows",
"to",
"configure",
"each",
"configuration",
"file",
"based",
"on",
"the",
"karaf",
".",
"home",
"location",
".",
"The",
"value",
"is",
"extend",
"which",
"means",
"it",
"is",
"either",
"replaced",
"or",
"added",
".",
"For",
"sim... | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java#L295-L305 | train |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-container-rbc-client/src/main/java/org/ops4j/pax/exam/rbc/client/intern/RemoteBundleContextClientImpl.java | RemoteBundleContextClientImpl.getRegistry | private Registry getRegistry(int port) throws RemoteException {
Registry reg;
String hostName = System.getProperty("java.rmi.server.hostname");
if (hostName != null && !hostName.isEmpty()) {
reg = LocateRegistry.getRegistry(hostName, port);
}
else {
reg = ... | java | private Registry getRegistry(int port) throws RemoteException {
Registry reg;
String hostName = System.getProperty("java.rmi.server.hostname");
if (hostName != null && !hostName.isEmpty()) {
reg = LocateRegistry.getRegistry(hostName, port);
}
else {
reg = ... | [
"private",
"Registry",
"getRegistry",
"(",
"int",
"port",
")",
"throws",
"RemoteException",
"{",
"Registry",
"reg",
";",
"String",
"hostName",
"=",
"System",
".",
"getProperty",
"(",
"\"java.rmi.server.hostname\"",
")",
";",
"if",
"(",
"hostName",
"!=",
"null",
... | shared utility module | [
"shared",
"utility",
"module"
] | 7f83796cbbb857123d8fc7fe817a7637218d5d77 | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-container-rbc-client/src/main/java/org/ops4j/pax/exam/rbc/client/intern/RemoteBundleContextClientImpl.java#L265-L275 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.