46 lines
1.4 KiB
Java
46 lines
1.4 KiB
Java
|
package org.simpleframework.xml.stream;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class HyphenBuilder implements Style {
|
||
|
@Override // org.simpleframework.xml.stream.Style
|
||
|
public String getAttribute(String str) {
|
||
|
if (str != null) {
|
||
|
return new Parser(str).process();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Style
|
||
|
public String getElement(String str) {
|
||
|
if (str != null) {
|
||
|
return new Parser(str).process();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
class Parser extends Splitter {
|
||
|
final HyphenBuilder this$0;
|
||
|
|
||
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||
|
private Parser(HyphenBuilder hyphenBuilder, String str) {
|
||
|
super(str);
|
||
|
this.this$0 = hyphenBuilder;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Splitter
|
||
|
protected void parse(char[] cArr, int i, int i2) {
|
||
|
cArr[i] = toLower(cArr[i]);
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Splitter
|
||
|
protected void commit(char[] cArr, int i, int i2) {
|
||
|
this.builder.append(cArr, i, i2);
|
||
|
if (i + i2 < this.count) {
|
||
|
this.builder.append('-');
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|