@Nonnull public DataTablesServerDataCell getCellAtIndex (@Nonnegative final int nIndex) { return m_aCells.get (nIndex); } }
@Nonnull public IJSExpression getAsExpression () { final int nSize = m_aElements.size (); if (nSize == 0) throw new IllegalStateException ("Empty jQuery selector is not allowed!"); if (nSize == 1) return m_aElements.getFirst ().getExpression (); // Concatenate with ' ' IJSExpression ret = m_aElements.getFirst ().getExpression (); for (int i = 1; i < nSize; ++i) ret = ret.plus (' ').plus (m_aElements.get (i).getExpression ()); return ret; }
@Nonnull public DTSSRequestDataColumn getColumn (@Nonnegative final int nIndex) { return m_aColumnData.get (nIndex); }
final ICSSExpressionMember aMemberY = aExpressionMembers.get (0); final ICSSExpressionMember aMemberX = aExpressionMembers.get (1); aExpressionMembers.add (aMemberY.getClone ()); aExpressionMembers.add (aMemberX.getClone ()); final ICSSExpressionMember aMemberX = aExpressionMembers.get (1); aExpressionMembers.add (aMemberX.getClone ());
@Nullable public final ITEMTYPE getChildAtIndex (@Nonnegative final int nIndex) { if (m_aChildren == null) throw new IndexOutOfBoundsException ("Tree item has no children!"); return m_aChildren.get (nIndex); }
@Nullable public final ITEMTYPE getChildAtIndex (@Nonnegative final int nIndex) { if (m_aChildren == null) throw new IndexOutOfBoundsException ("Tree item has no children!"); return m_aChildren.get (nIndex); }
@Nonnull public static VESID parseID (@Nullable final String sVESID) { final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID); final int nSize = aParts.size (); if (nSize >= 3 && nSize <= 4) return new VESID (aParts.get (0), aParts.get (1), aParts.get (2), nSize >= 4 ? aParts.get (3) : null); throw new IllegalArgumentException ("Invalid VESID '" + sVESID + "' provided!"); }
/** * Create a new identifier from the URI representation. This is the inverse * operation of {@link IIdentifier#getURIEncoded()}. The URI part must have the * layout <code>scheme::value</code>. This method accepts all identifier schemes * and values. * * @param sURIPart * The URI part in the format <code>scheme::value</code>. It must NOT be * percent encoded! May be <code>null</code>. * @param aConverter * Converter function to be used. The first parameter is the scheme, the * second parameter is the value. May not be <code>null</code>. * @return The created {@link IIdentifier} instance or <code>null</code> if the * passed identifier is not a valid URI encoded identifier */ @Nullable default <T extends IIdentifier> T parseURIPartOrNull (@Nullable final String sURIPart, @Nonnull final BiFunction <String, String, T> aConverter) { if (sURIPart == null) return null; // This is quicker than splitting with RegEx! final ICommonsList <String> aSplitted = StringHelper.getExploded (CIdentifier.URL_SCHEME_VALUE_SEPARATOR, sURIPart, 2); if (aSplitted.size () != 2) return null; // Okay, we have exactly 2 parts -> create the identifier return aConverter.apply (aSplitted.get (0), aSplitted.get (1)); }
/** * Check if the passed identifier value is valid in the PEPPOL default * participant identifier scheme (iso6523-actorid-upis). * * @param sValue * The value to be validated. Must not be <code>null</code>. * @return <code>true</code> if the value is valid, <code>false</code> * otherwise. */ static boolean isValidValueWithDefaultScheme (@Nonnull final String sValue) { // Check if the separator between identifier issuing agency and value is // present - can only be done if the default scheme is present final ICommonsList <String> aParts = StringHelper.getExploded (':', sValue, 2); if (aParts.size () != 2) return false; final String sIdentifierIssuingAgencyID = aParts.get (0); if (sIdentifierIssuingAgencyID.length () != 4 || !StringParser.isUnsignedInt (sIdentifierIssuingAgencyID)) return false; final String sIdentifierValue = aParts.get (1).trim (); return sIdentifierValue.length () > 0; } }
@OverridingMethodsMustInvokeSuper public boolean isEqualContent (@Nullable final IMicroNode o) { if (o == this) return true; if (o == null || !getClass ().equals (o.getClass ())) return false; final AbstractMicroNodeWithChildren rhs = (AbstractMicroNodeWithChildren) o; if (m_aChildren == null && rhs.m_aChildren == null) return true; if (m_aChildren == null || rhs.m_aChildren == null) return false; final int nMax = m_aChildren.size (); final int nMaxRhs = rhs.m_aChildren.size (); if (nMax != nMaxRhs) return false; for (int i = 0; i < nMax; ++i) { final IMicroNode aChild1 = m_aChildren.get (i); final IMicroNode aChild2 = rhs.m_aChildren.get (i); if (!aChild1.isEqualContent (aChild2)) return false; } return true; }
public int [] getIntArrayProperty (final String name, final int [] def) throws NumberFormatException { final String vals = getStringProperty (name); if (vals == null) return def; final StringTokenizer stok = new StringTokenizer (vals, ","); final ICommonsList <Integer> ints = new CommonsArrayList <> (); try { while (stok.hasMoreTokens ()) { try { ints.add (Integer.valueOf (stok.nextToken ().trim ())); } catch (final NumberFormatException nfe) { throw new NumberFormatException (" '" + vals + "'"); } } final int [] outInts = new int [ints.size ()]; for (int i = 0; i < ints.size (); i++) outInts[i] = ints.get (i).intValue (); return outInts; } catch (final Exception e) { return def; } }
@Nonnull public static Schema createSchema (@Nonnull final SchemaFactory aSchemaFactory, @Nonnull final String sSchemaTypeName, @Nonnull @Nonempty final ICommonsList <? extends IReadableResource> aResources) { ValueEnforcer.notNull (aSchemaFactory, "SchemaFactory"); ValueEnforcer.notEmptyNoNullValue (aResources, "Resources"); // Collect all sources final Source [] aSources = new Source [aResources.size ()]; for (int i = 0; i < aResources.size (); ++i) aSources[i] = TransformSourceFactory.create (aResources.get (i)); try { final Schema ret = aSchemaFactory.newSchema (aSources); if (ret == null) throw new IllegalStateException ("Failed to create " + sSchemaTypeName + " schema from " + aResources.toString ()); return ret; } catch (final SAXException ex) { throw new IllegalArgumentException ("Failed to parse " + sSchemaTypeName + " from " + aResources.toString (), ex); } }
/** * Utility method to convert a media query string to a structured list of * {@link CSSMediaQuery} objects. * * @param sMediaQuery * The media query string to parse. May be <code>null</code>. * @param eVersion * The CSS version to use. May not be <code>null</code>. * @return <code>null</code> if the passed media query is <code>null</code> or * empty or not parsable. */ @Nullable public static ICommonsList <CSSMediaQuery> parseToMediaQuery (@Nullable final String sMediaQuery, @Nonnull final ECSSVersion eVersion) { if (StringHelper.hasNoText (sMediaQuery)) return null; final String sCSS = "@media " + sMediaQuery + " {}"; final CascadingStyleSheet aCSS = CSSReader.readFromString (sCSS, eVersion); if (aCSS == null) return null; final CSSMediaRule aMediaRule = aCSS.getAllMediaRules ().get (0); return aMediaRule.getAllMediaQueries (); }
@Nonnull protected PhotonRequestParameters getParametersFromPath (@Nonnull final String sPath, @Nonnull final IMenuTree aMenuTree) { // Use paths for standard menu items final PhotonRequestParameters ret = new PhotonRequestParameters (); for (final String sPair : StringHelper.getExploded ('/', StringHelper.trimStartAndEnd (sPath, "/"))) { final ICommonsList <String> aElements = StringHelper.getExploded (m_sSeparator, sPair, 2); if (aElements.size () == 2) { final String sParamName = aElements.get (0); final String sParamValue = aElements.get (1); if (sParamName.equals (getRequestParamNameLocale ())) ret.setLocaleFromString (GlobalLocaleManager.getInstance (), sParamValue); else if (sParamName.equals (getRequestParamNameMenuItem ())) ret.setMenuItemFromString (aMenuTree, sParamValue); else if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Ignoring superfluous parameter '" + sParamName + "' with value '" + sParamValue + "'"); } } return ret; }
for (int i = 0; i < nMaxIndex; ++i) final String sMsg = aMsgLines.get (i); final Throwable t = i == nMaxIndex - 1 ? aSessionLogEntry.getException () : null; if (nLogLevel >= SessionLog.SEVERE)
for (int i = 0; i < v.size (); ++i) factors[i] = v.get (i).intValue ();
throw new IllegalArgumentException(String .format(ERROR_PARSING_STYLE, styleString, errorCollector .getAllParseErrors().get(0).getErrorMessage()));
if (i > 0) _append ('>'); _appendMasked (EXMLCharMode.CDATA, aParts.get (i)); if (i < nParts - 1) _append ("]]");
final IMenuItem aItem = aItems.get (i);
final IMenuItem aItem = aItems.get (i);