Skip to content
Permalink
Browse files
Improve ModelElement encapsulation
  • Loading branch information
ngmr committed Mar 18, 2016
1 parent bef8dcf commit 6e0a2827b5dfdb8bcf03b7bc32bb751350477e2c
Showing 24 changed files with 199 additions and 234 deletions.
@@ -18,7 +18,7 @@

package org.apache.yoko.rmi.impl;

public class AbstractObjectDescriptor extends ValueDescriptor {
class AbstractObjectDescriptor extends ValueDescriptor {
protected AbstractObjectDescriptor(Class type, TypeRepository repository) {
super(type, repository);
}
@@ -18,7 +18,7 @@

package org.apache.yoko.rmi.impl;

public class AnyDescriptor extends TypeDescriptor {
class AnyDescriptor extends TypeDescriptor {
AnyDescriptor(Class type, TypeRepository rep) {
super(type, rep);
}
@@ -21,18 +21,15 @@
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Map;
import java.util.Vector;
import java.util.logging.Logger;

import javax.rmi.CORBA.Util;

import org.omg.CORBA.MARSHAL;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.ValueMember;
import org.omg.CORBA.portable.InputStream;

public abstract class ArrayDescriptor extends ValueDescriptor {
abstract class ArrayDescriptor extends ValueDescriptor {
protected int order;

protected Class basicType;
@@ -50,8 +47,7 @@ public String getRepositoryID() {
if (elementType.isPrimitive() || elementType == Object.class) {
_repid = "RMI:" + getJavaClass().getName() + ":0000000000000000";
} else {
TypeDescriptor desc = getTypeRepository()
.getDescriptor(elementType);
TypeDescriptor desc = repo.getDescriptor(elementType);
String elemRep = desc.getRepositoryID();
String hash = elemRep.substring(elemRep.indexOf(':', 4));
_repid = "RMI:" + getJavaClass().getName() + hash;
@@ -72,8 +68,7 @@ public String getElementRepositoryID() {
// use the descriptor type past the array type marker
_elementRepid = "RMI:" + getJavaClass().getName().substring(1) + ":0000000000000000";
} else {
TypeDescriptor desc = getTypeRepository()
.getDescriptor(elementType);
TypeDescriptor desc = repo.getDescriptor(elementType);
_elementRepid = desc.getRepositoryID();
}

@@ -98,7 +93,7 @@ protected ArrayDescriptor(Class type, Class elemType, TypeRepository rep) {
public String getIDLName() {
StringBuffer sb = new StringBuffer("org_omg_boxedRMI_");

TypeDescriptor desc = getTypeRepository().getDescriptor(basicType);
TypeDescriptor desc = repo.getDescriptor(basicType);

// The logic that looks for the last "_" fails when this is a
// long_long primitive type. The primitive types have a "" package
@@ -209,8 +204,7 @@ org.omg.CORBA.ValueMember[] getValueMembers() {

_value_members = new org.omg.CORBA.ValueMember[1];

TypeDescriptor elemDesc = getTypeRepository().getDescriptor(
elementType);
TypeDescriptor elemDesc = repo.getDescriptor(elementType);

String elemRepID = elemDesc.getRepositoryID();

@@ -228,7 +222,7 @@ org.omg.CORBA.ValueMember[] getValueMembers() {
}

void addDependencies(java.util.Set classes) {
getTypeRepository().getDescriptor(basicType).addDependencies(classes);
repo.getDescriptor(basicType).addDependencies(classes);
}

}
@@ -316,7 +310,7 @@ public void resolve(Object value) {

void printFields(java.io.PrintWriter pw, java.util.Map recurse, Object val) {
Object[] arr = (Object[]) val;
TypeDescriptor desc = getTypeRepository().getDescriptor(elementType);
TypeDescriptor desc = repo.getDescriptor(elementType);
pw.print("length=" + arr.length + "; ");
for (int i = 0; i < arr.length; i++) {
if (i != 0) {
@@ -397,7 +391,7 @@ public void resolve(Object value) {

void printFields(java.io.PrintWriter pw, java.util.Map recurse, Object val) {
Object[] arr = (Object[]) val;
TypeDescriptor desc = getTypeRepository().getDescriptor(elementType);
TypeDescriptor desc = repo.getDescriptor(elementType);
pw.print("length=" + arr.length + "; ");
for (int i = 0; i < arr.length; i++) {
if (i != 0) {
@@ -469,7 +463,7 @@ public void resolve(Object value) {

void printFields(java.io.PrintWriter pw, java.util.Map recurse, Object val) {
Object[] arr = (Object[]) val;
TypeDescriptor desc = getTypeRepository().getDescriptor(elementType);
TypeDescriptor desc = repo.getDescriptor(elementType);
pw.print("length=" + arr.length + "; ");
for (int i = 0; i < arr.length; i++) {
if (i != 0) {
@@ -550,7 +544,7 @@ public void resolve(Object value) {

void printFields(java.io.PrintWriter pw, java.util.Map recurse, Object val) {
Object[] arr = (Object[]) val;
TypeDescriptor desc = getTypeRepository().getDescriptor(elementType);
TypeDescriptor desc = repo.getDescriptor(elementType);
pw.print("length=" + arr.length + "; ");
for (int i = 0; i < arr.length; i++) {
if (i != 0) {
@@ -13,7 +13,7 @@
import org.apache.yoko.util.cmsf.RepIds;
import org.omg.CORBA.MARSHAL;

public class ClassDescDescriptor extends ClassBaseDescriptor {
class ClassDescDescriptor extends ClassBaseDescriptor {
private static final Logger logger = Logger.getLogger(ClassDescDescriptor.class.getName());

private Field repid_field;
@@ -31,7 +31,7 @@

import org.omg.CORBA.MARSHAL;

public class ClassDescriptor extends ClassBaseDescriptor {
class ClassDescriptor extends ClassBaseDescriptor {
private static final Logger logger = Logger.getLogger(ClassDescriptor.class.getName());

private Field repid_field;
@@ -27,12 +27,11 @@
* Window>Preferences>Java>Templates. To enable and disable the creation of type
* comments go to Window>Preferences>Java>Code Generation.
*/
public class DateValueDescriptor extends ValueDescriptor {
class DateValueDescriptor extends ValueDescriptor {

/**
* Constructor for DateValueDescriptor.
*
* @param type
*
* @param repository
*/
public DateValueDescriptor(TypeRepository repository) {
@@ -18,7 +18,7 @@

package org.apache.yoko.rmi.impl;

public class EnumDescriptor extends ValueDescriptor {
class EnumDescriptor extends ValueDescriptor {
public EnumDescriptor(Class<?> type, TypeRepository repo) {
super(type, repo);
}
@@ -38,7 +38,7 @@ public final void init() {
super.init();
FieldDescriptor[] newFields = new FieldDescriptor[1];
for (FieldDescriptor field: _fields) {
if (!!!field.getJavaName().equals("name")) continue;
if (!!!field.java_name.equals("name")) continue;
newFields[0] = field;
break;
}
@@ -25,7 +25,7 @@
import org.omg.CORBA.portable.IndirectionException;
import org.omg.CORBA.portable.InputStream;

public class EnumSubclassDescriptor extends ValueDescriptor {
class EnumSubclassDescriptor extends ValueDescriptor {
@SuppressWarnings("rawtypes")
private final Class enumType;

@@ -18,7 +18,7 @@

package org.apache.yoko.rmi.impl;

public class ExceptionDescriptor extends ValueDescriptor {
class ExceptionDescriptor extends ValueDescriptor {
ExceptionDescriptor(Class type, TypeRepository repository) {
super(type, repository);
}
@@ -21,7 +21,7 @@
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.ValueDefPackage.FullValueDescription;

public class FVDEnumDescriptor extends EnumDescriptor {
class FVDEnumDescriptor extends EnumDescriptor {
private final FullValueDescription fvd;
private final String repid;

@@ -23,7 +23,7 @@

import java.util.Objects;

public class FVDEnumSubclassDescriptor extends EnumSubclassDescriptor {
class FVDEnumSubclassDescriptor extends EnumSubclassDescriptor {
private final FullValueDescription fvd;
private final String repid;

@@ -24,7 +24,7 @@
/**
* @author krab
*/
public class FVDValueDescriptor extends ValueDescriptor {
class FVDValueDescriptor extends ValueDescriptor {
FullValueDescription fvd;

String repid;
@@ -65,7 +65,7 @@ FieldDescriptor findField(ValueMember valueMember) {
FieldDescriptor result = null;

for (Class c = getJavaClass(); c != null; c = c.getSuperclass()) {
TypeDescriptor td = getTypeRepository().getDescriptor(c);
TypeDescriptor td = repo.getDescriptor(c);
if (td instanceof ValueDescriptor) {
ValueDescriptor vd = (ValueDescriptor) td;
FieldDescriptor[] fds = vd._fields;

0 comments on commit 6e0a282

Please sign in to comment.