Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
How would I get properties from a javascript object defined in java using GraalJS

I would like to make a java object binding that needs to take in javascript properties. This is the java code I have,


public String name;
public int version;

public void load() {
     Context context = Context.newBuilder().allowExperimentalOptions(true).option("js.nashorn-compat", "true").option("engine.WarnInterpreterOnly", "false").allowHostAccess(HostAccess.ALL).build();

     context.getBindings("js").putMember("setup", this);

     context.eval(Source.newBuilder("js", scriptFile).build());
}

I want to be able to set the name and version variable when the object is defined in javascript using properties like so

var script = setup({
     name: "Test",
     version: 1
});

How would I be able to get the properties and use them to set these variables? I know in javascript you can do this by putting @property {number} but I don't know how I would do something like that in java.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda