congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
AttributeNameConverter
Code IndexAdd Tabnine to your IDE (free)

How to use
AttributeNameConverter
in
cdc.util.data.util

Best Java code snippets using cdc.util.data.util.AttributeNameConverter (Showing top 6 results out of 315)

origin: com.gitlab.cdc-java.util/cdc-util-data

/**
 * Returns a converter that first applies {@code other} then this converter.
 *
 * @param other The other converter.
 * @return A converter that first applies {@code other} then this converter.
 * @throws IllegalArgumentException When {@code other} is {@code null}.
 */
public default AttributeNameConverter compose(AttributeNameConverter other) {
  Checks.isNotNull(other, "other");
  return (Element element,
      String name) -> convertAttributeName(element, other.convertAttributeName(element, name));
}
origin: com.gitlab.cdc-java.util/cdc-util-data

@Test
public void testSetNameOfMatchingAttributes() throws IOException {
  final String source = XML + EOL
      + "<root x='a'>" + EOL
      + "<child y='a'/>" + EOL
      + "</root>";
  final String expected = XML + EOL
      + "<root X='a'>" + EOL
      + "<child Y='a'/>" + EOL
      + "</root>";
  final Document doc = XmlDataReader.load(source, StandardCharsets.UTF_8);
  DataUtil.setNameOfMatchingAttributes(doc,
                     AttributePredicate.ANY_ATTRIBUTE,
                     AttributeNameConverter.fromNameFunction(String::toUpperCase),
                     DataUtil.RECURSE);
  final String target = XmlDataWriter.toString(doc, INDENT, XmlWriter.Feature.USE_SINGLE_QUOTE);
  assertEquals(expected, target);
}
origin: com.gitlab.cdc-java.util/cdc-util-data

reader.setAttributeNameConverter(AttributeNameConverter.fromPathMap(margs.renamed));
reader.setElementNameConverter(ElementNameConverter.fromPathMap(margs.renamed));
DataUtil.setNameOfMatchingAttributes(document,
                   AttributePredicate.ANY_ATTRIBUTE,
                   AttributeNameConverter.fromPathMap(margs.renamed),
                   DataUtil.RECURSE);
DataUtil.setNameOfMatchingElements(document,
origin: com.gitlab.cdc-java.util/cdc-util-data

/**
 * Returns a converter that first applies this converter and then {@code other}.
 *
 * @param other The other converter.
 * @return A converter that first applies this converter and then {@code other}.
 * @throws IllegalArgumentException When {@code other} is {@code null}.
 */
public default AttributeNameConverter andThen(AttributeNameConverter other) {
  Checks.isNotNull(other, "other");
  return (Element element,
      String name) -> other.convertAttributeName(element, convertAttributeName(element, name));
}
origin: com.gitlab.cdc-java.util/cdc-util-data

private final String convertAttributeName(Element element,
                     String name) {
  return shareAttributeName(attributeNameConverter.convertAttributeName(element, name));
}
origin: com.gitlab.cdc-java.util/cdc-util-data

element.addAttribute(new Attribute(converter.convertAttributeName(element, att.getName()),
                  att.getValue()));
cdc.util.data.utilAttributeNameConverter

Javadoc

Interface used to convert (replace) an attribute name.

Most used methods

  • convertAttributeName
    Returns the name that should be used instead of the original name.
  • fromNameFunction
    Creates a new AttributeNameConverter from a name converter function. Conversion is independent of el
  • fromPathMap

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • addToBackStack (FragmentTransaction)
  • Kernel (java.awt.image)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now