107 lines
3.8 KiB
Java
107 lines
3.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.nre.util.TextUtil
|
|
*/
|
|
package com.tridium.collection;
|
|
|
|
import javax.baja.collection.BICollection;
|
|
import javax.baja.collection.BITable;
|
|
import javax.baja.collection.Column;
|
|
import javax.baja.collection.ColumnList;
|
|
import javax.baja.naming.BOrdScheme;
|
|
import javax.baja.naming.OrdQuery;
|
|
import javax.baja.naming.OrdTarget;
|
|
import javax.baja.naming.SyntaxException;
|
|
import javax.baja.naming.UnresolvedException;
|
|
import javax.baja.nre.util.TextUtil;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.Lexicon;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BCellScheme
|
|
extends BOrdScheme {
|
|
public static final BCellScheme INSTANCE = new BCellScheme();
|
|
public static final Type TYPE;
|
|
private static final Lexicon lex;
|
|
private static final String KEY_PARAM_EXCEPTION = "cellscheme.incorrectparameters";
|
|
private static final String KEY_UNDEFINED_COL = "cellscheme.undefinedcolumn";
|
|
private static final String CELL_SCHEME = "cell";
|
|
static /* synthetic */ Class class$com$tridium$collection$BCellScheme;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
|
|
String string = ordQuery.getBody();
|
|
BObject bObject = ordTarget.get();
|
|
if (bObject instanceof BICollection) {
|
|
String[] stringArray = TextUtil.split((String)string, (char)',');
|
|
if (stringArray.length == 2) {
|
|
BICollection bICollection = (BICollection)((Object)bObject);
|
|
BITable bITable = bICollection.toTable();
|
|
ColumnList columnList = bITable.getColumns();
|
|
Column column = null;
|
|
int n = 0;
|
|
try {
|
|
int n2 = Integer.parseInt(stringArray[0]);
|
|
column = columnList.get(n2);
|
|
}
|
|
catch (NumberFormatException numberFormatException) {
|
|
column = columnList.get(stringArray[0]);
|
|
}
|
|
try {
|
|
n = Integer.parseInt(stringArray[1]);
|
|
}
|
|
catch (NumberFormatException numberFormatException) {
|
|
n = bITable.size() - 1;
|
|
}
|
|
if (column == null) {
|
|
throw new UnresolvedException(lex.getText(KEY_UNDEFINED_COL, new Object[]{stringArray[0]}));
|
|
}
|
|
bObject = bITable.get(n, column);
|
|
} else {
|
|
throw new SyntaxException(lex.getText(KEY_PARAM_EXCEPTION, new Object[]{string}));
|
|
}
|
|
}
|
|
return new OrdTarget(ordTarget, bObject);
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
public BCellScheme() {
|
|
super(CELL_SCHEME);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$collection$BCellScheme;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$collection$BCellScheme = BCellScheme.class("[Lcom.tridium.collection.BCellScheme;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
Class clazz2 = class$com$tridium$collection$BCellScheme;
|
|
if (clazz2 == null) {
|
|
clazz2 = class$com$tridium$collection$BCellScheme = BCellScheme.class("[Lcom.tridium.collection.BCellScheme;", false);
|
|
}
|
|
lex = Lexicon.make(clazz2);
|
|
}
|
|
}
|
|
|