75 lines
2.3 KiB
Java
75 lines
2.3 KiB
Java
|
package org.simpleframework.xml.stream;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class CamelCaseBuilder implements Style {
|
||
|
protected final boolean attribute;
|
||
|
protected final boolean element;
|
||
|
|
||
|
public CamelCaseBuilder(boolean z, boolean z2) {
|
||
|
this.attribute = z2;
|
||
|
this.element = z;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Style
|
||
|
public String getAttribute(String str) {
|
||
|
if (str != null) {
|
||
|
return new Attribute(str).process();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Style
|
||
|
public String getElement(String str) {
|
||
|
if (str != null) {
|
||
|
return new Element(str).process();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
class Attribute extends Splitter {
|
||
|
private boolean capital;
|
||
|
final CamelCaseBuilder this$0;
|
||
|
|
||
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||
|
private Attribute(CamelCaseBuilder camelCaseBuilder, String str) {
|
||
|
super(str);
|
||
|
this.this$0 = camelCaseBuilder;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Splitter
|
||
|
protected void parse(char[] cArr, int i, int i2) {
|
||
|
if (this.this$0.attribute || this.capital) {
|
||
|
cArr[i] = toUpper(cArr[i]);
|
||
|
}
|
||
|
this.capital = true;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.Splitter
|
||
|
protected void commit(char[] cArr, int i, int i2) {
|
||
|
this.builder.append(cArr, i, i2);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
class Element extends Attribute {
|
||
|
private boolean capital;
|
||
|
final CamelCaseBuilder this$0;
|
||
|
|
||
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||
|
private Element(CamelCaseBuilder camelCaseBuilder, String str) {
|
||
|
super(str);
|
||
|
this.this$0 = camelCaseBuilder;
|
||
|
}
|
||
|
|
||
|
@Override // org.simpleframework.xml.stream.CamelCaseBuilder.Attribute, org.simpleframework.xml.stream.Splitter
|
||
|
protected void parse(char[] cArr, int i, int i2) {
|
||
|
if (this.this$0.element || this.capital) {
|
||
|
cArr[i] = toUpper(cArr[i]);
|
||
|
}
|
||
|
this.capital = true;
|
||
|
}
|
||
|
}
|
||
|
}
|