protected ClassURIHelper createClassURIHelper() { return new ClassURIHelper(); }
public static URI computeTypeUri(final Class<?> topLevelClass) { return new ClassURIHelper().getFullURI(topLevelClass); }
@Inject public CachingClasspathTypeProviderFactory(ClassLoader classLoader) { super(classLoader); DeclaredTypeFactory factoryDelegate = new DeclaredTypeFactory(new ClassURIHelper()); reusedFactory = new CachingDeclaredTypeFactory(factoryDelegate); }
protected List<JvmType> createObjectReference(Resource resource) { if (resource != null) { // no upper bound found - seems to be an invalid - assume object as upper bound URI objectURI = new ClassURIHelper().getFullURI(Object.class); JvmType objectType = factory.createJvmGenericType(); ((InternalEObject)objectType).eSetProxyURI(objectURI); objectType = (JvmType) EcoreUtil.resolve(objectType, resource); return Collections.singletonList(objectType); } return Collections.emptyList(); } }
/** * {@inheritDoc} * * Returns the value of the 'Type' reference. If there is no type set, * a reference to <code>java.lang.Object</code> is assumed as soon as there is more * than one contained reference. * If there is only one contained reference, its type is returned. */ @Override public JvmType getType() { if (references != null && !references.isEmpty()) { if (references.size() == 1) { return references.get(0).getType(); } if (type == null) { JvmGenericType objectType = TypesFactory.eINSTANCE.createJvmGenericType(); ((InternalEObject) objectType).eSetProxyURI(new ClassURIHelper().getFullURI(Object.class)); type = objectType; } } return super.getType(); }
/** * {@inheritDoc} * * Returns the value of the 'Type' reference. If there is no type set, * a reference to <code>java.lang.Object</code> is assumed. */ @Override public JvmType getType() { if (type == null) { JvmGenericType objectType = TypesFactory.eINSTANCE.createJvmGenericType(); ((InternalEObject) objectType).eSetProxyURI(new ClassURIHelper().getFullURI(Object.class)); setType(objectType); } return super.getType(); }
protected JvmTypeReference createObjectReference(Resource resource) { // no upper bound found - seems to be an invalid - assume object as upper bound URI objectURI = new ClassURIHelper().getFullURI(Object.class); JvmType objectType = factory.createJvmGenericType(); ((InternalEObject)objectType).eSetProxyURI(objectURI); if (resource != null) { objectType = (JvmType) EcoreUtil.resolve(objectType, resource); } JvmParameterizedTypeReference result = factory.createJvmParameterizedTypeReference(); result.setType(objectType); return result; } }